Академический Документы
Профессиональный Документы
Культура Документы
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
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
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.