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 > SQL1265N The archive log file is not associated with the current log

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-13-09, 16:40
valadil valadil is offline
Registered User
 
Join Date: May 2009
Posts: 7
SQL1265N The archive log file is not associated with the current log

Hi. I'm trying to clone a database across servers. No matter how I attempt it end up with a db in "roll forward pending state" but I can't roll it forward due to error SQL1265N - The archive log file "S#######.LOG" is not associated with the current log sequence for database "$DB_NAME" on node "#".

I'm using the following commant to back up my db:
Code:
db2 backup db $DB_NAME online include logs
And restore it with the following:
Code:
db2 restore db $DB_NAME from /home/db2inst1 taken at $TIMESTAMP logtarget /home/db2inst1/logs/ redirect
db2 restore db $DB_NAME continue
That runs fine. But then I end up with a db that I can't connect to until it rolls forward to the end of logs. And it claims no association to the logs I have. I thought using include logs would make sure it grabbed the right ones, but it doesn't appear to have fixed anything.

For what it's worth, heres the query status:
Code:
$ db2 rollforward database $DB_NAME query status

                                 Rollforward Status

 Input database alias                   = $DB_NAME
 Number of nodes have returned status   = 1

 Node number                            = 0
 Rollforward status                     = DB  pending
 Next log file to be read               = S0000194.LOG
 Log files processed                    =  -
 Last committed transaction             = 2009-05-13-18.59.00.000000 UTC
Any help will be appreciated. Thanks.
Reply With Quote
  #2 (permalink)  
Old 05-13-09, 17:04
db2girl db2girl is offline
∞∞∞∞∞∞
 
Join Date: Aug 2008
Location: Toronto, Canada
Posts: 1,816
use the following command:

db2 "rollforward database $DB_NAME to end of logs and stop overflow log path (/home/db2inst1/logs/) noretrieve"
Reply With Quote
  #3 (permalink)  
Old 05-13-09, 21:04
valadil valadil is offline
Registered User
 
Join Date: May 2009
Posts: 7
Thanks for the quick response. No luck though.

Code:
$ db2 rollforward database $DB_NAME to end of logs and stop overflow log path \(/home/db2inst1/logs/\) noretrieve
SQL1265N The archive log file "S0000194.LOG" is not associated with the current log sequence for database "$DB_NAME" on node "0".
Reply With Quote
  #4 (permalink)  
Old 05-13-09, 21:24
db2girl db2girl is offline
∞∞∞∞∞∞
 
Join Date: Aug 2008
Location: Toronto, Canada
Posts: 1,816
Please make sure that there are no logs in the active log dir. Move them somewhere else if you see any.
Reply With Quote
  #5 (permalink)  
Old 05-14-09, 09:13
valadil valadil is offline
Registered User
 
Join Date: May 2009
Posts: 7
I'm not totally sure what the active log dir is (I'm a db2 noob in case you couldn't tell). I removed the logs from /home/db2inst1/logs/ and tried your command with noretrieve. It still gave me SQL1265N.
Reply With Quote
  #6 (permalink)  
Old 05-14-09, 09:20
Cougar8000 Cougar8000 is offline
Registered User
 
Join Date: Nov 2005
Location: IL
Posts: 554
Explanation:
For roll-forward recovery, the log files need to be processed in
correct sequence. The log file sequence is determined by the
database that has been restored or the log files that have been
processed. In addition to this, for table space level
roll-forward recovery, the log files must be processed in the
sequence through which the current state of the database has been
reached. The specified archive log file was found in the log
directory or the overflow log path for the database on the
specified node but the log file is not in the correct log
sequence.
Roll-forward recovery processing stops.
(Note : if you are using a partitioned database server, the node
number indicates which node the error occurred on. Otherwise, it
is not pertinent and should be ignored.)
User Response:
To determine the correct archive log file, issue the ROLLFORWARD
DATABASE command with the QUERY STATUS option. Move the correct
archive log file into the database log directory or, if the
database is in a consistent state, change the log path to point
to the correct archive file and issue the ROLLFORWARD DATABASE
command again. Alternatively, resubmit the command with the
overflow log path pointing to the correct archive file.
__________________
--
IBM Certified DBA on DB2 for Linux, UNIX, and Windows

DB2 v9.1.0.2 os 5.3.0.0
Reply With Quote
  #7 (permalink)  
Old 05-14-09, 09:34
db2girl db2girl is offline
∞∞∞∞∞∞
 
Join Date: Aug 2008
Location: Toronto, Canada
Posts: 1,816
execute "db2 get db cfg for <db name> | grep -i path", go to the dir pointed to by "Path to log files" or "Changed path to log files" and check if there are any log files. If you find any, move the somewhere else. Then, put the onces you extracted from the backup image back to /home/db2inst1/logs and redo the rollforward.
Reply With Quote
  #8 (permalink)  
Old 05-14-09, 09:47
valadil valadil is offline
Registered User
 
Join Date: May 2009
Posts: 7
Quote:
Originally Posted by db2girl
execute "db2 get db cfg for <db name> | grep -i path", go to the dir pointed to by "Path to log files" or "Changed path to log files" and check if there are any log files. If you find any, move the somewhere else. Then, put the onces you extracted from the backup image back to /home/db2inst1/logs and redo the rollforward.
That appears to have worked. I am in your debt.
Reply With Quote
  #9 (permalink)  
Old 02-14-12, 15:37
fudge21 fudge21 is offline
Registered User
 
Join Date: Feb 2012
Posts: 3
I don't even have a log folder, am I missing something?
Reply With Quote
  #10 (permalink)  
Old 02-15-12, 12:36
db2girl db2girl is offline
∞∞∞∞∞∞
 
Join Date: Aug 2008
Location: Toronto, Canada
Posts: 1,816
Please be more specific.
Reply With Quote
  #11 (permalink)  
Old 02-16-12, 02:24
przytula_guy przytula_guy is offline
Registered User
 
Join Date: Apr 2006
Location: Belgium
Posts: 1,159
I don't even have a log folder, am I missing something?

is this related to the same system/problem
otherwise : do not mix different problems in the same entry ..
__________________
Best Regards, Guy Przytula
Database Software Consultant
DB2 UDB LUW Certified V7-V8-V9-V9.7 DB Admin - Dprop..
Information Server Datastage Certified
http://www.infocura.be
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