TSM Commands
TSM Commands
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 port
new versions use websm
client
dsm (GUI)
dsmc (CLI)
dsmadmc
dsmadmc -console
q filespace host
update dr online
run scratch_count
========================================================================
=======
SEE if it is working:
#export X windows
dsm - gui
dsmc
dsmc>q fi
dsmc>quit
dsmadmc
dsmadmc -se=02
#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 old file versions from your home pwd are backed up?
tsm> q b -ina *
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
------------------------------------------------------------------------
--------
generate backupset usdcu008 KYPOC-II-SET devclass=lto3_dc scratch=yes
------------------------------------------------------------------------
--------
SEE if it is working:
dsmc
>q fi
>quit
dsmadmc
dsmadmc -se=02
Enter
Q pr
Q req
client
dsmadmc -id=xxx -password=xxx q act begind=-35 > /tmp/matt
dsm (GUI)
dsmc (CLI)
dsmadmc
dsmadmc -console
q filespace host
update dr online
run scratch_count
========================================================================
=======
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
List the contents of the storage pool(s) I;e. who is using up how much..
q filespace <nodename>
Modifying DB2 TDP stuff (this example was for specifying a mgmtclass)
(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)
dsm -virtualnodename=name_of_source_node
q vol devclass=disk
set logm [ r | n ]
/usr/tivoli/tsm/server/bin/dsmserv
q libv
After the backup, make sure that there is enough free logspace to delete
the temporary log
q log
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.)
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
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.
Make sure the space is now available to the DB (see maximum extension
column)
Extend it
tsm: SERVER1>extend db 1000
Verify the database extension (see both new maximum extension column and
the new percent utilized column)
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
dsmserv
On each
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
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.
Probably worth logging on manually to TSM from each node then setting up
the clustered resource again.
/usr/local/bin/BerbeeTSM/scripts/NMLadmin_cho.sh
You must make the changes to the STANDARD policy_set. Then perform a
validation of it, and finally activate it.
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.
YOU MUST SEND THE NEWLY-CREATED TAPE and THE WEIRD-NAMED ONE OFFSITE SO
THAT THE TSM DATABASE MATCHES!!!!
Change the maximum file size for a devclass (specifically DBB backup
volume size)
-displaymode=list
Common Tasks
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
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
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]
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
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.
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.
User= admin
Passwd= secure
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!!!**************
rmdev l rmt#
mkdev l rmt#
By Viktor I do offline the drive and the path first before rmdev.
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 platform?
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
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
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
typical output
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.
typical output
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'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:
--
CHECKIn LIBVolume
checks tape volumes already labelled by TSM into the library. An example
would be:
You can also use this command to check in a new cleaning cartridge. For
this, the command is
--
CHECKOut VOLume
checks out tape volumes from the library. An example is:
--
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 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
Some useful commands to show volume tape usage are (this was done on
12/19/2003 output will grow as time progresses)
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.
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.
_______________________________________________________________________
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.
Probably worth logging on manually to TSM from each node then setting up
the clustered resource again.