DB2 Redirect Restore Using TSM
DB2 Redirect Restore Using TSM
Source
System
Target
System
<SSID>
<TSID>
DB2
DB2
Contents :
1. Pre-requisite
2. Steps in Source System
3. Steps in target System
4. Post-Copy Steps
Page 2
1. Pre-requisite :
Update the tool brdb6brt (This tool is SAP provided) and check whether it supports
autostorage or not.
The tool is a part of the SAP kernel (DB2-specific kernel archive)
Login as user <ssid>adm.
cd /sapmnt/SID/exe
Execute :
db2cpp 4> brdb6brt -V
Page 3
The tool db2adult is used with Tivoli Storage Manager (TSM) to work with backup
images.
For the target system to access the source systems images on TSM, a priviledge
needs to be assigned to the target systems database administration user which is
typically db2<sid> in an SAP environment. Below is the command to execute the
same.
1. log in as root
2. change user to <SSID>adm
> stopsap
3. change user db2<SSID>
db2stop
IMP: if not getting down then
# db2 terminate
& again
# db2stop
# db2start
4. Check the backup stored in TSM using this command
> db2adutl query full db srp nodename cccsrpe2_srp owner db2srp
Page 4
You can query the backup images available in TSM of the source system
database. You can run this query from either the source or the target system.
5. Generate the script using brdb6brt utility
brdb6brt s <SSID> -bm RETRIEVE -ts <timestamp> replace
<SSID>=<TSID>, /db2/<SSID>=/db2/<TSID>,db2<TSID>=db2<SSID>
If Source SID = SRP & Target SID = SRQ
Command will be
brdb6brt -s SRP -bm RETRIEVE -ts 20101129180302 -replace
SRP=SRQ,db2srp=db2srq,/db2/SRP=/db2/SRQ
6. Script will be created with name like SRP_NODE0000.scr in current folder
7. copy the script with name <TSID>.scr
> cp TTM_NODE0000.scr <TSID>.scr
8. open with vi editor <TSID>.scr
Page 5
7.
Page 6
9. Make sure that db2 instance is running, if not running issue db2start to start the
db2 instance.
The warning can be ignored.
The warning is like
SQL1277N Restore has detected that one or more table space containers are
inaccessible, or has set their state to 'storage must be defined'.
Output should be like
RESTORE DATABASE TTM CONTINUE
DB20000I The RESTORE DATABASE command completed successfully.
10. If Rollforward didnt finished successfully you will get this message
11. You have to retrieve log from TSM using this command :
db2adutl extract logs between <Start log> AND <End log> db <SSID>
nodename <SNODE NAME> owner <Owner Name>
db2adutl extract logs between S0000301.LOG AND S0000306.LOG db srp
nodename cccsrpe2_srp owner db2srp
12. Then execute this command
db2 ROLLFORWARD DATABASE SRQ TO END OF LOGS and stop
Page 7
Then execute :
db2 ROLLFORWARD DATABASE <SID> complete.
Page 8
To
Logoff and login again as user <tsid>adm so that the change is in effect.
5. Update password in dscdb6.conf under /sapmnt/<SID>/global using the
following command :
dscdb6up create <password of sap<ssid>> <password of <tsid>adm>
6. Check schema user is connecting to DB2
R3trans d ( it should return value 0)
8. Start target SAP application
>startsap
( Note : The SAP kernel level on the target should be equal to or higher than the
kernel level of the source system )
Disclaimer : This document has been created during a customer assignment and
the contents may not fit exactly into your scenario.