SQL1265N on Rollforward When Restoring Database From One Server to Another

You may also like...

14 Responses

  1. Ben says:

    I believe if you specifed the overflow log path, you wouldn’t get this error.

    • Ember Crooks says:

      I thought I tried that, but I’ll try again the next time it happens and document the results

      • Ember Crooks says:

        I tried it today, and it didn’t help – I still got the error until I renamed (through compressing) the archived log files.

        $ db2 force applications all; db2 deactivate db SAMPLE; db2 "restore db PROD from /db_bkup taken at 2012073016190 into SAMPLE logtarget /db_bkup/logs replace existing without prompting"
        DB20000I  The FORCE APPLICATION command completed successfully.
        DB21024I  This command is asynchronous and may not be effective immediately.
        SQL1496W  Deactivate database is successful, but the database was not
        SQL2540W  Restore is successful, however a warning "2528" was encountered
        during Database Restore while processing in No Interrupt mode.
        $ db2 "rollforward db SAMPLE to end of backup overflow log path ('/db_bkup/logs')"
        SQL1265N  The archive log file "S0000097.LOG" is not associated with the
        current log sequence for database "WC037Q01" on node "0".
        $ cp /db_bkup/logs/*.LOG /db_logs/NODE0000/
        $ db2 "rollforward db SAMPLE to end of backup overflow log path ('/db_bkup/logs')"
        SQL1265N  The archive log file "S0000097.LOG" is not associated with the
        current log sequence for database "WC037Q01" on node "0".
        $ cd /db_arch_logs/SAMPLE/db2inst1/SAMPLE/NODE0000/C0000003
        $ ls
        S0000079.LOG.gz  S0000083.LOG  S0000087.LOG  S0000091.LOG  S0000095.LOG  S0000099.LOG  S0000103.LOG  S0000107.LOG  S0000111.LOG  S0000115.LOG  S0000119.LOG  S
        S0000080.LOG     S0000084.LOG  S0000088.LOG  S0000092.LOG  S0000096.LOG  S0000100.LOG  S0000104.LOG  S0000108.LOG  S0000112.LOG  S0000116.LOG  S0000120.LOG  S
        S0000081.LOG     S0000085.LOG  S0000089.LOG  S0000093.LOG  S0000097.LOG  S0000101.LOG  S0000105.LOG  S0000109.LOG  S0000113.LOG  S0000117.LOG  S0000121.LOG
        S0000082.LOG     S0000086.LOG  S0000090.LOG  S0000094.LOG  S0000098.LOG  S0000102.LOG  S0000106.LOG  S0000110.LOG  S0000114.LOG  S0000118.LOG  S0000122.LOG
        $ gzip *.LOG
        $ db2 "rollforward db SAMPLE to end of backup overflow log path ('/db_bkup/logs')"
                                         Rollforward Status
         Input database alias                   = SAMPLE
         Number of nodes have returned status   = 1
         Node number                            = 0
         Rollforward status                     = DB  working
         Next log file to be read               = S0000097.LOG
         Log files processed                    = S0000097.LOG - S0000097.LOG
         Last committed transaction             = 2012-07-30- UTC
        DB20000I  The ROLLFORWARD command completed successfully.
  2. Siva says:

    Hi, I too have encountered this error couple of times, I believe the only option is to remove or rename the log file in the archive path before the rollforward. I had the new log files which are not associated with the database that is restored present both in active and archive log paths, due to which rollforward failed even with over flow log path specified.
    I think rollforward first looks at archive /retrieve path and then active log path, before even checking the overflow log path for the required log file and then moves it into the active log path directory after it applies all transactions in it. I am guessing immediately after the restore, database would have got activated, due to which the logs gets generated in the log paths (active and archive) with the same log sequence number of the database that is backed up.

  3. Justin Spies says:

    So I ran into this today and it made me go nuts. But I found the issue. This thread is about 6 months old so maybe you found the issue too.

    This happens when you do a restore as ‘REPLACE EXISTING’. What happens is that DB2 does not remove the existing files from the active log directory. Since the DB was previously active and had files in that directory, it must have looked in that directory first. Then it looks in the archive directory, then the new log path.

    I confirmed this behavior by using the following pattern:
    – db2 restore db … replace existing
    – db2 rollforward …

    that generated the error. When I looked in the active log directories, I noticed that the active log directory included the file that the rollforward was trying to process AND the archive log directory included the same.

    I then used the following pattern:
    – db2 drop db …
    – db2 restore db …
    – db2 rollforward db …

    The above worked properly and, before doing the rollforward, I confirmed that in all cases, the active log directory was empty.

    I would imagine that deleting the active log files would work if they are not needed. Typically I think that the sequence numbers should only overlap if you’re doing a ‘REPLACE EXISTING’ when doing testing, or when restoring multiple times because the first attempts failed for some reason.

  4. Raul Baron says:

    Thanks a lot for sharing this. I had this problem this very morning and I solved it thanks to your help.
    I’m in debt with you.
    Once again, thank you very much.
    Best regards,

  5. Noel says:

    I have seen a few people (myself included) having problems with incorrect log files. I’ve added a step to my restore scripts/instructions to copy/delete any files in the archive log path before starting a restore operation. It makes things much easier.

  6. Raul Baron says:

    I confirm Noel’s procedure. I have never again had such problems by erasing the contents of the Path to log files as well as the contents of the logtarget directory.

  7. Michael Krafick says:

    Just to add on the the party …

    In our specific case, the restore was continuing to reach out to TSM over and over for archive logs. We ended up changing our rollforward statement to “to end of backup” and used “NORETRIEVE” at the end of the statement. Soon as we did that, it worked!

  8. venkat says:

    thanks a lot Ember ,

    this helped me a lot, i faced the sam problem and i am able to resolve after following your blog

  9. Fresher says:

    I had the below error like discussed above

    db2 “rollforward db db to end of logs overflow log path (‘path’)”
    I made sure I deleted all files in the active log directory before starting the roll forward. stil had no luck . I didnt use any REPLACE EXISTING in my backup. I also had manually copied the log file listed in the error file to active directory and renamed the file in the archive log directory still no luck. I am using db2 9.7. Anyone please advice

  10. Raul Baron says:

    We are using this and it works fine. I hope it helps

    rm -rf /logs/newdb/*
    rm -rf /logs/logtarget/*
    rm -rf /backups/archived_logs/instance/newdb/NODE0000/*

    db2 restore db db from ‘/backups’ taken at $date on ‘/tablespacepath’ into newdb LOGTARGET ‘/logs/logtarget’ newlogpath ‘/logs/newdb’ without prompting

    db2 rollforward db newdb to end of logs and stop overflow log path ‘(/logs/logtarget)’

  1. February 2, 2016

    […] SQL1265N on Rollforward When Restoring Database From One Server to Another […]

Leave a Reply

Your email address will not be published. Required fields are marked *