Results 1 to 8 of 8

Thread: Sql1268n

  1. #1
    Join Date
    Oct 2003
    Posts
    6

    Unanswered: Sql1268n

    I am using UDB 8.1 on SUSE Linux

    I am trying to do a restore database.

    I issue the following syntax:

    db2 restore database TEST from /data/back taken at 20031230162114

    The restore completes successfully.

    I now try to issue the following roll forward command:

    db2 rollforward db TEST to end of logs.

    I get the following error:

    SQL1268N Roll-forward recovery stopped due to error "24" while retrieving log file "S0000001.LOG" for database "TEST" on node "0"

    I figure this had to do with the user exits.

    I copied the db2uext2.cdisk to db2uext2.c and placed it in my sqllib/bin dir and updated the following fields to point to my archive files:

    #define ARCHIVE_PATH "/home/db2inst1/mylogs/"
    #define RETRIEVE_PATH "/home/db2inst1/mylogs/"
    #define AUDIT_ACTIVE 1 /* enable audit trail logging */
    #define ERROR_ACTIVE 1 /* enable error trail logging */
    #define AUDIT_ERROR_PATH "/home/db2inst1/mylogs/ " /* path must end with a slash */
    #define AUDIT_ERROR_ATTR "a" /* append to text file */
    #define BUFFER_SIZE 32 /* # of 4K pages for output buffer */



    The only way I can get out of the roll pending state for the database is to issue the following command:

    db2 rollforward on db TEST stop


    Any ideas on why this is occurring?

    Thanks
    C

  2. #2
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    Did you have USEREXIT or RECOVERY parameters set before you made the backup from which you are trying to recover? Which type of backup did you perform?

    Andy

  3. #3
    Join Date
    Oct 2003
    Posts
    6
    Originally posted by ARWinner
    Did you have USEREXIT or RECOVERY parameters set before you made the backup from which you are trying to recover? Which type of backup did you perform?

    Andy

    Yes userexit and recovery is set to on and recover

    I did a normal online backup of the database.

  4. #4
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    Was you backup offline or online?

    Andy

    Originally posted by solomoc
    Yes userexit and recovery is set to on and recover

    I did a normal online backup of the database.

  5. #5
    Join Date
    Oct 2003
    Posts
    6
    Originally posted by ARWinner
    Was you backup offline or online?

    Andy

    My backup was online.


    Here is the backup script

    more db_back

    . /home/db2inst1/sqllib/db2profile
    /home/db2inst1/sqllib/bin/db2 force applications all
    /home/db2inst1/sqllib/bin/db2 backup db dia to '/data/arraya/bck'

  6. #6
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    I would suggest two things (based on a similar problem I had and needed IBM support for).

    1) drop the database before you recover
    2) manually copy the log files from the archive to the log directory.

    Andy

  7. #7
    Join Date
    Mar 2003
    Posts
    343
    The backup statement given is for an offline backup (ie does not contain the online keyword). Then it does make sense that you do a rollforward ... stop.

    In db2 you do not have to force off applications for an online backup and the backup statement in this case would be

    db2 backup db dia online to '/data/arraya/bck'

    While an online backup is in progress, users can query and update the database, but cannot do things which require exclusive locks (like autoloads)

  8. #8
    Join Date
    Apr 2003
    Posts
    191

    more on lost logs with online backup recovery

    Hi,

    and you should add an

    db2 archive log for database <dbname>

    before exiting from your batch. DB2 restore discards of all the logs in the log path before attempting to retrieve the last log from the userexit, which means you may lose the log rollforward is depending on unless it has been archived in the first place.

    Something like this might have happened to you.

    Johann

    Originally posted by cchattoraj
    The backup statement given is for an offline backup (ie does not contain the online keyword). Then it does make sense that you do a rollforward ... stop.

    In db2 you do not have to force off applications for an online backup and the backup statement in this case would be

    db2 backup db dia online to '/data/arraya/bck'

    While an online backup is in progress, users can query and update the database, but cannot do things which require exclusive locks (like autoloads)

Posting Permissions

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