Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

user exit and roll forward 1

Status
Not open for further replies.

Morsing

Technical User
Jun 25, 2002
881
0
0
GB

Hi,
I have compiled the sample user exit programme but when I try to roll forward it looks for a log file with a number one higher than exists.
So if logs 0-2 exists it will stop with an error and say that S0000003.LOG cannot be opened.

As far as I can see the name is passed to db2uext2 from db2 so why does this happen??

Cheers

Henrik Morsing
Certified AIX 4.3 Systems Administration
& p690 Technical Support
 
When you took the backup, it probably was using one more log file. You need to put it in the active log directory and issue:
db2 rollforward db <dbname> to end of logs
db2 rollforward db <dbname> complete
or try rollforward to a pit:
db2 rollforward db <dbname> to yyyy-mm-dd-hh.mm.ss.nnnnnn and complete
 

> You need to put it in the active log directory

How do I do that??

Here's some output from my configuration:

[bob5](db2inst1:/home/db2inst1) $db2 get db cfg for testdb4 | grep LOG
Catalog cache size (4KB) (CATALOGCACHE_SZ) = 64
Log buffer size (4KB) (LOGBUFSZ) = 8
Log file size (4KB) (LOGFILSIZ) = 1000
Number of primary log files (LOGPRIMARY) = 3
Number of secondary log files (LOGSECOND) = 2
Changed path to log files (NEWLOGPATH) =
Path to log files = /home/db2inst1/db2inst1/NODE0000/SQL00007/SQLOGDIR/
First active log file = S0000003.LOG
Log retain for recovery enabled (LOGRETAIN) = RECOVERY


> db2 rollforward db <dbname> to yyyy-mm-dd-hh.mm.ss.nnnnnn and complete

How can I find the time to rollforward to??

Cheers

Henrik Morsing
Certified AIX 4.3 Systems Administration
& p690 Technical Support
 
Your must have the S0000003.LOG file in the active log directory: /home/db2inst1/db2inst1/NODE0000/SQL00007/SQLOGDIR/
Get the backup from your history log file like this:
db2 list backup all for <dbname>
The output may look like:
Op Obj Timestamp+Sequence Type Dev Earliest Log Current Log Backup ID
-- --- ------------------ ---- --- ------------ ------------ --------------
B D 20030513043507001 F A S0000000.LOG S0000003.LOG
----------------------------------------------------------------------------
Contains 28 tablespace(s):

00001 SYSCATSPACE
00002 USERSPACE1
......

Look in the Earliest Log and Current Log. You must have that range of log files in the active directory or get them from your archive directory (the one specified in your USEREXIT routine). Put the files in the active log directory, and reissue the restore with rollforward.
 
Your must have the S0000003.LOG file in the active log directory: /home/db2inst1/db2inst1/NODE0000/SQL00007/SQLOGDIR/
Get the backup from your history log file like this:
db2 list backup all for <dbname>
The output may look like:
Op Obj Timestamp+Sequence Type Dev Earliest Log Current Log Backup ID
-- --- ------------------ ---- --- ------------ ------------ --------------
B D 20030513043507001 F A S0000000.LOG S0000003.LOG
----------------------------------------------------------------------------
Contains 28 tablespace(s):

00001 SYSCATSPACE
00002 USERSPACE1
......

Look in the Earliest Log and Current Log. You must have that range of log files in the active directory or get them from your archive directory (the one specified in your USEREXIT routine). Put the files in the active log directory, and reissue the restore with rollforward.
 

Hi,
my backup history looks like this:


Op Obj Timestamp+Sequence Type Dev Earliest Log Current Log Backup ID
-- --- ------------------ ---- --- ------------ ------------ --------------
R D 20030512101420001 F 20030512095335
----------------------------------------------------------------------------
Contains 2 tablespace(s):

00001 SYSCATSPACE
00002 USERSPACE1
----------------------------------------------------------------------------
Comment: RESTORE TESTDB4 WITH RF
Start Time: 20030512101420
End Time: 20030512101445
----------------------------------------------------------------------------
00005 Location:


That's the latest one. The other ones all have earliest and latest set to the same file, e.g. S0000002.LOG and S0000002.LOG. Those file do exist in the LOG directory and S0000003.LOG, which it is looking for, doesn't exist at all.

Cheers

Henrik Morsing
Certified AIX 4.3 Systems Administration
& p690 Technical Support
 

Cotaurus, a start for you :)

I found the correct log file and it works now.

Cheers

Henrik Morsing
Certified AIX 4.3 Systems Administration
& p690 Technical Support
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top