Вы находитесь на странице: 1из 3

Cross Node recovery using TSM

This article runs you through quick tutorial of database cross node recovery using TSM in
db2.
In this example i have considered two systems:
computer 1:- testdb2 Database ( ndb_mig2 )running on linux -> db2 instance owner
on this machine is db2admin and Node Name is : testdb2_tdp
computer 2:- db2sles9 Database ( running on linux -> db2 instance owner on this
machine is also db2admin and Node name is : db2sles9_tdp
I). Task done on computer 1:-(testdb2)
1.Take a offline Backup
db2admin@testdb2:~> db2 backup db ndb_mig2 use tsm
Backup successful. The timestamp for this backup image is : 20080122142933

2.check if the backup image is on TSM by using


db2admin@testdb2:~> db2adutl query db ndb_mig2
Query for database NDB_MIG2

Retrieving FULL DATABASE BACKUP information.


1 Time: 20080122142933 Oldest log: S0000000.LOG DB Partition Number: 0

3.To enable cross-node recovery, another node and account must be given access to the
objects on the testdb2 computer.In this example, access is given to the node
db2sels9_tdp(node name as per TSM client setttings)and the user db2admin.
db2admin@testdb2:~> db2adutl grant user db2admin on nodename db2sles9_tdp for db
ndb_mig2
Warning: Permissions granted on backup image files only.
Unable to find log files to add permissions to. At least one log
file must exist to grant access to logs for this database.

in this case use have taken ofline backup and no logs are on tsm so we got the warning
message.
4.query the results of the db2adutl grant operation
db2admin@testdb2:~> db2adutl queryaccess
Node Username Database Name Type
-------------------------------------------------------------DB2SLES9_TDP db2admin NDB_MIG2 B
-------------------------------------------------------------Access Types: B - backup images L - logs A - both

II) Task done on computer 2:-(db2sles9)


Computer 2, db2sles9, is not yet set up. A db2adutl query on db2sles9 for the ndb_mig2
database returns the following results:
db2admin@db2sles9:~> db2adutl query db ndb_mig2
--- Database directory is empty --Warning: There are no file spaces created by DB2 on the ADSM server
1.check if the tsm backup image taken from testdb2 is visible from db2sles9
db2admin@db2sles9:~> db2adutl query db ndb_mig2 nodename testdb2_tdp owner
db2admin
--- ERROR! Database not found in system directory! --Query for database NDB_MIG2
Retrieving FULL DATABASE BACKUP information.
1 Time: 20080122142933 Oldest log: S0000000.LOG DB Partition Number: 0 Sessions: 1

if you can see the backup image information that means that backup image is accessible.
2.Restore the ndb_mig2 database to the db2sles9 computer
db2admin@db2sles9:~> db2 restore db ndb_mig2 use tsm options

"'-fromnode=testdb2_tdp -fromowner=db2admin'"
SQL2523W Warning! Restoring to an existing database that is different from the database
on the backup image, but have matching names. The target database will be overwritten
by the backup version. The Roll-forward recovery logs associated with the target
database will be deleted.
Do you want to continue ? (y/n) Do you want to continue ? (y/n) y
DB20000I The RESTORE DATABASE command completed successfully.
i got the warning since i had a database called ndb_mig2 on db2sles9.

Вам также может понравиться