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, May 03, 2011

Information necessary to troubleshoot NAS NDMP issues

In order to minimize the overall Service Request resolution time we strongly recommend that the following information is provided and logged to the Service Request. The information will enable our Support Engineers to deal with your request in a more effective and timely manner. Please cut / paste questions plus responses into the Service Request.

  • Provide a detailed problem description that includes symptoms, error codes, error messages, and/or screen captures:


    • At what stage did the problem occur i.e. during a full backup, incremental backup, non-DAR restore, or DAR restore?

    • Was backup on a checkpoint file system or Production File System (PFS)? If it was on PFS, were files being accessed while the backup was in progress (e.g. file deletion, file manipulation or file creation etc.)?

    • Did backups or restores work properly in the past? If yes, has there been any changes whatsoever in the backup environment, tape drive, media, zoning, new param, new patches, etc..?Was the backup or restore canceled or aborted at any time?

    • How and when did the backup/restore stop?

    • When the job(s) fail what is the error message?

    • Is the backup/restore spanning to multiple tapes? If yes, are more tapes available when the job spans to the next tape?


  • NDMP client questions:


    • What is the version and patch level of the Vendor NDMP client software?

    • Is the NDMP client running on a UNIX or NT platform and what is the OS version and patch(es) or Service Pack level? What local language is the NDMP client is running?

    • Any special environmental backup settings? If yes, provide details.

    • Does the NDMP client support Direct Access Restore (DAR)? If yes, is it be enabled?

    • Is Internationalization enabled on the NDMP client?

    • Are all required processes/services running? Please verify the license and NDMP application is installed properly.

    • Please provide the NDMP software verbose log just for the problem areas if possible. For example, Networker daemons log, etc.

    • Is there an open support ticket with the Backup NDMP client vendor? If yes, please provide the ticket number and contact information. The NDMP client vendor can also assist with troubleshooting.


  • Connectivity questions:


    • Provide detailed topology information from the Data Mover to tape drive including any devices in between.

    • Please provide the device vendor and firmware version. For example, if this is SAN environment, provide switch, FC-SCSI bridge information, tape drive firmware version, etc. If it is SCSI connection, please provide the SCSI cable length.

    • Is tape library in a DDS (Dynamic Drive Sharing) environment?
      Provide topology information between Data Mover and the NDMP client vendor software host connection.

    • Please provide the IP and hostname of the NDMP Host running the NDMP software.


Thursday, April 28, 2011

CachéDB/EPIC HP Business Copy Script

Finally figured out a way to execute pairresync, pairsplit, EPIC's InstFreeze and InstThaw from the proxy backup server.

HORCMINST=1
HORCC_MRCF=1
#
logFile=/tmp/`basename $0`_`date '+%a'`.log
#
# Issue the resync
date '+%X_About to resync" >$logFile
pairresync -g dbgroup -IBC1 >>$logFile
#
# Wait for the resync to complete
#
date '+%X_Waiting for resync" >>$logFile
while true ; do
if [[ `pairdisplay -g dbgroup -IBC1 | egrep -c 'COPY|PSUS|SSUS'` -eq 0 ]] ; then
date '+%X_Resync Complete" >>$logFile
break
fi
sleep 20
done
#
sleep 60
#
# Freeze the Epic system
date '+%X_About to Freeze" >>$logFile
ssh epicserver "/epic/prd/bin/instfreeze;sync;sync;sync" >>$logFile
sleep 15
date '+%X_About to Split" >>$logFile
pairsplit -g dbgroup -IBC1 >>$logFile
sleep 15
date '+%X_About to Thaw" >>$logFile
ssh epicserver /epic/prd/bin/instthaw >>$logFile
sleep 15
date '+%X_All Done" >>$logFile

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

AIX Last Login Information

for user in ` lsuser -a time_last_login ALL| grep -v =` ; do
echo “$user NEVER”
done


for user in `lsuser -a time_last_login ALL| grep =|sed 's/ time_last_login=/:/'` ; do
last=`echo $user|cut -d: -f2`
id=`echo $user | cut -d: -f1`
echo "$id `perl -le \"print scalar localtime $last \" `"
done

Wednesday, March 30, 2011

What is a JAR file?

The JAR file format is based on the popular ZIP file format, and is used for aggregating many files into one. Unlike ZIP files, JAR files are used not only for archiving and distribution, but also for deployment and encapsulation of libraries, components, and plug-ins, and are consumed directly by tools such as compilers and JVMs. Special files contained in the JAR, such as manifests and deployment descriptors, instruct tools how a particular JAR is to be treated.

A JAR file might be used:

  • For distributing and using class libraries

  • As building blocks for applications and extensions

  • As deployment units for components, applets, or plug-ins

  • For packaging auxiliary resources associated with components


The JAR file format provides many benefits and features, many of which are not provided with a traditional archive format such as ZIP or TAR. These include:

  • Security. You can digitally sign the contents of a JAR file. Tools that recognize your signature can then optionally grant your software security privileges it wouldn't otherwise have, and detect if the code has been tampered with.

  • Decreased download time. If an applet is bundled in a JAR file, the applet's class files and associated resources can be downloaded by a browser in a single HTTP transaction, instead of opening a new connection for each file.

  • Compression. The JAR format allows you to compress your files for efficient storage.

  • Transparent platform extension. The Java Extensions Framework provides a means by which you can add functionality to the Java core platform, which uses the JAR file for packaging of extensions. (Java 3D and JavaMail are examples of extensions developed by Sun.)

  • Package sealing. Packages stored in JAR files can be optionally sealed to enforce version consistency and security. Sealing a package means that all classes defined in that package must be found in the same JAR file.

  • Package versioning. A JAR file can hold data about the files it contains, such as vendor and version information.

  • Portability. The mechanism for handling JAR files is a standard part of the Java platform's core API.


Compressed and uncompressed JARs

The jar tool (see The jar tool for details) compresses files by default. Uncompressed JAR files can generally be loaded more quickly than compressed JAR files, because the need to decompress the files during loading is eliminated, but download time over a network may be longer for uncompressed files.

The jar tool

To perform basic tasks with JAR files, you use the Java Archive Tool (jar tool) provided as part of the Java Development Kit. You invoke the jar tool with the jar command. Table 1 shows some common applications:

Common usages of the jar tool

Creating a JAR file from individual files

jar -cvMf jar-file input-file...

Creating a JAR file from a directory

jar -cvMf jar-file dir-name

Creating an uncompressed JAR file

jar -cvMf0 jar-file input-file...

Updating a JAR file

jar -uf jar-file input-file

Viewing the contents of a JAR file

jar -tf jar-file

Extracting the contents of a JAR file

jar -xf jar-file

Extracting specific files from a JAR file

jar -xf jar-file archived-file


Here is the usage for AIX 6.1:

Usage: jar {ctxu}[vfm0Mi] [jar-file] [manifest-file] [-C dir] files ...
Options:
-c create new archive
-t list table of contents for archive
-x extract named (or all) files from archive
-u update existing archive
-v generate verbose output on standard output
-f specify archive file name
-m include manifest information from specified manifest file
-0 store only; use no ZIP compression
-M do not create a manifest file for the entries
-i generate index information for the specified jar files
-C change to the specified directory and include the following file
If any file is a directory then it is processed recursively.
The manifest file name and the archive file name needs to be specified
in the same order the 'm' and 'f' flags are specified.

Example 1: to archive two class files into an archive called classes.jar:
jar cvf classes.jar Foo.class Bar.class
Example 2: use an existing manifest file 'mymanifest' and archive all the
files in the foo/ directory into 'classes.jar':
jar cvfm classes.jar mymanifest -C foo/ .

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

Monday, March 21, 2011

Delete All Logical Volumes in a Volume Group

for  lv  in  `lsvg  -l  <Volume_Group_Name>  |  grep /  |  awk '{print $1}'`  ;  do
echo  rmlv  -f  $lv
done


Remove the echo to execute.