Showing posts with label TSM. Show all posts
Showing posts with label TSM. Show all posts

Tuesday, August 30, 2011

Some Helpful Tivoli Storage Manager Scripts

Here are some helpful Tivoli Storage Manager scripts:

def scr RECLAIM "select stgpool_name,reclaim from stgpools where DEVCLASS!='DISK'" desc='Reclaim Thresholds'


def scr SCRATCH "select count(*) as Scratch_count, library_name from libvolumes where status='Scratch' group by library_name" desc='Find Scratch Tape Count"

def scr DBBKSTAT "SELECT date_time, type, backup_series, volume_seq, devclass, volume_name FROM volhistory WHERE ( type='BACKUPFULL' OR type='BACKUPINCR' OR type='DBSNAPSHOT' ) AND date_time>=current_timestamp-48 hours" desc='Show Database Backup Statistics'

def scr DBCLEAN "del volh todate=-7 type=dbb" desc='Purge Database Backups older than 7 days'

def scr BACKUPDBTAPE "ba db dev=3592 t=f" desc='Database Backup to Tape'

def scr BACKUPDBDISK "ba db dev=dbbkc t=f" desc='Database Backup to Disk'

def scr NAS336 "select entity, date(start_time) as StartDate, time(start_time) as StartTime, date(end_time) as EndDate, time(end_time) as EndTime, activity, schedule_name, cast(bytes/1024/1024/1024 as decimal(18,2)) as GB, successful from summary where entity='EMCNS480' and end_time >= current_timestamp-336 hours" desc='Last 336 hours of NAS operations'

Tuesday, April 05, 2011

Backup Logs - Last 14 Days Of Any Given Server

Auditors want these backup log reports all the time. Here a short script to display the last 14 days of backup logs for any given server.

select entity, date(start_time) as StartDate, time(start_time) as StartTime, date(end_time) as EndDate, time(end_time) as EndTime, activity, cast(bytes/1024/1024/1024 as decimal(18,2)) as GB, successful from summary where entity like '%$1%' and end_time >= current_timestamp-336 hours order by entity asc

Save this code as a TSM script and run it using the following syntax:

run script-name server-name

Wednesday, March 30, 2011

Collecting Data for Tivoli Storage Manager Backup/Archive Client: Performance

Collecting Data for Tivoli Storage Manager Backup/Archive Client: Performance

Problem(Abstract)
Collecting troubleshooting documents aid in problem determination and save time resolving Problem Management Records (PMRs).



Resolving the problem
Collecting data early, even before opening the PMR, helps IBM® Support quickly determine if:
Symptoms match known problems (rediscovery).
There is a non-defect problem that can be identified and resolved.
There is a defect that identifies a workaround to reduce severity.
Locating root cause can speed development of a code fix.


Manually Gathering General Information

Please Review the following TSM Performance Tuning Guide:http://publib.boulder.ibm.com/infocenter/tivihelp/v1r1/topic/com.ibm.itsmm.doc/b_perf_tuning_guide.htm

1) From the operating system command prompt, run the following TSM command to gather up general information about TSM and the operating system environment (saved output is written to file dsminfo.txt):
dsmc QUERY SYSTEMINFO

2) From a TSM Admin command line client, enter the following commands:
QUERY SYSTEM > querysys.out

3) Gather the following file and information:
•dsminfo.txt
•querysys.out
•details of operating system levels ( i.e., HP-UX 11.23)
•TSM Client specific version (i.e., 5.4.0.2)


Manually Gathering Client Performance Specific Information

Collect TSM Performance Instrumentation Traces:

1) From the poor performing TSM client system, issue this command from an operating system command prompt:
dsmc INCREMENTAL -TESTFLAG=INSTRUMENT:DETAIL > backup.out
Note:
•-TESTFLAG=INSTRUMENT:DETAIL will generate a file with name "dsminstr.report.x "under the same directory where dsmerror.log locates. For Netware, the file name will be called dsminstr.rep.
•If the slow client is an API client, replace -TESTFLAG=INSTRUMENT:DETAIL with -TESTFLAG=INSTRUMENT:API
•If INCREMENTAL is not the slow action, replace dsmc INCREMENTAL with the appropriate slow TSM client command.
•For users who can't run a manual backup, add the following lines in the according option file for example: dsm.opt
TESTFLAG INSTRUMENT:DETAIL
Recycle Scheduler to active the trace

2) Collect a TSM server instrument trace when the slow client backup is running:
From a TSM Admin command line client, enter the following commands and collect output and trace:
a) Start Instrument tracing:
INSTrument BEGIN (leave trace running for 20 minutes)
b) Collect Process and Session output:
QUERY SESS > sess.out
QUERY PROC > proc.out
QUERY DB > db.out

c) End Instrument tracing:
INSTrument END FILE=inst.out
3) Gather the following files :
•backup.out
•dsminstr.report.x (dsminstr.rep on Netware)
•sess.out
•proc.out
•db.out
•inst.out

Tuesday, March 29, 2011

Counting TSM Sessions Every 15 Minutes and Logging To File With Time Stamp

#!/bin/ksh
#
SessCnt=`dsmadmc -id=admin -password=password -dataonly=yes q sess| grep -c Node`
#
date "+%y%m%d:%X_TSM Session Count=$SessCnt" >>/tmp/tsm_sessions
if [[ $SessCnt -gt 100 ]] ; then
echo TSM Session Count is $SessCnt | mail -s TSM_Sessions_High aix@company.com
fi
#
if [[ $SessCnt -gt 185 ]] ; then
echo TSM Session Count is $SessCnt | mail -s TSM_Sessions_at_MAX joe1@company.com joe2@company.com joe3@company.com
echo TSM Session Count is $SessCnt | mail -s TSM_Sessions_at_MAX joe1@remote.com
fi


Then create a crontab entry

0,15,30,45 * * * * /usr/local/scripts/tsm_session_ck