1. Prevent TSM server from any action: Stop TSM, change your add the following lines to dsmserv.opt, and restart TSM
NOMIGRRECL DISABLESCHED YES EXPINT 0
2. Do a backup of the TSM Database
3. backup volhist and devconfig in TSM
4. Stop the TSM server
5. Remove the DB if still exists
dsmserv removedb TSMDB1
6. Prepare the DB to load:
Syntax
>>-DSMSERV -+----------------------+----------------------------> | (1) | '------- -u--user_name-' (2).- -k--Server1--. >--+-------------------------+------+---------------+-----------> | (1) | '- -k--key_name-' '------- -i--instance_dir-' >--+-------------------+--+------------+--+---------+-----------> '- -o--options_file-' '- -noexpire-' '- -quiet-' .-,---------. V | >--LOADFORMAT--+-DBDir--=----directory-+-+----------------------> '-DBFile--=--file---------' .-ACTIVELOGSize--=--16384-----. >--+-----------------------------+------------------------------> '-ACTIVELOGSize--=--megabytes-' >--ACTIVELOGDirectory--=--directory-----------------------------> >--ARCHLogdirectory--=--directory-------------------------------> >--+----------------------------------------+-------------------> '-ARCHFailoverlogdirectory--=--directory-' >--+----------------------------------+------------------------>< '-MIRRorlogdirectory--=--directory-'
Example as instance user
# db2set -i tsminst1 DB2CODEPAGE=819 # db2start # dsmserv loadformat dbdir=/tsm/tsminstd2db activelogdir=/tsm/tsmd2actlog activelogsize=16384 archlogdir=/tsm/tsmd2archlog
3. Restore the DB:
# dsmserv restore db (latest backup)
If it failed with Rollforward, then you have to specify a date and time (check into volhistory)
# dsmserv restore db todate=MM/DD/YYYY totime=hh:mm:ss
Syntax
>>-DSMSERV -+----------------------+----------------------------> | (1) | '------- -u--user_name-' (2).- -k--Server1--. >--+-------------------------+------+---------------+-----------> | (1) | '- -k--key_name-' '------- -i--instance_dir-' >--+-------------------+--+---------------+--RESTORE DB---------> '- -o--options_file-' | (1) | '------- -quiet-' .-TOTime--=--23:59:59-. >--TODate--=--date--+---------------------+---------------------> '-TOTime--=--time-----' .-Source--=--DBBackup-------. >--+---------------------------+--------------------------------> '-Source--=--+-DBBackup---+-' '-DBSnapshot-' >--+---------------------------+--------------------------------> '-RECOVerydir--=--directory-' >--+----------------------------+-------------------------------> '-ACTIVELOGDir--=--directory-' .-PReview--=--No------. >--+------------------------------+--+---------------------+----> '-ON--=--target_directory_file-' '-PReview--=--+-Yes-+-' '-No--' .-RESTOREKeys--=--No-------. >--+--------------------------+---------------------------------> '-RESTOREKeys--=--+-No---+-' +-YES--+ '-ONLY-' >--+----------------------------+------------------------------>< '-PASSword--=--password_name-'
Restore from Cloud S3, it 'll restore the DB, and all required files (encrypt keys, devconf, volhist…)
[ispusr01@ispsrv01]$ dsmserv -i /ispusr01 restore db password=d***** prompt=no on=/ispusr01/dbdir.txt activelogdir=/ispusr01/db/actlog cloudurl="https://ibmcos01:9021" id=isprepl1-p-s3-dbbadm cloudpass="*******" bucketname=isprepl1-p-dbb cloudtype=s3 source=dbs todate=today+1 servern=ispsrv01
The file /ispusr01/dbdir.txt contains the paths of database
/ispusr01/db01 /ispusr01/db02 /ispusr01/db03 /ispusr01/db04