Scott:
Yes, it took me a while to get my brain wrapped around this...
Assuming you want to roll-forward only the logs stored w/ the online DB
backup:
Do the backup like so:
-backup database $db online to <whereverinclude logs
Then:
-restore db $db taken at $pit logtarget /tmp
-db2 rollforward db $db to end of logs and stop overflow log path /tmp
noretrieve
$pit is the point in time referenced in the online backup file, ie:
<DB>.0.<instance>.NODE0000.CATN0000.20071228021205 .001 would be
0071228021205
I happen to be using /tmp to store the logs that are extracted from
the backup, choose whatever dir you fancy.
I'm not familar w/ AIX, but on Linux this script will automate it. Feed
it the name of the database you want to restore+roll forward as the arg.
db=`echo $1 | tr '[a-z]' '[A-Z]'`
pit=`ls $<backup location>/$db.0.*.001 | awk -F. '{print $6}'`
cd $<backup location>
echo -e "Restoring database $db...\n"
db2 restore db $db taken at $pit logtarget /tmp
db2 rollforward db $db to end of logs and stop overflow log path
\(/tmp\) noretrieve
Careful w/ the left and right parens - they will trip up the shell
interpreter. Notice how I escaped them..
Good luck. HTH
cheers
aj
Scott wrote:
Running DB2 9.1 on AIX 5.3
I would like to do a restore of a database from an online backup image
to December 21st with a backup that was taken using INLCUDE LOGS
Same box, not a redirected restore.
If I use the logtarget parameter on the restore db command
can I then simply do a rollfoward database to end of logs and stop
overflow logpath /fullpath ?
Since there are more recent logs present in the active log directory do
I have to specify NORETRIEVE to ensure that db2 only uses the logs from
the backup image in the log retreieve path to do the rollforward and not
use any other logs?
Thanks in advance.
Scott