Posts

Showing posts from December, 2012

PART2 - DB2 restore/recover online backup on different server

Image
In the previous part 1   we restored the database to different server. Now we will do the recovery of this database. Below is the command used for roll forwarding the database we restored in the part 1. This will put the database on consistent state using the logs that were included with the backup file from original host db2 “rollforward database ebppres to end of logs and complete overflow log path (‘/db2_main_data2/ebpplog’)”  “end of logs” – This indicates that we are doing a full recovery instead of Point in time recovery. If point in time recovery is needed “using local time” clause need to be used also specifying the time which the recovery will end. “complete” – This will stop the roll forward process and undo any uncompleted transactions to put the database on consistent(accessible) state. Here the use of “and” is to combine two commands. As an example above single command is same as issuing below two commands. db2 “rollforward database ebppres to end of log”

PART1 - DB2 restore/recover online backup on different server

Image
DB2 restore/recover database to different server Db2 version - DB2 v9.1.0.10 LUW, no DPF OS – AIX 5.3 Below  is the part 1 of 2 which descibes the process of restoring db2 full online database backup to different server with different mount point definition. So this will be a redirected restore with redefining database containers. BackupProcess Database name – ebpp db2 “backup database ebpp online to /rsair_dbbackup/bifinst1_backup/EBPP compress include logs”; LST -01 Restore Process  Assuming same instance level as the backup host is there on the restoration host, Step 1 – Initiate a redirect restore start Below is the command used.. Explanation follows, db2 terminate db2 "restore database ebpp dbpath on '/db2_main_temp1' into ebppres logtarget '/db2_main_data2/ebpplog' redirect" LST -02 dbpath will be the database path for newly created database. *** This need to be run from the directory which the ba

DB2 – Behavior when users are dropped from OS level

Image
This is to discuss the behavior of db2 when users (Who are granted database authorities) are dropped from OS level. Check the current users and their authorities granted.   Add a new user and grant some authorities then drop the user Now recheck the authorities still the user is defined in database and the authorities are there. In most cases this will not be an issue practically as default authentication can not happen since the user is dropped from OS level. Anyways you will have to revoke the authorities manually if you want to remove them. And if you ever needed to remove this type of entries from database (Happened to me.. Didn’t work saying “it will not affect anything L ”) below script will find those users and any objects that they have the ownership. On UNIX, DB2 => 9 . ~/.profile cat /etc/passwd | awk 'BEGIN { FS = ":" } ; { prin

DB2 Resolve SQL2062N An error occurred while accessing media

We were trying to restore a TSM backup of SAP with load options of DB2 restore. Command – db2 backup db ecp online load /usr/tivoli/tsm/tdp_r3/db264/libtdpdb264.a But we were repeatedly getting SQL2062N, SQL2062N An error occurred while accessing media "/usr/tivoli/tsm/tdp_r3/db264/libtdpdb264.a". Reason code: "11". dsmerror.log or db2diag log was not helping much. Then we were looking at - tdpdb2.<SID>.<nodename>.log ( http://publib.boulder.ibm.com/infocenter/tsminfo/v6/index.jsp?topic=%2Fcom.ibm.itsm.erp.doc%2Fr_dperp_d_prob_reasoncodes.html ) From that we could find the reason… It was because the ‘XINT_PROFILE’ environment variable was not set.. How to set XINT_PROFILE is described clearly in here, http://www-01.ibm.com/support/docview.wss?uid=swg21250331