Results 1 to 12 of 12
  1. #1
    Join Date
    May 2009
    Posts
    7

    Unanswered: 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.

  2. #2
    Join Date
    Aug 2008
    Location
    Toronto, Canada
    Posts
    2,367
    use the following command:

    db2 "rollforward database $DB_NAME to end of logs and stop overflow log path (/home/db2inst1/logs/) noretrieve"

  3. #3
    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".

  4. #4
    Join Date
    Aug 2008
    Location
    Toronto, Canada
    Posts
    2,367
    Please make sure that there are no logs in the active log dir. Move them somewhere else if you see any.

  5. #5
    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.

  6. #6
    Join Date
    Nov 2005
    Location
    IL
    Posts
    557
    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.7.0.6 os 6.1.0.0

  7. #7
    Join Date
    Aug 2008
    Location
    Toronto, Canada
    Posts
    2,367
    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.

  8. #8
    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.

  9. #9
    Join Date
    Feb 2012
    Posts
    3
    I don't even have a log folder, am I missing something?

  10. #10
    Join Date
    Aug 2008
    Location
    Toronto, Canada
    Posts
    2,367
    Please be more specific.

  11. #11
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    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
    Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
    Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
    DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
    Information Server Datastage Certified
    http://www.infocura.be

  12. #12
    Join Date
    Oct 2013
    Posts
    1

    Cool Noretrieve rocks

    I faced similar issue.
    Using Noretrieve helped me to solve the problem.

    Thanks.





    Quote Originally Posted by db2girl View Post
    use the following command:

    db2 "rollforward database $DB_NAME to end of logs and stop overflow log path (/home/db2inst1/logs/) noretrieve"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •