tsm commands

35
------------------------------------------------------------------------ -------- dsmadmc -id=admin -password=something -outfile=/tmp/output.$$ query actlog begindate=03/22/2007 begintime=now-1:00 enddate=03/22/20-07 endtime=now originator=all ------------------------------------------------------------------------ -------- export node usdcu008 filedata=backupactive devclass=LTO3_DC scratch=yes ------------------------------------------------------------------------ -------- hostname:1580 for web port new versions use websm dsmadmc -id=admin -pass=$TSMPWD "ba volhist" dsmadmc -id=xxx -password=xxx "q sys f=d" | grep pattern dsmadmc -id=xxx -password=xxx "q sys f=d" > /tmp/myfile dsmadmc -id=xxx -password=xxx -tabdelimited outfile=/some/path/file "q sys f=d" dsmadmc -id=xxx -password=xxx -comma outfile=/some/path/file "q sys f=d" client dsm (GUI) dsmc (CLI) dsmadmc dsmadmc -console q actlog [begint=-5] [search=1214i] q drives [f=d] q path [f=d] q proc [f=d] q stg [f=d] q acct [f=d] q sched [f=d] q assoc [f=d] q filespace host update dr online run scratch_count move data VOLID delete vol VOLID discard=yes update volume 001acb access=readwrite ducttape/scripts/drmtapecreation.ksh #Berbee pgm - compiled

Upload: kishor-patil

Post on 28-Mar-2015

1.825 views

Category:

Documents


29 download

TRANSCRIPT

Page 1: Tsm Commands

--------------------------------------------------------------------------------dsmadmc -id=admin -password=something -outfile=/tmp/output.$$ query actlog begindate=03/22/2007 begintime=now-1:00 enddate=03/22/20-07 endtime=now originator=all--------------------------------------------------------------------------------export node usdcu008 filedata=backupactive devclass=LTO3_DC scratch=yes--------------------------------------------------------------------------------hostname:1580 for web portnew versions use websm

dsmadmc -id=admin -pass=$TSMPWD "ba volhist"dsmadmc -id=xxx -password=xxx "q sys f=d" | grep patterndsmadmc -id=xxx -password=xxx "q sys f=d" > /tmp/myfiledsmadmc -id=xxx -password=xxx -tabdelimited outfile=/some/path/file "q sys f=d" dsmadmc -id=xxx -password=xxx -comma outfile=/some/path/file "q sys f=d"

clientdsm (GUI)dsmc (CLI)

dsmadmcdsmadmc -console

q actlog [begint=-5] [search=1214i]q drives [f=d]q path [f=d]q proc [f=d]q stg [f=d]q acct [f=d]q sched [f=d]q assoc [f=d]

q filespace host

update dr online

run scratch_count

move data VOLIDdelete vol VOLID discard=yes

update volume 001acb access=readwrite

ducttape/scripts/drmtapecreation.ksh #Berbee pgm - compiled

dsmadmc to output file/pipe dsmadmc -id=xxx -pass=xxx "q sys f=d" > /tmp/myfile dsmadmc -id=xxx -pass=xxx -tabdelimited outfile=/some/path/file "q sys f=d" dsmadmc -id=xxx -pass=xxx -comma outfile=/some/path/file "q sys f=d" dsmadmc -id=admin -pass=$TSMPWD "ba volhist"

===============================================================================

Page 2: Tsm Commands

SEE if it is working:

#export X windowsdsm - gui

dsmcdsmc>q fidsmc>quit

dsmadmcdsmadmc -se=02

#run a full on a filesystemdsmadmc selective /somedir/* -sbudir=yes

#run an incremental on all possible backup FSdsmc incrementaldsmc i

#run an incremental on a FSdsmc i /somedir -subdir=yes

#restore a file dsmc rest /mp/home/user1/.profile -sub=yes

--------------------------------------------------------------------------------dsmadmc -id=admin -password=xxx -outfile=/tmp/tsm.policiy-detail.txt q pol format=detaileddsmadmc -id=admin -password=xxx -outfile=/tmp/tsm.sched-detailed.txt q sch format=detailed--------------------------------------------------------------------------------dsmcwhen was the latest backup? tsm> q fi

which files from your home pwd are backed up?tsm> q b *dsmc q b \*

which old file versions from your home pwd are backed up?tsm> q b -ina *

simple file restore to another destination:tsm> restore /user/a/anyuser/target.html /user/a/anyuser/destination.html

simple file restore, with replace option:tsm> restore -rep=yes /user/a/anyuser/show.html

restore with subdirstsm> restore -rep=yes -subdir=yes /a/anyuser

selection menu of old file versions:tsm> restore -ina -pick /user/a/anyuser/exp.cmz

Page 3: Tsm Commands

restore old file version with date limittsm> restore -pitd=7/9/2007 /ftp/pgp/jdeprod/RTMAV098 /tmp/RTMAV098

restore old file version with specific datetsm> restore -fromdate=2007.07.09 /user/a/anyuser/x.cpp

restore old directory version, with date limit and replace data with subdirs dsmc query backup -pitdate=05/12/2007 /user/a/anyuser/tesla/ dsmc restore -rep=yes -subdir=yes -pitdate=05/12/2007 /user/a/anyuser/tesla/

--------------------------------------------------------------------------------Import tapes into scratch

Get to a TSM admin prompt

>label libv lib1 search=bulk checkin=scratch labelsource=barcode overwrite=yes

>q pr

#Should see a label libv process running >q req

#Should give a three digit number>Reply (number from above)

#Periodically do a to see how far it is. Takes 2-3 minutes per tape.

>q pr

--------------------------------------------------------------------------------generate backupset usdcu008 KYPOC-II-SET devclass=lto3_dc scratch=yes

generate backupset usdcu024 kypoc /MPORBK001 devclass=lto3_dc retention=30 scratch=yes description=kypoc wait=no

query backupset usdcu024 kypoc.*

query backupsetcontents usdcu024 kypoc.292947502

--------------------------------------------------------------------------------SEE if it is working:

dsmc>q fi>quit

dsmadmcdsmadmc -se=02

Import tapes into scratchGo to a TSM admin prompt

Page 4: Tsm Commands

Label libv lib1 search=bulk checkin=scratch labelsource=barcode overwrite=yes

Enter

Q pr

Should see a label libv process running

Q req

Should give a three digit number

Reply (number from above)

Periodically do a q pr to see how far it is. Takes 2 3 minutes per tape.

hostname:1580 for web portnew versions use websm

dsmadmc -id=admin -pasword=$TSMPWD "ba volhist"dsmadmc -id=xxx -password=xxx q sched f=ddsmadmc -id=xxx -password=xxx "q sys f=d" | grep patterndsmadmc -id=xxx -password=xxx "q sys f=d" > /tmp/myfiledsmadmc -id=xxx -password=xxx -tabdelimited outfile=/some/path/file "q sys f=d" dsmadmc -id=xxx -password=xxx -comma outfile=/some/path/file "q sys f=d"dsmadmc -id=xxx -password=xxx q act begind=-35 > /tmp/matt

clientdsmadmc -id=xxx -password=xxx q act begind=-35 > /tmp/matt

dsm (GUI)dsmc (CLI)

dsmadmcdsmadmc -console

q actlog [begint=-5] [search=1214i]q drives [f=d]q path [f=d]q proc [f=d]q stg [f=d]q acct [f=d]q sched [f=d]q assoc [f=d]

q filespace host

update dr online

run scratch_count

move data VOLIDdelete vol VOLID discard=yes

update volume 001acb access=readwrite

Page 5: Tsm Commands

ducttape/scripts/drmtapecreation.ksh #Berbee pgm - compiled

dsmadmc to output file/pipe dsmadmc -id=xxx -pass=xxx "q sys f=d" > /tmp/myfile dsmadmc -id=xxx -pass=xxx -tabdelimited outfile=/some/path/file "q sys f=d" dsmadmc -id=xxx -pass=xxx -comma outfile=/some/path/file "q sys f=d" dsmadmc -id=admin -pass=$TSMPWD "ba volhist"

===============================================================================TSM daily

review both emailstower2> /tsm/drfilesps -ef | grep drtape #to see if tar/ftp is still running

===============================================================================BCP

before BCP------------stop replication before the day ofcall in tapes

after BCP------------need to be able to: tower2> rsh drtsmserv

===============================================================================My TSM cheat sheet

To create an NT scheduler service, from the command line:

dsmcutil install sched /name:tsm_scheduler /node:<nodename> /password:<nodename> /autostart:yes

Changing start time for a schedule:

update schedule standard daily_files startt=13:15

Adding nodes to a schedule

define association standard daily_files <node(s)>

Removing nodes from a schedule

delete association standard daily_files <node(s)>

List the contents of the storage pool(s) I;e. who is using up how much..

Page 6: Tsm Commands

q filespace <nodename>

Modify storage pool migration percentage

update stgpool <stgpool name> hi=<percentage>

Audit the library after opening main door.

audit library checklabel=barcode

Modifying DB2 TDP stuff (this example was for specifying a mgmtclass)

db2 update db cfg for dwbprod using adsm mgmtclass dbclass

resetting another admins password

update admin <id> <password>

Reverting private volumes with no data (i.e. orphaned tapes) to Scratch volumes.

checkout libv lib01 <vol> checklabel=no remove=bulk

label libv <library_name> checkin=scratch search=bulk labelsource=barcode overwrite=yes

#### MAKE SURE TO REPLY TO REQUEST NUMBER FROM ABOVE!!!

Displaying a list of all the tapes containing data for a particular node:

show volumeusage <nodename>

Proper way to TSM server:

(MUST BE ROOT)

cd /usr/tivoli/tsm/server/binnohup ./dsmserv quiet > /dev/null 2>&1 &

Restarting the TSM-synch for DR/BCP on the original (Tower2) server: (As ROOT)

nohup /home/drtsmusr/scripts/multi-vol.mkdrfiles.ksh > /dev/null 2>&1 &

Restoring files to a different system.

Page 7: Tsm Commands

Just start the TSM client on the target machine with the virtualnodename parm.

dsm -virtualnodename=name_of_source_node

On windows, use dsm -nodename=ABCDEF

Defining a non-admin schedulecommand objects=<path and

command>def sched standard <schedulename> action=

startt=<starttime>incremental

note: double-quotes must be surrounded by single-quotes in order to take effect.

Defining an administrative schedule

def sched <schedname> type=admin cmd=<commands here (i.e. upd stg <stgpool> reclaim=##>) active=yes descr=<description here> start=<time to run/start>

Displaying the log utilization

select pct_utilized from log

Checking disk pool utilization

q vol devclass=disk

changing log mode from/to normal/rollforward

set logm [ r | n ]

Last three lines in /usr/tivoli/tsm/server/bin/dsmserv.opt can be uncommented to bring up TSM with no processing.

What to do if server pukes due to filled logs

Create a new log file (need to have space in the filesystem)

dsmfmt m log /tmp/tsmtmplog 100

Allow the TSM server to use it

dsmserv extend log /tsmtmplog

Page 8: Tsm Commands

Fire up the server (in the forground)

/usr/tivoli/tsm/server/bin/dsmserv

Open a new window and log into the server

Make sure we have scratch tapes available

q libv

Kick off a database backup

backup database dev=ltoclass type=full

After the backup, make sure that there is enough free logspace to delete the temporary log

q log

Set log mode to normal

set logmode normal

Reduce the log size

reduce log 100

Delete TSMs reference to the log

delete logvolume /tmp/tsmtmplog

Set the logmode back to roll forward

set logmode rollforward

Then delete the file from the operating system

rm /tmp/tsmtmplog

Last ditch effort to free up tapes. (when data are still resident but unable to relocate it due to solar-flares) -- This will result in an exposure. The risks of said exposure are determined by the pool to which the disk is assigned. (i.e. a tapepool disk whose data are not currently on mag-cache may will require an offsite tape retrieval for any restores requested from it.)

DEL VOL <volname> DISCARDDATA=yes

If tape is local, it will revert to status of scratch. If offsite, it will revert to empty. And will be returned on next cycle through.

show me the clients and what version of TSM they are running?

Page 9: Tsm Commands

Select node_name,client_version,client_release, \ client_level,client_sublevel from nodes

Forcing a full of the whole box

First unmount any NFS filesystems

for FS in `df | sed 1d| awk {print $7}`; dodsmc sel -subdir=yes $FS/

done

Creating a new DB space and extedning the TSM DB. Make sure to determine the next available filename to be used (i.e. db#.dsm in the /tsm/db directory) you may need to extend the filesystem. I prefer to extend by 1 GB increments. Also any changes made to the primary (at WBMI) TSM server also need to be reflected at the DR (NSI) site.

Create ittsm: SERVER1>def dbvol /tsm/db/db8.dsm formatsize=1000 wait=yes

if the server is down you can create it manually -again, make sure that there is sufficient space in the file system to do so.

dsmfmt m -db /tsm/db/db8.dsm 1000

output from the command:

ANR0984I Process 263 for DEFINE DBVOLUME started in the FOREGROUND at21:22:18.ANR2240I Database volume /tsm/db/db8.dsm defined.ANR0986I Process 263 for DEFINE DBVOLUME running in the FOREGROUND processed 1items for a total of 1,049,624,576 bytes with a completion state of SUCCESS at21:22:52.

Make sure the space is now available to the DB (see maximum extension column)

Available Assigned Maximum Maximum Page Total Used Pct Max. Space Capacity Extension Reduction Size Usable Pages Util Pct (MB) (MB) (MB) (MB) (bytes) Pages Util--------- -------- --------- --------- ------- --------- --------- ----- ----- 5,840 4,840 1,000 100 4,096 1,239,040 1,192,063 96.2 97.9

Extend it

Page 10: Tsm Commands

tsm: SERVER1>extend db 1000

if the server is down the command-line extend command is:

dsmserv extend db /tsm/db/db8/dsm 1000

output from the command:

ANR2248I Database assigned capacity has been extended.

Verify the database extension (see both new maximum extension column and the new percent utilized column)

Available Assigned Maximum Maximum Page Total Used Pct Max. Space Capacity Extension Reduction Size Usable Pages Util Pct (MB) (MB) (MB) (MB) (bytes) Pages Util--------- -------- --------- --------- ------- --------- --------- ----- ----- 5,840 4,840 1,000 100 4,096 1,239,040 1,192,063 96.2 97.9

creating db, log, or data volumes:

dsmfmt m [db|data|log] <path/file> <size>

dsmfmt m db /tsm/tsmdb/db06.dsm 1000

dsmfmt m data /tsm/tsmdata/backup01.dsm 5000

Recovering from a completely FUBARed system:

Copy (move) out the existing dsmserv.dsk file from the server/bin directory

mv /usr/tivoli/tsm/server/bin/dsmserv.dsk /usr/tivoli/tsm/server/bin/dsmserv.dsk.copy

Create a log file and db file using dsmfmt:

dsmfmt m log /tsm/tsmlog/log01.dsm 128dsmfmt m db /tsm/tsmdb/db01.dsm 1000

Run the format command for these volumes

dsmserv format 1 /tsm/tsmlog/log01.dsm 1 /tsm/tsmdb/db01.dsm

Page 11: Tsm Commands

Now you should be able to start the server and define additional volumes:

dsmserv

def logvol /tsm/tsmlog/log02.dsmdef dbvol /tsm/tsmdb/db02.dsm

You may need to create the default admin account:reg admin admin admingrant authority admin classes=system

Creating a tertiary set of tapes

Backup stgpool backuppool copypool2 maxpr=2

Granting authority to adminOnce an admin is registered and updated, they must be granted authority.

grant authority <adminname> classes=<class>

<class> will usually be system

Re-scratching DR tapes after done testing

del vol ###ACB discarddata=yes

On each

move drm ###ACB wherest=vaultret tost=courierret

move drm ###ACB wherest=courierret tost=onsiteret

SQL command to figure out which tapes a nodes data are on usefull for DR tests, etcselect NODE_NAME as NODE,count(distinct VOLUME_NAME) as "Number of Tapes Used"from VOLUMEUSAGEwhere NODE_NAME=<Nodename> and STGPOOL_NAME=<STG Pool ame>group by NODE_NAME

NT clusters password problem fix obtained from www.adsm.org...

have had this problem a couple of times and the instructions are sketchy as to how to update the passwords in the registry. Client seems to get in a twist about the passwords replicated between the nodes somehow.

Page 12: Tsm Commands

Remove the cluster resource for the service from Cluster Admin then execute the following command on each server to update the registry passwords.

dsmcutil update scheduler /name:"<service name>" /clientdir:"<client install dir" /optfile:"<optfilelocation>" /node:<nodename> /password:pass /validate:yes /clusternode:yes /clustername:<clustername> /force:yes

Probably worth logging on manually to TSM from each node then setting up the clustered resource again.

Script to manually run the checkout process.

/usr/local/bin/BerbeeTSM/scripts/NMLadmin_cho.sh

Making policy changes:

You must make the changes to the STANDARD policy_set. Then perform a validation of it, and finally activate it.

upd copygroup ntdev standard ntdev verexists=4

validate policyset ntdev standard

activate policyset ntdev standard

Cleaning up after volumes get a weird name because of a mis-read of the barcode:

If you are unable to use the mangled volume-name (i.e. TSM says that it is named 1#$ACB and q vol 1#$ACB comes back saying unknown volume) the following wont work and you will need to work some magic in some other manner.

Delete the volume:del vol <vol> disacarddata=yes

Perform a resynch of the storage pool it belonged to: (i.e. if it belonged to NTPRODCOPYPOOL)You MUST use the TSM Storage Pools document to determine the hierarchy of the storage pools to determine what pools to synch.

ba stg ntprodpoool ntprodcopypoolba stg ntprodtape ntprodcopypool

YOU MUST SEND THE NEWLY-CREATED TAPE and THE WEIRD-NAMED ONE OFFSITE SO THAT THE TSM DATABASE MATCHES!!!!

If the tape is a member of a copypool you need to manually move it thru the DRM cycle and also manually recall it under the REAL name of the volume.

move drm <vol> tost=vaultmove drm <vol> tost=courierret

Page 13: Tsm Commands

move drm <vol> to st=onsiteret

Change the maximum file size for a devclass (specifically DBB backup volume size)

upd devc <devclassname> maxcap=

making the UNIX command lineoutput look pretty

-displaymode=list

Common Tasks

To view a list of active processesq proc

To view a list of sessions (sessions are client-based activities as opposed too processes which are server jobs)q sess

To cancel either a session or a processcanc [proc|sess] <sessio# or proc #>canc proc 123canc sess 456

To view the contents of the library (physical library)q libv lib01

To audit the library (tape by tape inventory (each tape gets mounted and the internal label read ) use this when the library becomes confused about its contents) This process needs exclusive control of the library to run if other jobs are running when you enter the command, it wont execute until the prior processes complete and once it starts, no other processes are allowed to start until it completes.audit libr lib01

To view a list of mounted (loaded in drives) tapesq mount

To view a list a tape drives (shows their status)q drive [lib01|lib02]

To change the status of a drive (usually used if a drive is listed as offline) you could use online=no to temporarily prevent TSM from using a drive. You need to know what library the drive is a member of.upd drive [lib01|lib02] drive# online=yes

To view information about a specific tape. Add f=d (format=detail) for verbose output to the end of any of the following commands. --- Actually f=d can be added to many of the q commands to provide more detail.q vol <volumelabel>q libv <voljumelabel>q drm <volumelabel>

Page 14: Tsm Commands

To search the server activity log (the following example looks for references to WBMPXDB02A over the past two hours)q actlog begint=now-2:00 search=wbmpxdb02a

To view a list of client schedules (backup jobs)q sched

For detailed information about a client schedule the domain and schedule names can be found in the output of the q sched command.q sched <domain> <schedulename> f=d

To view a list of server schedules (administrative tasks for offsiting tapes, reclaiming space etc.)q sched type=admin

For detailed information about server schedulesq sched <schedulename> type=admin f=d

To view a list of tapes currently in the library that will/should be going offsiteq drm wherest=mountable

To manually checkout a single tape that needs to go offsite (after issuing the command below, you must wait to reply to a request) Once the tape has been physically moved the server will issue a req that can be seen by entering q req. After the request is displayed get the number associated with it and issue a reply rep <req#>.move drm <volumename> fromst=mountable tost=notmountable

You can also perform a mass checkout using an asterisk instead of the volume name.

NOTE if you checkout DRM tapes later than 14:00, you must also then move their status to vault. There is an automated job that runs at 14:00 that normally does this. If you dont the volume will be left if an access state of UNAVAILABLE

move drm <volumename> fromst=notmount tost=vault.

Collocated tape report shows list of volumes needed for restore of each collocated server as well as volume capacity. Usefull for cleaning up (reclaiming) additional offsite tapes,.

TOWER2:~drtsmusr/tmp/restorerpt.ksh [-nm]

Nm will add ** to volume names of all vols still in the library.

When restoring a TSM server from a backup (i.e. mksysb) client sessions may fail with ANS1355E Session Reject Server Disabled This is due to the (apparent) time change to the server. From a dsmadmc session enter the following:

accept dateenable sessions

Page 15: Tsm Commands

Change the mount retention period of the tape drivesUpd devclass LTOCLASS (or whatever mountr=num

Creating a new stgpool to be used by existing (well new ones too I guess) members of a domain. Basically I want to redirect all new incoming data to CDL volumes rather than physical tape volumes. Not sure if this is the proper/best way to do this but it did what I wanted in prototype.

Define the new stgpool:def stg exchangecdlpool ltoclasscdl maxscratch=40

Define the policy setdef pol exchange <dom> exchangecdlps <new ps>

Define the new management classdef mgmt exchange <dom> exchangecdlps <polset> exchangecdlmc <mgmtcl>

Define the copygroupdef copy exchange <dom> exchangecdlps <polset> exchangecdlmc <mgmtcl> dest=exchangecdlpool

Assign the default management class for the policy setass defmgmt exchange <dom> exchangecdlps <polset> exchangecdlmc <mgmtcl>

Validate the policy setval pol exchange <dom> exchangecdlps <pol set>

Activate the policy setactivate pol exchange <dom> exchangecdlps <polset>

Now for every client that is registered to that domain, you must add the new management class to the config file for them to use it. include * exchangecdlmc.

Increasing log space:The implementation is quite simple it requires four steps:

1. create the additonal log volumes - which are simply sparse flat files2. tell TSM about the new log volumes3. tell TSM how much of the new space it can use4. create identical volumes on the DR server.

for NUM in 21 22 23 24; do dsmfmt -m -log /tsm/tsmlog/log${NUM}.dsm 128 dsmadmc -id=admin -pass=$TSMPWD "def logv /tsm/tsmlog/log${NU M}.dsm"done

dsmadmc -id=admin -pass=$TSMPWD "extend log 512"

perform the same "for" loop on the DR server.

Page 16: Tsm Commands

RMU stuff

DR LTO RMU IP is 172.26.5.210/16

User= adminPasswd= secure

Anytime that work is done on the library (drive replacement, firmware upgrade, etc.) make note of all tape drive addresses prior to doing anything!!!

lsdev Cc tape

Once the work is complete, you need to see if they are still the same. Compare the previous output to that of the SCSI IDs/LUNs on the front panel of the library. If any have changed, you MUST SET THEM BACK TO WHERE THEY WERE! *******DO NOT RUN CFGMGR!!!**************

Test each drive to be sure that it is at the proper address by INDIVIDUALLY deleting and recreating them:

rmdev l rmt#mkdev l rmt#

do not use a dl as this will totally delete the definition.

By Viktor I do offline the drive and the path first before rmdev.

UPDATE PATH SERVER1 DRIVE3 SRCTYPE=SERVER DESTTYPE=DRIVELIBRARY=LIB01 DEVICE=/dev/rmt3 ONLINE=NO

If you must change the drives ID from the front panel of the library, be patient. It takes a little while for the drive(s) to reinitialize after the change. I saw drives display a !C during the reinit. That is okay.

If any of the drives where changed and/or the library was power-cycled while TSM was running, you will need to stop and restart TSM for it to pickup the new drive info. (i.e. new drive was added to library since last time TSM came up. TSM said that the element number was invalid recycle TSM).

Viktor August 12th, 2008 after having issues with couple of drives and doing all the steps above still not mounting on that drive. Found article referring to checking the path.Do q path here the status must be online as well. Syntax is funny here, so did it via GUI and works fine.Example of command:UPDATE PATH SERVER1 DRIVE4 SRCTYPE=SERVER DESTTYPE=DRIVE LIBRARY=LIB01 DEVICE=/dev/rmt4 ONLINE=YES

Cool TSM SQL Commands for various info (must be modified to fit the specific environment)

How many client nodes are registered by domain

Page 17: Tsm Commands

select domain_name,num_nodes from domains

________________________________________How many client nodes are registered by platform?

select platform_name,count(*)as 'Number of Nodes' from nodes group by platform_name

Query all tapes for a nodeHow do I find all the tape volsers associated with a specific node? select distinct node_name,volume_name,stgpool_name from volumeusage where node_name='xxxxx'back to top________________________________________What tapes were used today?How do you find out what tapes were used on a specific day. select volume_name,last_write_date from volumes order by last_write_dateback to top________________________________________Library inventoryHow can I display an inventory of my library in order of slot number select home_element, volume_name from libvolumes order by home_elementback to top________________________________________Which volume has my fileHow can I find out which volume contains a specific file? select volume_name,node_name,filespace_name,file_name from contents where node_name='nodename' and filespace_name='filespace' and file_name='filename'back to top________________________________________List all volumes that are not in READWRITE statusselect VOLUME_NAME,ACCESS from volumes where access !='READWRITE' Result - VOLUME_NAME ACCESS ------------------ ---------- AZ1039 READONLY AZ1170 READONLY back to top________________________________________How many scratch tapes are there?How do I tell how many scratch tapes we have? select count(*) as Scratch_count from libvolumes where status='Scratch'

Page 18: Tsm Commands

If you have more than 1 library, you can find all your scratch tapes using the query select LIBRARY_NAME,count(*)'scratches' from libvolumes where upper(status)='SCRATCH' group by LIBRARY_NAMEThanks to Sven Neirynck of Compu-mark for that tipTSM has a MAXSCRATCH parameter which is set independently for each storage pool. This defines the maximum number of tapes that each tape pool can contain. The following query will display how close each pool is to its limit. SELECT STGPOOLS.STGPOOL_NAME, STGPOOLS.MAXSCRATCH, - Count(STGPOOLS.MAXSCRATCH) as "Allocated_SCRATCH", - STGPOOLS.MAXSCRATCH-count(STGPOOLS.MAXSCRATCH) as "Remaining_SCRATCH" - FROM STGPOOLS,VOLUMES - WHERE (VOLUMES.STGPOOL_NAME = STGPOOLS.STGPOOL_NAME) - AND ((STGPOOLS.DEVCLASS="3590_CLASS")) - GROUP BY STGPOOLS.STGPOOL_NAME, STGPOOLS.MAXSCRATCHTypical output looks like STGPOOL_NAME MAXSCRATCH Allocated_SCRATCH Remaining_SCRATCH------------------ ----------- ----------------- -----------------ARCHTAPEPOOL 100 5 95CARTPOOL 1340 932 408VIRTCARTPOOL 200 13 187back to top________________________________________How many tapes can I reclaim by changing the reclamation threshold? select count(*)from volumes where stgpool_name='poolname' and upper(status)='FULL' and pct_utilized <%%poolname is the name of your tape storage pool, remember the name is case sensitive. Change %% to the level you could set the reclaim threshold to, the result is Unnamed[1] ---------- 19back to top________________________________________Which tape is in a slot?How can I find out what TSM thinks is in a slot in a library: select * from libvolumes where home_element=### (### = slot number)back to top________________________________________How many tapes are used by each node?As originally requested by Jose Barzaga then improved by Brian Bisson, the following query will list the number of tapes used by each node, by storage pool. The query is a bit resource intensive. select count(DISTINCT volume_name) as volumes, node_name, stgpool_name from volumeusage group by node_name, stgpool_name order by volumes desc

Page 19: Tsm Commands

If a tape is shared by more than one node, either because you do not run collocation, or because you ran out of tapes and TSM switched to partial colocation, then the query will count tapes more than once.back to top________________________________________How many active files are there?How can I find out the number of active files and the size of these files on a certain node? select node_name, sum(logical_mb) as Data_In_MB, sum(num_files) as Num_of_files from occupancy group by node_name order by node_nameback to top________________________________________What's happened in the last hour?How can i code a select statement, which gives me all nodename related events from the actlog in the last hour? select servername,nodename,date_time from actlog where (cast((current_timestamp-date_time)hours as integer)>1)back to top ________________________________________What happened yesterday?How do I get the prior day events select * from events where days(current_timestamp)-days(scheduled_start)<1back to top________________________________________What was the times and data transferred for yesterday?This select query will get the amount of data backed up in the previous 24 hours, along with the start and end times of the backups.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 hoursGROUP BY entity

back to top________________________________________How much data is stored for each filespace?This easiest way to get this information is to use the 'query occupancy' command, which will return output likeNode Name Type Filespace FSID Storage Number of Physical Logical Name Pool Name Files Space Space Occupied Occupied (MB) (MB)

Page 20: Tsm Commands

---------- ---- ---------- ----- ---------- --------- --------- ---------SRFFCQ04 Bkup SRFFCQ04\- 1 CARTPOOL- 20 0.02 0.02 SYS: SRFFCQ04 Bkup SRFFCQ04\- 3 CARTPOOL- 3,631,963 169,579.1 169,548.4 CS04: 3 7

or you could try an SQL query like SELECT node_name,filespace_name, physical_mb,stgpool_name FROM occupancy and optionally WHERE node_name='nodename' AND type='Bkup'

The output looks like NODE_NAME FILESPACE_NAME PHYSICAL_MB STGPOOL_NAME--------- --------------- ------------ ------------- node01 node01\BS01: 367781.61 CARTPOOL node01 node01\BS01: 0.64 DISKPOOLback to top________________________________________How much data is stored for each node by copy type?This query assumes that you have three types of storage pools, one called with 'TAPEPOOL' which is used for standard backups, one called 'ARCHPOOL' which is used for Archives and one called 'TDPPOOL' which is used for SQL TDP backups. This query will summarise the amount of backup space used by each node in each pool. This is not the same as the query above, which reports on space usage by filespace. select node_name as NODENAME, - sum(case when substr(stgpool_name,1,3) in ('ARC') - then logical_mb else 0 end) as ARC_OCC, - sum(case when substr(stgpool_name,1,3) in ('TAP') - then logical_mb else 0 end) as BCK_OCC, - sum(case when substr(stgpool_name,1,3) in ('TDP') - then logical_mb else 0 end) as TDP_OCC - from occupancy group by node_nameThe output looks like NODENAME: SRVGLUAY ARC_OCC: 339.28 BCK_OCC: 5523.63 TDP_OCC: 1988.79back to top________________________________________How did last nights backups go? select Entity,Successful,Bytes,Examined,Affected,Failed from summary where activity='BACKUP' and cast((current_timestamp-start_time)hours as decimal(8,0)) < 24 order by Entity'To convert this to an exception report, add and failed>0at the end of the 'where' statement

Page 21: Tsm Commands

If you want to know all the amount of data processed by all events, try select nodes.domain_name,summary.activity, sum(cast(summary.bytes/1024/1024/1024 as decimal(6,2))) as GB from nodes, summary where (end_time between current_timestamp - 24 hours and current_timestamp) and (activity='BACKUP' or activity='RESTORE' or activity='ARCHIVE' or activity='RETRIEVE') and ((nodes.node_name=summary.entity)) group by domain_name,summary.activity order by activity,domain_name ascTypical ouput looks like DOMAIN_NAME ACTIVITY GB------------------ ------------------ -----------DO_AIX ARCHIVE 0.14DO_AIX BACKUP 49.51DO_HOLAN BACKUP 81.69DO_LOTUSNOTES BACKUP 145.05DO_TDP BACKUP 507.57DO_UDB BACKUP 0.97DO_WINNT BACKUP 127.43DO_HOLAN RESTORE 0.02DO_LOTUSNOTES RESTORE 0.20DO_TDP RESTORE 225.53

back to top________________________________________Produce a list of restores, how much data they processed, and their statusThe query is - SELECT * FROM SUMMARY WHERE ACTIVITY='RESTORE'This query takes a while and produces a lot of output. Sample output for one restore is START_TIME: 2004-05-06 00:02:36.000000 END_TIME: 2004-05-06 00:03:13.000000 ACTIVITY: RESTORE NUMBER: 74621 ENTITY: TDPOCL_UX04PRD COMMMETH: Tcp/Ip ADDRESS: 172.31.112.55:62962SCHEDULE_NAME: EXAMINED: 0 AFFECTED: 1 FAILED: 0 BYTES: 514654219 IDLE: 0 MEDIAW: 0 PROCESSES: 1 SUCCESSFUL: YES VOLUME_NAME: DRIVE_NAME: LIBRARY_NAME: LAST_USE: COMM_WAIT:back to top________________________________________How many volumes does a storage group use?

Page 22: Tsm Commands

How can you can determine how many volumes are used by each storage group? select stgpool_name,count(*) as count from volumes group by stgpool_name'back to top________________________________________Query the number of Volumes in use, and available by Device ClassThis query will find every storage pool that has a device class of 3590_class, and return the storage pool name, the maxscratch value for the storage pool and how many volumes are in that pool. SELECT a.stgpool_name,a.maxscratch,count(*) AS Volumes FROM stgpools a, volumes b WHERE a.stgpool_name = b.stgpool_name and a.devclass = '3590_CLASS' GROUP BY a.stgpool_name,a.maxscratchTypical output look like STGPOOL_NAME MAXSCRATCH VOLUMES ------------------ ----------- ----------- ARCHTAPEPOOL 100 3 CARTPOOL 1500 1119 VIRTCARTPOOL 200 9

back to top________________________________________How many volumes are going offsite?How can I can tell how which tapes are offsite? SELECT volume_name,stgpool_name,access FROM volumes WHERE (stgpool_name='offsite_pool_name') AND (access='offsite')back to top ________________________________________Total data stored and tapes used per node in all storage poolsThis select will show NODE_NAME, TOTAL_MB that is amount of data stored in TSM for this node, TAPES that is the amount of tapes that contain data of this node (of any storage pool), and AVG MB/tape that is the average of MB by tape (TOTAL_MB divided by number of tapes with node data). It's sorted by worst data distribution. This query will pickup data stored on any storage pool, including data on a disk pool pending migration. That can skew the results. select vu.node_name, ao.total_mb, count(distinct vu.volume_name) - as tapes, ao.total_mb/count(distinct vu.volume_name) - as "AVG MB/tape" from volumeusage vu, auditocc ao - where vu.node_name=ao.node_name - group by vu.node_name, ao.total_mb order by 4

Typical output

NODE_NAME TOTAL_MB TAPES AVG MB/tape --------------- --------- --------- ----------- DEC_XL34RT2B 3394 207 16 XLF3LV02 88796 2 44398 XLFFAF01 51080 1 51080 XLF3AF02 544846 9 60538

back to top________________________________________

Page 23: Tsm Commands

Total data stored and tapes used per node in one storage poolThis select will show NODE_NAME, TOTAL_MB that is amount of data stored in TSM for this node, TAPES that is the amount of tapes that contain data of this node located in the specified storage pool, and AVG MB/tape that is the average of MB by tape (TOTAL_MB divided by number of tapes with node data). It's sorted by worst data distribution. select vu.node_name, ao.total_mb, count(distinct vu.volume_name) - as tapes, ao.total_mb/count(distinct vu.volume_name) - as "AVG MB/tape" from volumeusage vu, auditocc ao - where vu.stgpool_name='YOUR_POOL_NAME' and vu.node_name=ao.node_name - group by vu.node_name, ao.total_mb order by 4

typical output

NODE_NAME TOTAL_MB TAPES AVG MB/tape ------------------ ----------- ------- ----------- DEC_XL34RT2B 0 1 0 NODEL81 92 1 92 NODEL265 294 1 294 XLF3AF03 119524 2 59762 XLF3AF02 544846 9 60538back to top________________________________________Display the number of nodes on each tapeThis select will show how many nodes a tape contains, sorted by tapes with higher number of nodes.

select volume_name, stgpool_name, - count(distinct node_name) as Nodes - from volumeusage - group by volume_name, stgpool_name - order by 3 desc

typical output

VOLUME_NAME STGPOOL_NAME NODES ------------------ ------------------ ----------- DZ2070 ARCHIVEPOOL 11 DZ1426 ARCHIVEPOOL 9 DZ1776 CARTPOOL 1 DZ1778 CARTPOOL 1

back to top ________________________________________A query to display the names of the nodes with data on a tapeThis select statement will display unique node names located on tape select distinct node_name from volumeusage - where volume_name='DZ1778'

typical output

NODE_NAME ---------- XLF3AF02back to top________________________________________A script to move data from low utilised tapes

Page 24: Tsm Commands

This select statement will create a script that will move data from low utilized tapes. This process is used to supplement Reclamation as it does not look at expired data and it is multi-streaming. The percent utilized is adjustable. select 'move data ',volume_name, ' wait=yes', status from volumes where stgpool_name='pool_name' and pct_utilized>0 and pct_utilized<25 and access='OFFSITE'

typical output

Unnamed[1] VOLUME_NAME Unnamed[3] STATUS ---------- --------------- ---------- ------ move data DZ1963 wait=yes FULL move data DZ2070 wait=yes FULL move data DZ2653 wait=yes FULLback to top ________________________________________Offsite tapes needed to restore a nodeThis select will show how many tapes would be needed to restore a node (stgpool_name should be your offsite tape pool) for a DR exercise

select distinct volume_name - from volumeusage - where node_name='node_name' - and stgpool_name='pool_name' The output is a list of tapes. FUN TSM ACTLOG Codes to search on:

ANR0407I remote loginANR1214I end of stg pool copy statsANE4954i end of ses obj countANR1215I end stg pool ba preview stats

TSM Cheat Sheet for West Bend Mutual

These command are commonly used commands for TSM. Refer to the tsmsrvwinref.pdf file or the TSM Publications CD for flags and optional settings.

dsmadmcOpens an administrative command-line interface to the TSM server. This allows for queries and commands to be run against the server. Two commonly used flags for this command are:

dsmadmc -console (opens a live console session with the server)dsmadmc -mountmode (opens a live console session that shows only tape mounts)

dsmadmc's directory is not usually pathed for users, so you will have to either change directory to \program files\tivoli\tsm\baclient, or explicitly use the directory path as part of the command.--[from a Web browser] http://<TSM_server_name>:1580opens a GUI-based administrative interface to the TSM server.

Page 25: Tsm Commands

--dsmcOpens a backup/archive command-line client for TSM. This can be run on any machine that has the TSM client loaded and configured properly.--dsmOpens a backup/archive GUI client for TSM. This can be run on any machine that has the TSM client loaded and configured properly. This interface allows for easy backup of individual files, and is the easiest way to selectively restore lost or corrupt files.

----------------------------------------------------------------Once a dsmadmc session is running, the following commands are commonly used by TSM administrators. (Note that the capitalized letters show the minimum number of letters necessary to run the command.)--Query STGpoolqueries for the state of TSM storage pools. Information includes storage pool name, percentage of pool currently used, high- and low-migration marks, and migration pools.--Query DBquries the state of TSM's database. Information includes total size of database, percentage of database utilized, and maximum percentage used over last 24 hours.--Query LOGqueries the state of TSM's recovery log. Information includes total size of log, percentage of log currently utilized, and maximum percentage used over the last 24 hours.--Query ACTlogqueries TSM's activity log. Without parameters, query covers the previous two hours. This allows the administrator to browse the log of activity for the server.--Query SEssionsqueries for client sessions currently running. Information includes the nodename of the client, amount of data sent, amount of data received, node's OS platform, and time elapsed since client session started.--Query PROcessesqueries for currently running background processes, such as expiration, db backup, migration, and storage pool backups.--Query MOUNTSqueries the mounts currently open on TSM-recognized tape drives--Query DRIVESqueries the status of TSM-recognized tape drives--Query SCHEDulesqueries the configurations of regular client backup/restore sessions--Query SCHEDules type=adminqueries the configurations of regularly-scheduled administrative tasks--

Page 26: Tsm Commands

LABel LIBVolumelabels tape volumes and checks them into the library. An example is:

label libv <library_name> checkin=scratch search=bulk labelsource=barcode overwrite=yes

See the TSM Administrator's Reference for additional information.

--CHECKIn LIBVolumechecks tape volumes already labelled by TSM into the library. An example would be:

checkin libv <library_name> status=private search=bulk checklabel=barcode

You can also use this command to check in a new cleaning cartridge. For this, the command is

checkin libv <library_name> status=cleaner search=bulk cleanings=<number of cleanings allowed for the cartridge>

See the TSM Administrator's Reference for additional information.

--CHECKOut VOLumechecks out tape volumes from the library. An example is:

checkout libv <library_name> <volume_name> remove=bulk

--Query DRMediaqueries which tape volumes are either TSM database backups or members of a copy group. This is the first step in checking out disaster recovery tapes for offsite storage.

Disaster recovery procedures are fairly complex and beyond the scope of this cheat sheet. Refer to the TSM Administrator's Guide, starting on page 783 and continuing.

--Query EVENTsqueries the success of scheduled backups with a 24-hour timeslice from midnight to midnight. An example is:

query event * *

This will show the status of all scheduled client backups. To see the previous day, an example would be:

query event * * begindate=-1

--Query EVENTs type=adminqueries the success of schedule administrative tasks within a 24-hour timeslice. An example would be

Page 27: Tsm Commands

query event type=admin begindate=-1

This shows the success of all scheduled administrative events in the 24 hours from midnight to midnight yesterday.

New TSM storage pools/management classes to separate NT servers (DEV, QA, TEST nodes are in NTDEV, Production nodes is in NTPROD). Note: Only NT nodes in NTPROD are considered DR recoverable currently, and therefore only the tapepool NTPRODPOOL and NTPRODTAPE are copied offsite daily. The Standard management class that was always out there is also copied offsite, but only AIX nodes are in that management class currently. All NT (except TDP for Exchange nodename WBMPMSG01_EXCH)nodes backup to disk pools first, then migrate to tapepools, as is shown in the following q stg command.

tsm: SERVER1>q stg

Storage Device Estimated Pct Pct High Low Next Stora-Pool Name Class Name Capacity Util Migr Mig Mig ge Pool (MB) Pct Pct----------- ---------- ---------- ----- ----- ---- --- -----------ARCHIVEPOOL DISK 0.0 0.0 0.0 90 70 TAPEPOOLBACKUPPOOL DISK 145,000.0 97.2 16.4 90 30 TAPEPOOLCOPYPOOL LTOCLASS 40,402,348 10.3 .0COPYPOOL2 LTOCLASS 0.0 0.0EXCHANGECO- LTOCLASS 0.0 0.0 PYPOOLEXCHANGETA- LTOCLASS 0.0 0.0 0.0 90 70 PENTDEVPOOL DISK 51,200.0 33.9 33.9 90 30 NTDEVTAPENTDEVTAPE LTOCLASS 1,907,149, 0.0 0.0 90 70 266.0NTPRODCOPY- LTOCLASS 1,907,149, 0.0 POOL 266.0NTPRODPOOL DISK 45,000.0 98.9 79.3 90 30 NTPRODTAPENTPRODTAPE LTOCLASS 1,907,149, 0.0 0.0 90 70 266.0TAPEPOOL LTOCLASS 40,415,710 10.2 19.5 90 70

Some useful commands to show volume tape usage are (this was done on 12/19/2003 output will grow as time progresses)

tsm: SERVER1>q vol stg=ntprodtape

Volume Name Storage Device Estimated Pct Volume Pool Name Class Name Capacity Util Status (MB)------------------------ ----------- ---------- --------- ----- --------

Page 28: Tsm Commands

138ACB NTPRODTAPE LTOCLASS 190,734.0 49.5 Filling970ACB NTPRODTAPE LTOCLASS 190,734.0 11.1 Filling

tsm: SERVER1>q vol stg=ntdevtape

Volume Name Storage Device Estimated Pct Volume Pool Name Class Name Capacity Util Status ------------------------ ----------- ---------- --------- ----- --------127ACB NTDEVTAPE LTOCLASS 190,734.0 16.1 Filling

tsm: SERVER1>q vol stg=ntprodcopypool

Volume Name Storage Device Estimated Pct Volume Pool Name Class Name Capacity Util Status (MB)------------------------ ----------- ---------- --------- ----- --------107ACB NTPRODCOPY- LTOCLASS 190,734.0 42.5 Filling POOL126ACB NTPRODCOPY- LTOCLASS 190,734.0 36.7 Filling POOL

One neat SQL command I like to use is this one it will tell you the # of tapes a particular nodes data is on Note: NODENAME should be all UPPERCASE.

tsm: SERVER1>select NODE_NAME as NODE,count(distinct VOLUME_NAME) as "# of tapes used" from VOLUMEUSAGE where NODE_NAME='WBMPWEB04' and STGPOOL_NAME='NTPRODCOPYPOOL' group by NODE_NAME

NODE # of tapes used------------------ ---------------WBMPWEB04 2

tsm: SERVER1>select VOLUME_NAME as VOLUME from VOLUMEUSAGE where NODE_NAME='WBMPWEB04' and STGPOOL_NAME='NTPRODCOPYPOOL' group by VOLUME_NAME

VOLUME------------------107ACB126ACB

Page 29: Tsm Commands

This is similar to the output of the command show volumeusage, however the show volumeusage command only works on primary storage volumes, not copyppool volumes.

_______________________________________________________________________

NT clusters password problem fix obtained from www.adsm.org...

have had this problem a couple of times and the instructions are sketchy as to how to update the passwords in the registry. Client seems to get in a twist about the passwords replicated between the nodes somehow.

Remove the cluster resource for the service from Cluster Admin then execute the following command on each server to update the registry passwords.

dsmcutil update scheduler /name:"<service name>" /clientdir:"<client install dir" /optfile:"<optfilelocation>" /node:<nodename> /password:pass /validate:yes /clusternode:yes /clustername:<clustername> /force:yes

Probably worth logging on manually to TSM from each node then setting up the clustered resource again.

Restore DB Backup from LTOHalt the TSM ServerDsmserv restore db devclass=ltoclass vol=volname commit=yes