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 > Sql1268n

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-31-03, 13:06
solomoc solomoc is offline
Registered User
 
Join Date: Oct 2003
Posts: 6
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
Reply With Quote
  #2 (permalink)  
Old 01-02-04, 09:09
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
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
Reply With Quote
  #3 (permalink)  
Old 01-02-04, 14:15
solomoc solomoc is offline
Registered User
 
Join Date: Oct 2003
Posts: 6
Quote:
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.
Reply With Quote
  #4 (permalink)  
Old 01-02-04, 14:16
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
Was you backup offline or online?

Andy

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

I did a normal online backup of the database.
Reply With Quote
  #5 (permalink)  
Old 01-05-04, 09:43
solomoc solomoc is offline
Registered User
 
Join Date: Oct 2003
Posts: 6
Quote:
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'
Reply With Quote
  #6 (permalink)  
Old 01-05-04, 09:52
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
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
Reply With Quote
  #7 (permalink)  
Old 01-05-04, 11:36
cchattoraj cchattoraj is offline
Registered User
 
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)
Reply With Quote
  #8 (permalink)  
Old 01-07-04, 09:52
jsander jsander is offline
Registered User
 
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

Quote:
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)
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