Check TSM Client Levels

In order to check what level your clients are, your can run a simple select:

select node_name, -
cast (client_version as char)||'.'||-
cast (client_release as char)||'.'||-
cast (client_level as char)||'.'||-
cast (client_sublevel as char (2))-
CLIENT_LVL from nodes

Sometimes when you upgrade the server, you need a minimum level of client. Like the 6.1 server requires all clients to be at 5.5 or higher. To just see what clients are below a certain level, you can run:

select node_name, -
cast (client_version as char)||'.'||-
cast (client_release as char)||'.'||-
cast (client_level as char)||'.'||-
cast (client_sublevel as char (2))-
CLIENT_LVL from nodes where -
cast (client_version as char)||'.'||-
cast (client_release as char)||'.'||-
cast (client_level as char)||'.'||-
cast (client_sublevel as char (2))-
< '5.5.0.0'

Installing TSM Client On Ubuntu

IBM distributes the TSM clients in RPM format, but not in deb format for Debian based Linux distributions. The re are some TSM clients in deb format out there, but the latest I could find is version 5.4. I found that alien converts the RPM files decently enough.

First, install alien:

sudo apt-get install alien

Then, get all the RPMs you want to install in the same directory and run:

alien -k *.rpm

There is a problem with the install scripts that they didn't create a link on my systems:

ln -s /opt/tivoli/tsm/client/lang/EN_US/dsmclientV3.cat /opt/tivoli/tsm/client/ba/bin/EN_US/dsmclientV3.cat

After that, the client should work just as if installed on a Redhat based system.

Storage Pool SHOW commands

Show archives for a given Node within a Policy Set:

SHow Archives PolicySet NodeName

This command will list out all the files in a storage pool that are marked as damaged. To fix them, run an AUDIT VOL command.

SHow DAMAGED poolname

This command was added with TSM version 5.2.2. It will check out all possible destination storage pools for a given client node and tell you if this storage pool can support LAN-free backup and restore.

SHOW LANFREE nodeName storageAgent

Shows the status of the library and its drives:

SHow LIBrary

The fields are:

  • busy=0 means the drive is not mounted or even acquired by TSM.
  • busy=1 should reflect TSM using the drive (Query MOunt). But this could result from drive maintenance. Fix by trying ‘cfgmgr’ AIX command, or killing the lmcpd AIX process and then doing ‘cfgmgr’ or ‘/etc/lmcpd’.
  • online=0 means the drive is “offline”. You can update a drive to be offline, in which case the polled flag will be 0.
  • polled=1 means that TSM could not use the drive for one of three reasons:
    1. The drive is loaded with a Non-TSM volume (eg a cleaner cartridge, or a volume from the other TSM server)
    2. The drive is unavailable to the library manager (usually set this way by load/unload failures)
    3. The drive cannot be opened (some other application has it open, or there’s some connection problem, etc)
  • polled= 1 means the server is polling the drive every 30 seconds to see when the above three conditions all clear (it also means that the online flag should be 0). When the conditions clear, it turns online back to 1 and the drive should now be available to be acquired.

Note that if no tape drive is currently available, TSM will wait rather than kill the client and administrative tasks.

Show all SPACEMGMT Files for node:

SHOW SPAce nodename filespace

Useful for displaying the states and attributes of defined storage pools.

SHOW SSPOOL

You use this command to get statistics from the last migration or backup stgpool process.

SHOW TRANSFERSTATS poolname

This command show the files stored for the node and filespace:

SHOW VERsions nodename filespace

For UNIX clients I’ve had to add namet=unicode. For example,

show versions hnaa * namet=unicode

Shows the volumes being used by a given Node. Does not show Copy Storage Pools. IBM intends to replace this with a similar, supported command.

SHow VOLUMEUSAGE nodename

Database and Log SHOW commands

SHOW BUFSTATS:

Use this command to see if you need to increase your database buffer pool size. An associated command is SHOW BUFV, but it is less obvious what the output means.

Example output is:

    Database Buffer Pool Statistics:

    Total Buffer Latch Requests:   184217213
    Times Scavenging Required:      1123642  0.61%
    Times Scavenging by Stealing:   1105210  0.60%
    Times Scavenging by Waiting:          0  0.00%
    Times Read Required:            1123574  0.61%
    Cache Hit Percentage:             99.39%

SHow BUFVars:

Shows database buffer pool global variables.

SHOW DBTXNT:

Use this command to displays the database transaction table.

Example output is:

    Open objects:
    name ->AS.Segments<- (sp=0)
    name ->SS.Pools<-    (sp=0)
    name ->SS.Pool.Ids<- (sp=0)
    name ->AF.Clusters<- (sp=0)
    Tsn=0:813772319 --> Valid=1, inRollback=0, endNTA=0, State=2, 
    Index=10, LatchCount=0, SavePoint=0, TotLogRecs=0, TotLogBytes=0, 
    UndoLogRecs=0, UndoLogBytes=0, LogReserve=0, PageReserve=0, 
    Elapsed=346279 (secs), MinLsn=0.0.0, MaxLsn=0.0.0, LastLsn=0.0.0, 
    UndoNextLsn=0.0.0, logWriter=False, backupTxn=False

This is showing that this transaction has 4 database tables open, that the transaction is valid, and that it is not writing log records.

SHOW DBV:

Displays database global attributes.

SHOW DBBACKUPVOLS:

Use this command to get details on the latest full and incremental database backup volumes.

SHOW LOGPINNED:

You can use this command if your logfile is running out of space. The oldest active record in the log is pinning the log. This command will tell you what task owns that oldest record. You could follow this up with SHOW LOGPINNED CANCEL which will cancel whatever is holding the pinned record. This is one of those ‘UPDATE’ SHOW commands that you need to use with extreme care, and preferably after advice from Tivoli. However, if your log is rapidly filling up, will you have time to make that support call? It would be best to investigate and test this command before you need to use it in an emergency. The command is only available in TSM version 5.1.7.0 or above.

SHOW LOGV:

You can use this command to display the recovery log global attributes, but it is less obvious what they all mean.

SHOW LOGstats:

Use this command to see statistics on log usage. An associated command is SHOW LOGRESET This command will RESET the log statistics back to 0.

Session SHOW commands

SHow INVObject 0 ObjectId:

Use this command to show an inventory object, reporting its nodename, filespace, management class, and more. This command can be useful if you get errors with objects.

SHOW LOCK:

If your TSM server is running very slow it is worth trying this command. A TSM server uses locks to serialise updates to prevent corruption. You use this command to see what resources are locked.

SHOW RESQUEUE:

The TSM server monitors resource usage and will cancel any resource users that are holding onto resources for too long. You use the SHOW RESQUEUE command to display the resource queue and it will display information about transactions, locks, and other resources.

SHOW SESSION:

Useful for diagnosing hangs or other general session problems while a session is still connected to the server. This is also useful in cases where a session is cancelled or terminated and still appears in QUERY SESSION.

SHOW TXNT:

You use this command to get information about active server transactions. Transactions are the low level operations that actually read or update the database. This command can be useful for diagnosing hangs or other transaction related problems, but the command produces a lot of output, and many of the fields are a bit obscure.

Windows Client SHOW commands

SHOW CACHE:

TSM uses Subfile backups to backup only changed portions of files over slow network links. TSM knows what parts of a file have changed, by storing checksum information in a cache file on the client. This command will display information about the subfile cache, if the client is configured to use subfile backup.

SHOW PLUGINS:

If you want to use extra capabilities like image backup, then they are provided by ?plug-ins?. You use this command to find out what plug-ins are available for this client.

SHOW SYSTEMOBJECT / SHOW SYSTEMSTATE:

You use these commands to find out what system facilities are installed, and which ones can be backed up with TSM. SYSTEMOBJECT is used forWindows 2000 and XP clients, and SYSTEMSTATE for Windows 2003 clients.

SYSTEMSERVICES:

For Windows 2003 clients, displays the SYSTEM SERVICES data that is available on this client. Useful to determine which SYSTEM SERVICES files are installed on this Windows client and those that could be backed up.

Client SHOW commands

SHOW CLUSTER:

Displays information about the disk mappings in a WindowsMicrosoft or a Netware Cluster.

SHOW Options:

Displays the active client options.

SHOW OPTTABLE:

You can configure a client so it can get its option settings from either the client option file or from the server. This command will tell you which one is in use for this client.

SHOW SEssion:

Displays capabilities that this client has for this connection to the server. The client and server report and negotiate the capabilities that each has when a session is started by a client to a server. This show command reports the capabilities available by this server and client.

SHOW TRACEFLAGS:

Use this to determine which trace options could be used for this client.

SHOW VERSION:

Use this command to find out what release and version of TSM is installed.

SQL queries

List the number of clients by platform:

SELECT platform_name,count(*) AS "Number of Nodes" FROM nodes GROUP BY platform_name ORDER BY "Number of Nodes"

List all of the tapes used by a node:

SELECT DISTINCT node_name,volume_name,stgpool_name FROM volumeusage WHERE node_name='xxx'

List all of the nodes using a tape:

SELECT DISTINCT node_name,volume_name,stgpool_name FROM volumeusage WHERE volume_name='xxx'

List tapes used today:

SELECT volume_name,last_write_date FROM volumes WHERE (last_write_date >=current_timestamp - 24 hours)

Or to list the last write date for all the tapes in order:

SELECT volume_name,last_write_date FROM volumes ORDER BY last_write_date

Or to see just the number of tapes written to in the last 24 hours:

SELECT count(*) AS "Tapes Used" FROM volumes WHERE (last_write_date >=current_timestamp - 24 hours)

List tapes with errors:

SELECT volume_name, read_errors,write_errors FROM volumes WHERE (read_errors >= 1 OR write_errors >= 1)

List the number of tapes to be reclaimed at a certain level:

SELECT count(*) FROM volumes WHERE (stgpool_name='TAPEPOOL' AND upper(status)='FULL' AND pct_utilized < 70)

List the MB backed up last night per node:

SELECT entity AS "Node name", CAST(sum(bytes/1024/1024) AS decimal(8,2)) AS "MB xfer", SUBSTR (CAST(min (start_time) AS char(29)),1,10) AS "start date", SUBSTR (CAST(min (start_time) AS char(29)),12,8) AS "start time", SUBSTR(CAST(max (end_time) AS char(29)),1,10) AS "end date", SUBSTR (CAST(max (end_time) AS char(29)),12,8) AS "end time" FROM summary WHERE (activity='BACKUP' AND start_time >= current_timestamp - 24 hours) GROUP BY ENTITY order by "MB xfer"

List how much data was backed up yesterday:

SELECT entity AS "Node name", CAST(sum(bytes/1024/1024) AS decimal(8,2)) AS "MB xfer", SUBSTR (CAST(min (start_time) AS char(29)),1,10) AS "start date", SUBSTR (CAST(min (start_time) AS char(29)),12,8) AS "start time", SUBSTR (CAST(max (end_time) AS char(29)),1,10) AS "end date", SUBSTR (CAST(max (end_time) AS char(29)),12,8) AS "end time" FROM summary WHERE (activity='BACKUP' AND start_time >= current_timestamp - 24 hours) GROUP BY entity

Or to just see how much was backed up system wide:

SELECT CAST(sum(bytes/1024/1024) AS decimal(8,2)) AS "MB xfer" FROM summary WHERE (activity='BACKUP' AND start_time>=current_timestamp - 24 hours)

List what nodes did restores yesterday:

SELECT entity, bytes, start_time, successful FROM summary WHERE (activity='RESTORE' AND start_time>=current_timestamp - 24 hours)

List the tapes in use and max scratch by storage pool:

SELECT a.stgpool_name,a.maxscratch,count(*) AS Volumes FROM stgpools a, volumes b WHERE a.stgpool_name = b.stgpool_name GROUP BY a.stgpool_name,a.maxscratch

List the number of tapes filling and how full by storage pool:

This lists the number of tapes that are "filling" and an average of how full they are per storage pool. This is a query that I wrote for the BigBrother client as a replacement for q stg:

SELECT a.stgpool_name AS "STORAGE POOL", CAST(a.EST_CAPACITY_MB AS DECIMAL(12,0)) AS "SIZE MB", CAST(a.PCT_UTILIZED AS DECIMAL(2,0)) AS "PCT", count(*) AS Filling, CAST(AVG(b.PCT_UTILIZED) AS DECIMAL(2,0)) AS "PCT Full" FROM stgpools a, volumes b WHERE ((a.stgpool_name = b.stgpool_name AND upper(status)='FILLING') OR (a.stgpool_name = b.stgpool_name AND devclass_name='DISK')) GROUP BY a.stgpool_name, a.EST_CAPACITY_MB, a.PCT_UTILIZED

Check database performance:

List the DB Pages backed up per hour (should be 5M or above).

SELECT activity, CAST((end_time) AS date) AS "Date", (examined/cast ((end_time-start_time) seconds AS DECIMAL(18,13))*3600) "Pages backed up/Hr" FROM summary WHERE activity='FULL_DBBACKUP' AND days(end_time) - days(start_time)=0M

List the DB Pages expired per hour (should be 3.8M or above).

SELECT activity, CAST((end_time) AS date) AS "Date", (examined/CAST((end_time-start_time) seconds AS DECIMAL(24,2))*3600) "Objects Examined Up/Hr" FROM summary WHERE activity='EXPIRATION'

Forcing TSM to delete files

It’s possible under some circumstances to have files stored in TSM that the client won’t or can’t delete. This usually happens with TDP installations. You can force TSM to delete these backups, but do so very carefully. It’s possible to delete the wrong backup easily. Run this on a UNIX client or server.

First get a list of all the files a node has backed up:

dsmadmc -id=userid -pass=userpass "show versions nodename * namet=unicode" > tsm_vers.out

Edit the output file and only leave the backups that you want to delete. This command reads that input file and deletes any backups in it:

for objid in `grep ObjId tsm_vers.out | cut -d"." -f2 | cut -d "," -f1` do 
     dsmadmc -id=userid -pass=userpass "delete object 0 $objid"
done

Update:
At some point the output of “show vers” has changed slightly, this should work with version 6.X:

for objid in `grep ObjId tsm_vers.out | cut -d":" -f2 | cut -d "," -f1` do 
     dsmadmc -id=userid -pass=userpass "delete object 0 $objid"
done