Monday, March 31, 2014

Configure HADR on 10.5

For steps to setup HADR in v10.5: 1. Take online or offline database backup from v10.5 primary server 2. Restore online or offline database onto the v10.5 standby server 3. Update db cfg related to the HADR config parameters 4. Start hadr on standby 5. start hadr on primary The exact detail steps for configuring HADR on v10.5 is documented here: http://pic.dhe.ibm.com/infocenter/db2luw/v10r5/topic/com.ibm.db2.luw.admin.ha.doc/doc/t0011725.html

DB2 : For steps to migrate from v9.7 server to v10.5 server using Backup and restore commands

1. Take offline backup all of the databases on v9.7(Offline back is must) v9.7 backup database command: http://publib.boulder.ibm.com/infocenter/db2luw/v9r7/topic/com.ibm.db2.luw.admin.cmd.doc/doc/r0001933.html 2. Restore the v9.7 offline backup of the databases to the DB2 v10.5 primary server The below link has all the detail steps for upgrading pre v10.5 databases to v10.5 including the restore command. Please reference to the below link: http://pic.dhe.ibm.com/infocenter/db2luw/v10r5/topic/com.ibm.db2.luw.qb.upgrade.doc/doc/t0011368.html

DB2 issues on restore with rollforward

recently had a few problem trying to restore a DB2 online compressed backup from one AIX machine to another. I thought it would have been a simple process as saying Shell db2 restore db MYDB from /home/user/backup 1 db2 restore db MYDB from /home/user/backup which worked fine, Untill i tried to connect to the database. That is when i got the error [code] db2 => connect to MYDB SQL1117N A connection to or activation of database "AM2" cannot be made because of ROLL-FORWARD PENDING. SQLSTATE=57019 [/code] So i tried searching for a solution and tried everything i could. [code] db2 => rollforward db MYDB to end of logs and stop SQL4970N Roll-forward recovery on database "MYDB" cannot reach the specifiedstop point (end-of-log or point-in-time) because of missing or corrupted log file(s) on database partition(s) "0". Roll-forward recovery processing has halted on log file "S0001797.LOG". db2 => rollforward db MYDB complete SQL1276N Database "MYDB" cannot be brought out of rollforward pending state until roll-forward has passed a point in time greater than or equal to "2009-09-25-06.39.04.000000 UTC", because node "0" contains information later than the specified time. db2 => rollforward db MYDB to 2009-09-25-06.39.04.000000 and stop SQL1274N The database "MYDB" requires roll-forward recovery and the point-in-time must be to the end of logs. db2 => rollforward db MYDB query status Rollforward Status Input database alias = MYDB Number of nodes have returned status = 1 Node number = 0 Rollforward status = DB working Next log file to be read = S0001797.LOG Log files processed = S0001795.LOG - S0001796.LOG Last committed transaction = 2009-09-25-06.39.04.000000 UTC [/code] To cut it short this is what i did to fix it. [code] db2 => restore db MYDB from /home/db2inst1/OSOL logtarget /tmp DB20000I The RESTORE DATABASE command completed successfully. db2 => rollforward db MYDB to end of logs and stop overflow log path (/tmp) noretrieve Rollforward Status Input database alias = MYDB Number of nodes have returned status = 1 Node number = 0 Rollforward status = not pending Next log file to be read = Log files processed = S0001795.LOG - S0001799.LOG Last committed transaction = 2009-09-25-06.39.04.000000 UTC DB20000I The ROLLFORWARD command completed successfully. db2 => connect to MYDB Database Connection Information Database server = DB2/AIX64 9.1.4 SQL authorization ID = DB2INST1 Local database alias = MYDB