Wednesday, April 22, 2009

RMAN: Restore archivelogs

This is a quick method of restoring rman archivelog files for database incomplete recovery. It is easier to simply use the rman catalog:

$ rman target /

Recovery Manager: Release 10.2.0.3.0 - Production on Wed Apr 22 14:02:17 2009

Copyright (c) 1982, 2005, Oracle. All rights reserved.

connected to target database: TSTINET (DBID=1789357865)

RMAN> ALLOCATE CHANNEL FOR MAINTENANCE DEVICE TYPE 'sbt_tape' parms 'ENV=(TDPO_OPTFILE=/opt/tivoli/tsm/client/oracle/bin/tdpo.opt)';

using target database control file instead of recovery catalog
allocated channel: ORA_MAINT_SBT_TAPE_1
channel ORA_MAINT_SBT_TAPE_1: sid=63 devtype=SBT_TAPE
channel ORA_MAINT_SBT_TAPE_1: Tivoli Data Protection for Oracle: version 5.2.0.0

you can now list the scn changes contained with the archivelog required (in this case seq 648)

RMAN> list backup of archivelog sequence 648;


List of Backup Sets
===================

BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
1597 76.75M SBT_TAPE 00:00:06 21-APR-09
BP Key: 1597 Status: AVAILABLE Compressed: NO Tag: TAG20090421T230314
Handle: TSTINET/TSTINET_al_t684802994_s1622_p1 Media: DISKPOOL

List of Archived Logs in backup set 1597
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- --------- ---------- ---------
1 648 2324906766 20-APR-09 2324970620 21-APR-09

The archive log can now be restored:


RMAN> run
2> {
3> allocate channel ch1 type 'sbt_tape' parms
4> 'ENV=(TDPO_OPTFILE=/opt/tivoli/tsm/client/oracle/bin/tdpo.opt)';
5> restore archivelog from scn 2324906766 until scn 2324970620;
6> }

1 comment:

Anonymous said...

After looking over a number οf the blog articles on your ωebsіte, I seriously appreciаte your wаy of blogging.
I boοkmarked it to my bookmark site list аnd will be
checking baсκ soon. Take а look at my ωeb site too and tell me ωhat
you think.

my wеb sitе :: top 5 wedding photographer
My webpage - wedding photographers cost