You are on page 1of 29

------------------------------------------------------------------------

--------
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

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"

========================================================================
=======
SEE if it is working:

#export X windows
dsm - gui

dsmc
dsmc>q fi
dsmc>quit

dsmadmc
dsmadmc -se=02

#run a full on a filesystem


dsmadmc selective /somedir/* -sbudir=yes

#run an incremental on all possible backup FS


dsmc incremental
dsmc i

#run an incremental on a FS
dsmc 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=detailed
dsmadmc -id=admin -password=xxx -outfile=/tmp/tsm.sched-detailed.txt q
sch format=detailed
------------------------------------------------------------------------
--------
dsmc
when 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 subdirs


tsm> restore -rep=yes -subdir=yes /a/anyuser

selection menu of old file versions:


tsm> restore -ina -pick /user/a/anyuser/exp.cmz
restore old file version with date limit
tsm> restore -pitd=7/9/2007 /ftp/pgp/jdeprod/RTMAV098 /tmp/RTMAV098

restore old file version with specific date


tsm> 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

dsmadmc
dsmadmc -se=02

Import tapes into scratch


Go to a TSM admin prompt
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 port


new versions use websm

dsmadmc -id=admin -pasword=$TSMPWD "ba volhist"


dsmadmc -id=xxx -password=xxx q sched f=d
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"
dsmadmc -id=xxx -password=xxx q act begind=-35 > /tmp/matt

client
dsmadmc -id=xxx -password=xxx q act begind=-35 > /tmp/matt
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

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 emails
tower2> /tsm/drfiles
ps -ef | grep drtape #to see if tar/ftp is still running

========================================================================
=======
BCP
before BCP
------------
stop replication before the day of
call 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..
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/bin
nohup ./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.


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 schedule


command 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


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?
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}`; do


dsmc 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 it
tsm: 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 at


21:22:18.
ANR2240I Database volume /tsm/db/db8.dsm defined.
ANR0986I Process 263 for DEFINE DBVOLUME running in the FOREGROUND
processed 1
items for a total of 1,049,624,576 bytes with a completion state of
SUCCESS at
21: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
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 128


dsmfmt 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


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

dsmserv

def logvol /tsm/tsmlog/log02.dsm


def dbvol /tsm/tsmdb/db02.dsm

You may need to create the default admin account:


reg admin admin admin
grant 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, etc
select NODE_NAME as NODE,count(distinct VOLUME_NAME) as "Number of Tapes
Used"
from VOLUMEUSAGE
where 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.
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 ntprodcopypool


ba 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=vault


move drm <vol> tost=courierret
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 processes


q 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 process


canc [proc|sess] <sessio# or proc #>
canc proc 123
canc 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) tapes


q 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>
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 schedules


q sched <schedulename> type=admin f=d

To view a list of tapes currently in the library that will/should be


going offsite
q 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 date
enable sessions
Change the mount retention period of the tape drives
Upd 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 set


def pol exchange <dom> exchangecdlps <new ps>

Define the new management class


def mgmt exchange <dom> exchangecdlps <polset> exchangecdlmc <mgmtcl>

Define the copygroup


def copy exchange <dom> exchangecdlps <polset> exchangecdlmc <mgmtcl>
dest=exchangecdlpool

Assign the default management class for the policy set


ass defmgmt exchange <dom> exchangecdlps <polset> exchangecdlmc <mgmtcl>

Validate the policy set


val pol exchange <dom> exchangecdlps <pol set>

Activate the policy set


activate 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 files
2. tell TSM about the new log volumes
3. tell TSM how much of the new space it can use
4. 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.


RMU stuff

DR LTO RMU IP is 172.26.5.210/16

User= admin
Passwd= 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=DRIVE


LIBRARY=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


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 node


How 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_date
back to top
________________________________________
Library inventory
How can I display an inventory of my library in order of slot number
select home_element, volume_name
from libvolumes
order by home_element
back to top
________________________________________
Which volume has my file
How 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 status
select 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'
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_NAME
Thanks to Sven Neirynck of Compu-mark for that tip
TSM 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.MAXSCRATCH
Typical output looks like
STGPOOL_NAME MAXSCRATCH Allocated_SCRATCH
Remaining_SCRATCH
------------------ ----------- -----------------
-----------------
ARCHTAPEPOOL 100 5
95
CARTPOOL 1340 932
408
VIRTCARTPOOL 200 13
187
back 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]
----------
19
back 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
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_name
back 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)<1
back 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 hours
GROUP 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 like
Node Name Type Filespace FSID Storage Number of Physical
Logical
Name Pool Name Files Space
Space
Occupied
Occupied
(MB)
(MB)
---------- ---- ---------- ----- ---------- --------- ---------
---------
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 DISKPOOL
back 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_name
The output looks like
NODENAME: SRVGLUAY
ARC_OCC: 339.28
BCK_OCC: 5523.63
TDP_OCC: 1988.79
back 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>0
at the end of the 'where' statement
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 asc
Typical ouput looks like
DOMAIN_NAME ACTIVITY GB
------------------ ------------------ -----------
DO_AIX ARCHIVE 0.14
DO_AIX BACKUP 49.51
DO_HOLAN BACKUP 81.69
DO_LOTUSNOTES BACKUP 145.05
DO_TDP BACKUP 507.57
DO_UDB BACKUP 0.97
DO_WINNT BACKUP 127.43
DO_HOLAN RESTORE 0.02
DO_LOTUSNOTES RESTORE 0.20
DO_TDP RESTORE 225.53

back to top
________________________________________
Produce a list of restores, how much data they processed, and their
status
The 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:62962
SCHEDULE_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?
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 Class
This 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.maxscratch
Typical 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 pools
This 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
________________________________________
Total data stored and tapes used per node in one storage pool
This 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 60538
back to top
________________________________________
Display the number of nodes on each tape
This 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 tape
This select statement will display unique node names located on tape
select distinct node_name from volumeusage -
where volume_name='DZ1778'

typical output

NODE_NAME
----------
XLF3AF02
back to top
________________________________________
A script to move data from low utilised tapes
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 FULL
back to top
________________________________________
Offsite tapes needed to restore a node
This 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 login


ANR1214I end of stg pool copy stats
ANE4954i end of ses obj count
ANR1215I 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.

dsmadmc
Opens 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>:1580
opens a GUI-based administrative interface to the TSM server.
--
dsmc
Opens a backup/archive command-line client for TSM. This can be run on
any machine that has the TSM client loaded and configured properly.
--
dsm
Opens 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 STGpool
queries 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 DB
quries 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 LOG
queries 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 ACTlog
queries 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 SEssions
queries 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 PROcesses
queries for currently running background processes, such as expiration,
db backup, migration, and storage pool backups.
--
Query MOUNTS
queries the mounts currently open on TSM-recognized tape drives
--
Query DRIVES
queries the status of TSM-recognized tape drives
--
Query SCHEDules
queries the configurations of regular client backup/restore sessions
--
Query SCHEDules type=admin
queries the configurations of regularly-scheduled administrative tasks
--
LABel LIBVolume
labels 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 LIBVolume
checks 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 VOLume
checks out tape volumes from the library. An example is:

checkout libv <library_name> <volume_name> remove=bulk

--
Query DRMedia
queries 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 EVENTs
queries 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=admin
queries the success of schedule administrative tasks within a 24-hour
timeslice. An example would be
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 TAPEPOOL
BACKUPPOOL DISK 145,000.0 97.2 16.4 90 30 TAPEPOOL
COPYPOOL LTOCLASS 40,402,348 10.3
.0
COPYPOOL2 LTOCLASS 0.0 0.0
EXCHANGECO- LTOCLASS 0.0 0.0
PYPOOL
EXCHANGETA- LTOCLASS 0.0 0.0 0.0 90 70
PE
NTDEVPOOL DISK 51,200.0 33.9 33.9 90 30 NTDEVTAPE
NTDEVTAPE LTOCLASS 1,907,149, 0.0 0.0 90 70
266.0
NTPRODCOPY- LTOCLASS 1,907,149, 0.0
POOL 266.0
NTPRODPOOL DISK 45,000.0 98.9 79.3 90 30 NTPRODTAPE
NTPRODTAPE LTOCLASS 1,907,149, 0.0 0.0 90 70
266.0
TAPEPOOL 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)
------------------------ ----------- ---------- --------- -----
--------
138ACB NTPRODTAPE LTOCLASS 190,734.0 49.5
Filling
970ACB 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
POOL
126ACB 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
------------------
107ACB
126ACB
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 LTO


Halt the TSM Server
Dsmserv restore db devclass=ltoclass vol=volname commit=yes

You might also like