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 > Roll-forward: The archive log file is not associated with the current log sequence

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-18-09, 02:26
grofaty grofaty is offline
Registered User
 
Join Date: Jan 2003
Posts: 1,570
Roll-forward: The archive log file is not associated with the current log sequence

Hi,
on DB2 v9.5 FP2 on Linux I wrote backup script that backups production DB2 database. This backup includes logs into backup image. Command is:
db2 backup db MYDB online to /db2/arhiv/ include logs
Parameter LOGARCHMETH1 is set to DISK:/db2/on_line_logs/ this is the path where archive logs are saved.

Then this script copies backup image to test computer to /delovni/arhiv directory and makes a restore of database.
Commands:
db2 "restore database MYDB from /delovni/arhiv to /delovni/db2baza into MYDB logtarget /delovni/restore_logs"

Message returned: "DB20000I The RESTORE DATABASE command completed successfully."

Then rollforward is executed:
db2 "rollforward db MYDB to end of logs and stop overflow log path (/delovni/restore_logs)"

And error is produces:
SQL1265N The archive log file "S0119839.LOG" is not associated with the
current log sequence for database "MYDB" on node "0".

I have checked directory /delovni/restore_logs and there is no file S0119839.LOG:
-rw------- 1 db2inst1 db2iadm1 4202496 2009-09-18 06:12 S0119837.LOG
-rw------- 1 db2inst1 db2iadm1 1740800 2009-09-18 06:12 S0119838.LOG


It is strange, now 8 months this script has been working without any error and nobody has changed any settings related to backup. But now error has appeared.

Any idea why this error accours?
Regards
Reply With Quote
  #2 (permalink)  
Old 09-18-09, 03:07
dr_te_z dr_te_z is offline
Registered User
 
Join Date: Jan 2009
Location: Zoetermeer, Holland
Posts: 555
The "overflow log path" is only used when there are no logfiles found in the regular log path. Make sure this path is empty before you start the rollforward!
Reply With Quote
  #3 (permalink)  
Old 09-18-09, 04:03
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
Make sure the logtarget directory is empty before you do the restore specifying the logtarget path.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
  #4 (permalink)  
Old 09-18-09, 04:30
grofaty grofaty is offline
Registered User
 
Join Date: Jan 2003
Posts: 1,570
Logtarget is empty before restore is done...

I have some kind solve the problem. Let me explain how:

As I understand rollforward process is trying to also restore "archive logs" that are not available in backup image.

So I have changed rollforward command from:
db2 "rollforward db MYDB to end of logs and stop overflow log path (/delovni/restore_logs)"
to:
db2 "rollforward db MYDB to end of logs and stop overflow log path (/delovni/restore_logs) noretrieve"

I have checked documentation:
===============
NORETRIEVE
Allows the user to control which log files to be rolled forward on the standby machine by allowing the user to disable the retrieval of archived logs. The benefits of this are:
* By controlling the logfiles to be rolled forward, one can ensure that the standby machine is X hours behind the production machine, to prevent the user affecting both systems.
* If the standby system does not have access to archive (eg. if TSM is the archive, it only allows the original machine to retrieve the files)
* It might also be possible that while the production system is archiving a file, the standby system is retrieving the same file, and it might then get an incomplete log file. Noretrieve would solve this problem.
===============

What I can't understand is why rollforward process was working without any problem at all for 8 months, but now suddenly two days a role the same problem appeared.

Any idea what could trigger this problem?
Regards

Last edited by grofaty; 09-18-09 at 04:37.
Reply With Quote
  #5 (permalink)  
Old 09-18-09, 05:16
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
I think it just depends on whether a unit of work spans log files (past the last log file in your overflow log path). DB2 has the option of trying to find the next log file in the archives to apply the rest of any open UOW's from the last log in the overflow log path, or it can just roll back any uncommited transactions if you specify noretrieve.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
  #6 (permalink)  
Old 09-18-09, 06:02
grofaty grofaty is offline
Registered User
 
Join Date: Jan 2003
Posts: 1,570
By the way, what is better to have multiple small log files or few big log files?
Now my db cfg settings are:
LOGFILSIZ= 1024
LOGPRIMARY = 10
LOGSECOND = -1
Reply With Quote
  #7 (permalink)  
Old 09-18-09, 06:27
dr_te_z dr_te_z is offline
Registered User
 
Join Date: Jan 2009
Location: Zoetermeer, Holland
Posts: 555
What I want to add to this subject is this:

Restoring prod_db's down the OTAP lane is a hidious operation, especially when youre source is an online-backup. Topic-starter knows, because the backup is taken with the "include logs" parameter and the logs are also retrieved during restore. Still: for us humans it is 'not done' to distinguish 1 log-file from the other (1 is was included in the backup-image and required in the rollback, the other was written by the "test" database prior to the restore-session).
So, just before you start your restore-script delete/move/zip/tar/whatever all the log-files you can find. Don't care, as long as they are GONE from that server!

This brings me to a tip and an answer to your latest question:
make sure that all your databases use different size for the logs. This will give you a little help in recognizing the soure-database of your logfiles. Something like:
this subdir is populated with 16M log-files, so that's prod
this subdir is populated with 10M log-files, so that's test etc etc

Last edited by dr_te_z; 09-18-09 at 06:31.
Reply With Quote
  #8 (permalink)  
Old 09-18-09, 09:18
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
Quote:
Originally Posted by grofaty
By the way, what is better to have multiple small log files or few big log files?
Now my db cfg settings are:
LOGFILSIZ= 1024
LOGPRIMARY = 10
LOGSECOND = -1
Larger log files will give you better performance, but slightly longer crash recovery times (very slightly longer unless your file sizes are extremely large). I would suggest larger file sizes so long as you don't over-do it. But you don't need to make the file size larger if you only use just a few log files per day at your current size.

I would not go below 4 logs files in the primary regardless of file size.

I don't see unlimited secondary (-1) very often because I do not believe it is supported with HADR.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
  #9 (permalink)  
Old 09-19-09, 01:34
grofaty grofaty is offline
Registered User
 
Join Date: Jan 2003
Posts: 1,570
Hi,
what is the best way to check how large should log files be?
Regards
Reply With Quote
  #10 (permalink)  
Old 09-28-09, 05:19
dr_te_z dr_te_z is offline
Registered User
 
Join Date: Jan 2009
Location: Zoetermeer, Holland
Posts: 555
Quote:
Originally Posted by grofaty
Hi,
what is the best way to check how large should log files be?
Regards
If nobody knows (seems to be the case here) rely on :
DB2 Universal Database
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