If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Restore Redirect / Rollforward

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-15-07, 15:41
rmarzullo rmarzullo is offline
Registered User
 
Join Date: May 2007
Posts: 56
Restore Redirect / Rollforward

I have an old DB2 v7.1 server that I am trying (desperate) move the online backup to another server with the same DB2 version.

I took an online backup on server 2 and ftp along the logs to server 1
Then I ran the following restore script:
---------

db2owner@elmer:/local/db2backup/daily:>cat restore_redirect_3.sh
#!/bin/ksh
DB=$1
RFROM=$2
RTMSP=$3
db2 "restore db $DB from $RFROM taken at $RTMSP into SWITCH redirect without prompting"
db2 "set tablespace containers for 0 REPLAY ROLLFORWARD CONTAINER OPERATIONS using (path '/db2owner/db2owner/NODE0000/SQL00003/SQLT0000.0')"
db2 "set tablespace containers for 1 REPLAY ROLLFORWARD CONTAINER OPERATIONS using (path '/db2owner/db2owner/NODE0000/SQL00003/SQLT0001.0')"
db2 "set tablespace containers for 2 REPLAY ROLLFORWARD CONTAINER OPERATIONS using (path '/db2owner/db2owner/NODE0000/SQL00003/SQLT0002.0')"
db2 "set tablespace containers for 4 REPLAY ROLLFORWARD CONTAINER OPERATIONS using ( path '/tmpspace/emcswit')"
##
db2 "restore db SWITCH continue"
db2 "rollforward db SWITCH query status"
db2 "terminate"
-----------
The restore finished successfully and gave me :
---------
SQL1277N Restore has detected that one or more table space containers are
inaccessible, or has set their state to 'storage must be defined'.
DB20000I The RESTORE DATABASE command completed successfully.
DB20000I The SET TABLESPACE CONTAINERS command completed successfully.
DB20000I The SET TABLESPACE CONTAINERS command completed successfully.
DB20000I The SET TABLESPACE CONTAINERS command completed successfully.
DB20000I The SET TABLESPACE CONTAINERS command completed successfully.
DB20000I The RESTORE DATABASE command completed successfully.

Rollforward Status

Input database alias = SWITCH
Number of nodes have returned status = 1

Node number = 0
Rollforward status = DB pending
Next log file to be read = S0000445.LOG
Log files processed = -
Last committed transaction = 2007-11-15-01.54.24.000000

DB20000I The TERMINATE command completed successfully.

---
I took a "get db cfg for db SWITCH" on this server just to confirm that I have the proper logs. So the current log path is:
-----------------------
b2owner@elmer:/local/db2backup/daily:>db2 get db cfg for switch

Database Configuration for Database switch

Database configuration release level = 0x0900
Database release level = 0x0900

Database territory = US
Database code page = 819
Database code set = ISO8859-1
Database country code = 1

Dynamic SQL Query management (DYN_QUERY_MGMT) = DISABLE

Directory object name (DIR_OBJ_NAME) =
Discovery support for this database (DISCOVER_DB) = ENABLE

Default query optimization class (DFT_QUERYOPT) = 5
Degree of parallelism (DFT_DEGREE) = 1
Continue upon arithmetic exceptions (DFT_SQLMATHWARN) = NO
Default refresh age (DFT_REFRESH_AGE) = 0
Number of frequent values retained (NUM_FREQVALUES) = 10
Number of quantiles retained (NUM_QUANTILES) = 20

Backup pending = NO

Database is consistent = NO
Rollforward pending = DATABASE
Restore pending = NO

Multi-page file allocation enabled = NO

Log retain for recovery status = RECOVERY
User exit for logging status = NO

Data Links Token Expiry Interval (sec) (DL_EXPINT) = 60
Data Links Number of Copies (DL_NUM_COPIES) = 1
Data Links Time after Drop (days) (DL_TIME_DROP) = 1
Data Links Token in Uppercase (DL_UPPER) = NO
Data Links Token Algorithm (DL_TOKEN) = MAC0

Database heap (4KB) (DBHEAP) = 4000
Catalog cache size (4KB) (CATALOGCACHE_SZ) = 182
Log buffer size (4KB) (LOGBUFSZ) = 48
Utilities heap size (4KB) (UTIL_HEAP_SZ) = 5000
Buffer pool size (pages) (BUFFPAGE) = 4000
Extended storage segments size (4KB) (ESTORE_SEG_SZ) = 16000
Number of extended storage segments (NUM_ESTORE_SEGS) = 0
Max storage for lock list (4KB) (LOCKLIST) = 2000

Max appl. control heap size (4KB) (APP_CTL_HEAP_SZ) = 128

Sort list heap (4KB) (SORTHEAP) = 256
SQL statement heap (4KB) (STMTHEAP) = 2048
Default application heap (4KB) (APPLHEAPSZ) = 384
Package cache size (4KB) (PCKCACHESZ) = (MAXAPPLS*8)
Statistics heap size (4KB) (STAT_HEAP_SZ) = 4384

Interval for checking deadlock (ms) (DLCHKTIME) = 10000
Percent. of lock lists per application (MAXLOCKS) = 10
Lock timeout (sec) (LOCKTIMEOUT) = 300

Changed pages threshold (CHNGPGS_THRESH) = 60
Number of asynchronous page cleaners (NUM_IOCLEANERS) = 7
Number of I/O servers (NUM_IOSERVERS) = 8
Index sort flag (INDEXSORT) = YES
Sequential detect flag (SEQDETECT) = YES
Default prefetch size (pages) (DFT_PREFETCH_SZ) = 32

Default number of containers = 1
Default tablespace extentsize (pages) (DFT_EXTENT_SZ) = 32

Max number of active applications (MAXAPPLS) = 180
Average number of active applications (AVG_APPLS) = 1
Max DB files open per application (MAXFILOP) = 64

Log file size (4KB) (LOGFILSIZ) = 4000
Number of primary log files (LOGPRIMARY) = 20
Number of secondary log files (LOGSECOND) = 30
Changed path to log files (NEWLOGPATH) =
Path to log files = /dblogs/emcswit/
First active log file = S0000445.LOG

Group commit count (MINCOMMIT) = 1
Percent log file reclaimed before soft chckpt (SOFTMAX) = 100
Log retain for recovery enabled (LOGRETAIN) = RECOVERY
User exit for logging enabled (USEREXIT) = OFF

Auto restart enabled (AUTORESTART) = ON
Index re-creation time (INDEXREC) = SYSTEM (RESTART)
Default number of loadrec sessions (DFT_LOADREC_SES) = 1
Number of database backups to retain (NUM_DB_BACKUPS) = 12
Recovery history retention (days) (REC_HIS_RETENTN) = 366

TSM management class (TSM_MGMTCLASS) =
TSM node name (TSM_NODENAME) =
TSM owner (TSM_OWNER) =
TSM password (TSM_PASSWORD) =

-----
On my Log path all the logs necessary are there ....
If I issue a "db2 rollforward for db SWITCH query status" I get :
-------

Rollforward Status

Input database alias = switch
Number of nodes have returned status = 1

Node number = 0
Rollforward status = DB pending
Next log file to be read = S0000445.LOG
Log files processed = -
Last committed transaction = 2007-11-15-01.54.24.000000

--------
Checking my log path /dblogs/emcswit (which is stated on db cfg) I have:
---------
db2owner@elmer:/dblogs/emcswit:>ls -l

-rw-r--r-- 1 db2owner db2adm 2447 Nov 15 13:22 *.log
-rw-r--r-- 1 db2owner db2adm 16392192 Nov 15 14:34 S0000445.LOG
-rw-r--r-- 1 db2owner db2adm 16392192 Nov 15 14:34 S0000446.LOG
-rw-r--r-- 1 db2owner db2adm 16392192 Nov 15 14:34 S0000447.LOG
-rw-r--r-- 1 db2owner db2adm 16392192 Nov 15 14:34 S0000448.LOG
-rw-r--r-- 1 db2owner db2adm 16392192 Nov 15 14:34 S0000449.LOG
-rw-r--r-- 1 db2owner db2adm 16392192 Nov 15 14:34 S0000450.LOG
-rw-r--r-- 1 db2owner db2adm 16392192 Nov 15 14:34 S0000451.LOG
-rw-r--r-- 1 db2owner db2adm 16392192 Nov 15 14:34 S0000452.LOG
-rw-r--r-- 1 db2owner db2adm 16392192 Nov 15 14:34 S0000453.LOG
-rw-r--r-- 1 db2owner db2adm 16392192 Nov 15 14:34 S0000454.LOG
-rw-r--r-- 1 db2owner db2adm 16392192 Nov 15 14:34 S0000455.LOG

--------------
If I issue this means the database SWITCH is on rollforward pending state.
So I tried to rollforward to end of logs and I got it:
------------
db2owner@elmer:/local/db2backup/daily:>db2 rollforward db SWITCH to end of logs and complete
SQL4970N Roll-forward recovery on database "SWITCH" cannot reach the
specified stop point (end-of-log or point-in-time) because of missing log
file(s) on node(s) "0".

I tried rollforwarding logs to a time smaller than the last transactions but also didn't work.

I am really LOST and without support it is very HARD.

Could you please what could I do?

Thank you very much
Reply With Quote
  #2 (permalink)  
Old 11-15-07, 17:30
dbamota dbamota is offline
Registered User
 
Join Date: Sep 2003
Posts: 237
You should look at the db2diag.log; it should give as to where it is looking for the logs and what, it thinks is missing.
__________________
mota
Reply With Quote
  #3 (permalink)  
Old 11-16-07, 03:29
guyprzytula guyprzytula is offline
Registered User
 
Join Date: Jun 2006
Posts: 471
the first restore command presented the error as there is a problem with a path to be created/used. are you the instance owner ?
new db or replace ?
__________________
Best Regards, Guy Przytula
DB2 UDB LUW certified V6/7/8
Reply With Quote
  #4 (permalink)  
Old 11-16-07, 08:00
rmarzullo rmarzullo is offline
Registered User
 
Join Date: May 2007
Posts: 56
Restore Redirect / Rollforward

I am the instance owner...the server are exact copies of each other, I am used to restore backups from one side to another ...the only difference is now I'm doing a redirect restore. In the db2diag.log (level 3) doesn't have anything about the missing log..
Here is an example:
2007-11-15-16.01.51.113889 Instance:db2owner Node:000
PID:197048(db2agent (SWITCH)) Appid:*LOCAL.db2owner.071114202453
data_protection sqlufrol Probe:100 DatabaseWITCH

Rollforward has been initiated

2007-11-15-16.01.51.122060 Instance:db2owner Node:000
PID:197048(db2agent (SWITCH)) Appid:*LOCAL.db2owner.071114202453
data_protection sqlufrol Probe:110 DatabaseWITCH

Invoking database rollforward forward recovery

2007-11-15-16.01.51.134010 Instance:db2owner Node:000
PID:197048(db2agent (SWITCH)) Appid:*LOCAL.db2owner.071114202453
recovery_manager sqlprDoForwardPhase Probe:70 DatabaseWITCH

Rollforward is not able to reach the end of online backup timestamp

2007-11-15-16.01.51.142961 Instance:db2owner Node:000
PID:197048(db2agent (SWITCH)) Appid:*LOCAL.db2owner.071114202453
data_protection sqlufrol Probe:130 DatabaseWITCH

Rollforward iteration completed

The restore finish fine...the problem is the rollforward.

Please give me some hints in what can I do ...
Thanks
Reply With Quote
  #5 (permalink)  
Old 11-16-07, 17:32
nivasreddy007 nivasreddy007 is offline
Registered User
 
Join Date: Jun 2007
Posts: 66
Do you have the log that is mentioned in the list history for backup for that particular backup?? That log is a must to rollforward the db
Reply With Quote
  #6 (permalink)  
Old 11-19-07, 09:09
rmarzullo rmarzullo is offline
Registered User
 
Join Date: May 2007
Posts: 56
Restore Redirect / Rollforward

Yes I do have the same log required for the restore.
I checked many times, on the server side where I took the online backup I issued "db2 list history .... "

and after restoring on the target side, and it was "rollforwarding pending status" I issued "db2 rollforward db SWITCH query status"

On all my tries I did that, I even tried to browse the logs in a desperate way to see if anything was wrong.
I used an offline backup and applied logs and worked like a champ, so I don;t know what is going on.

Please let me know if you have any suggestions.
Thx
Reply With Quote
  #7 (permalink)  
Old 11-19-07, 10:50
gdipietro80 gdipietro80 is offline
Registered User
 
Join Date: Oct 2003
Location: Rome
Posts: 15
sorry for the english.
If your server is identical try with normal restore database and rollforward
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On