ITPub博客

首页 > Linux操作系统 > Linux操作系统 > ReStoring RMAN backup on another server (Detailed Steps)

ReStoring RMAN backup on another server (Detailed Steps)

原创 Linux操作系统 作者:tan9030 时间:2009-03-11 10:09:52 0 删除 编辑


ReStoring RMAN backup on another server (Detailed Steps)

Testing Env:

 Catalog Database MESMIG on szx031
 Target database RPTTRN on szx032

 Purpose: Restore RPTTRN backup to server SZX031

1. Setup up catalog database on MESMIG (SZX031)

SQL> create tablespace rmantrn datafile 'filename' size 200M;

SQL> create user rmantrn identified by rmantrn
  2  default tablespace rmantrn
  3  temporary tablespace temp;  

User created.

SQL> grant connect,resource,recovery_catalog_owner to rmantrn;

Grant succeeded
 
RMAN> connect catalog rmantrn/rmantrn@mesmig

connected to recovery catalog database

RMAN> create catalog tablespace rmantrn

recovery catalog created

2. Register target database: RPTTRN (SZX032)

 RMAN> connect target /

connected to target database: RPTTRN (DBID=860139398)

RMAN> connect catalog rmantrn/rmantrn@mesmig

connected to recovery catalog database

RMAN> register database;

database registered in recovery catalog
starting full resync of recovery catalog
full resync complete

3. Make full backup for target dabase (On RPTTRN) (SZX032)

RMAN> connect target /

connected to target database: RPTTRN (DBID=86013939)

RMAN> connect catalog rmantrn/rmantrn@mesmig

connected to recovery catalog database

run {
allocate channel d1 type disk;
backup incremental level 0 filesperset 1
format '/home/oracle/rman/%d_DB_FILE_%s:%t:%p.dbf'
database
include current controlfile
;
sql 'alter system archive log current'
;
backup filesperset 1
format '/home/oracle/rman/%d_DB_arch_%s:%t:%p.dbf'
archivelog all delete input
;
delete noprompt obsolete;
}

released channel: ORA_DISK_1
allocated channel: d1
channel d1: sid=1075 devtype=DISK

Starting backup at 10-MAR-09
channel d1: starting incremental level 0 datafile backupset
channel d1: specifying datafile(s) in backupset
input datafile fno=00004 name=/oradb/oradata/RPTTRN/mes_s01.dbf
channel d1: starting piece 1 at 10-MAR-09
channel d1: finished piece 1 at 10-MAR-09
piece handle=/home/oracle/rman/RPTTRN_DB_FILE_120:681141565:1.dbf tag=TAG20090310T135925 comment=NON
E
channel d1: backup set complete, elapsed time: 00:00:07
channel d1: starting incremental level 0 datafile backupset
channel d1: specifying datafile(s) in backupset
input datafile fno=00005 name=/oradb/oradata/RPTTRN/mes_l01.dbf
channel d1: starting piece 1 at 10-MAR-09
channel d1: finished piece 1 at 10-MAR-09
piece handle=/home/oracle/rman/RPTTRN_DB_FILE_121:681141573:1.dbf tag=TAG20090310T135925 comment=NON
E
channel d1: backup set complete, elapsed time: 00:00:03
channel d1: starting incremental level 0 datafile backupset
channel d1: specifying datafile(s) in backupset
input datafile fno=00006 name=/oradb/oradata/RPTTRN/odw_s01.dbf
channel d1: starting piece 1 at 10-MAR-09
channel d1: finished piece 1 at 10-MAR-09
piece handle=/home/oracle/rman/RPTTRN_DB_FILE_122:681141576:1.dbf tag=TAG20090310T135925 comment=NON
E
channel d1: backup set complete, elapsed time: 00:00:01
channel d1: starting incremental level 0 datafile backupset
channel d1: specifying datafile(s) in backupset
input datafile fno=00007 name=/oradb/oradata/RPTTRN/odw_l01.dbf
channel d1: starting piece 1 at 10-MAR-09
channel d1: finished piece 1 at 10-MAR-09
piece handle=/home/oracle/rman/RPTTRN_DB_FILE_123:681141577:1.dbf tag=TAG20090310T135925 comment=NON
E
channel d1: backup set complete, elapsed time: 00:00:03
channel d1: starting incremental level 0 datafile backupset
channel d1: specifying datafile(s) in backupset
input datafile fno=00011 name=/oradb/oradata/RPTTRN/rpt_s01.dbf
channel d1: starting piece 1 at 10-MAR-09
channel d1: finished piece 1 at 10-MAR-09
piece handle=/home/oracle/rman/RPTTRN_DB_FILE_124:681141580:1.dbf tag=TAG20090310T135925 comment=NON
E
channel d1: backup set complete, elapsed time: 00:00:01
channel d1: starting incremental level 0 datafile backupset
channel d1: specifying datafile(s) in backupset
input datafile fno=00012 name=/oradb/oradata/RPTTRN/rpt_l01.dbf
channel d1: starting piece 1 at 10-MAR-09
channel d1: finished piece 1 at 10-MAR-09
piece handle=/home/oracle/rman/RPTTRN_DB_FILE_125:681141581:1.dbf tag=TAG20090310T135925 comment=NON
E
channel d1: backup set complete, elapsed time: 00:00:03
channel d1: starting incremental level 0 datafile backupset
channel d1: specifying datafile(s) in backupset
input datafile fno=00014 name=/oradb/oradata/RPTTRN/int_s01.dbf
channel d1: starting piece 1 at 10-MAR-09
channel d1: finished piece 1 at 10-MAR-09
piece handle=/home/oracle/rman/RPTTRN_DB_FILE_126:681141584:1.dbf tag=TAG20090310T135925 comment=NON
E
channel d1: backup set complete, elapsed time: 00:00:01
channel d1: starting incremental level 0 datafile backupset
channel d1: specifying datafile(s) in backupset
input datafile fno=00015 name=/oradb/oradata/RPTTRN/int_l01.dbf
channel d1: starting piece 1 at 10-MAR-09
channel d1: finished piece 1 at 10-MAR-09
piece handle=/home/oracle/rman/RPTTRN_DB_FILE_127:681141586:1.dbf tag=TAG20090310T135925 comment=NON
E
channel d1: backup set complete, elapsed time: 00:00:07
channel d1: starting incremental level 0 datafile backupset
channel d1: specifying datafile(s) in backupset
input datafile fno=00001 name=/oradb/oradata/RPTTRN/system01.dbf
channel d1: starting piece 1 at 10-MAR-09
channel d1: finished piece 1 at 10-MAR-09
piece handle=/home/oracle/rman/RPTTRN_DB_FILE_128:681141593:1.dbf tag=TAG20090310T135925 comment=NON
E
channel d1: backup set complete, elapsed time: 00:00:15
channel d1: starting incremental level 0 datafile backupset
channel d1: specifying datafile(s) in backupset
input datafile fno=00002 name=/oradb/oradata/RPTTRN/undotbs01.dbf
channel d1: starting piece 1 at 10-MAR-09
channel d1: finished piece 1 at 10-MAR-09
piece handle=/home/oracle/rman/RPTTRN_DB_FILE_129:681141608:1.dbf tag=TAG20090310T135925 comment=NON
E
channel d1: backup set complete, elapsed time: 00:00:03
channel d1: starting incremental level 0 datafile backupset
channel d1: specifying datafile(s) in backupset
input datafile fno=00013 name=/oradb/oradata/RPTTRN/bob01.dbf
channel d1: starting piece 1 at 10-MAR-09
channel d1: finished piece 1 at 10-MAR-09
piece handle=/home/oracle/rman/RPTTRN_DB_FILE_130:681141611:1.dbf tag=TAG20090310T135925 comment=NON
E
channel d1: backup set complete, elapsed time: 00:00:03
channel d1: starting incremental level 0 datafile backupset
channel d1: specifying datafile(s) in backupset
input datafile fno=00003 name=/oradb/oradata/RPTTRN/sysaux01.dbf
channel d1: starting piece 1 at 10-MAR-09
channel d1: finished piece 1 at 10-MAR-09
piece handle=/home/oracle/rman/RPTTRN_DB_FILE_131:681141614:1.dbf tag=TAG20090310T135925 comment=NON
E
channel d1: backup set complete, elapsed time: 00:00:07
channel d1: starting incremental level 0 datafile backupset
channel d1: specifying datafile(s) in backupset
input datafile fno=00009 name=/oradb/oradata/RPTTRN/strmadmin01.dbf
channel d1: starting piece 1 at 10-MAR-09
channel d1: finished piece 1 at 10-MAR-09
piece handle=/home/oracle/rman/RPTTRN_DB_FILE_132:681141621:1.dbf tag=TAG20090310T135925 comment=NON
E
channel d1: backup set complete, elapsed time: 00:00:01
channel d1: starting incremental level 0 datafile backupset
channel d1: specifying datafile(s) in backupset
input datafile fno=00008 name=/oradb/oradata/RPTTRN/log4plsql01.dbf
channel d1: starting piece 1 at 10-MAR-09
channel d1: finished piece 1 at 10-MAR-09
piece handle=/home/oracle/rman/RPTTRN_DB_FILE_133:681141623:1.dbf tag=TAG20090310T135925 comment=NON
E
channel d1: backup set complete, elapsed time: 00:00:01
channel d1: starting incremental level 0 datafile backupset
channel d1: specifying datafile(s) in backupset
input datafile fno=00010 name=/oradb/oradata/RPTTRN/xdb01.dbf
channel d1: starting piece 1 at 10-MAR-09
channel d1: finished piece 1 at 10-MAR-09
piece handle=/home/oracle/rman/RPTTRN_DB_FILE_134:681141624:1.dbf tag=TAG20090310T135925 comment=NON
E
channel d1: backup set complete, elapsed time: 00:00:03
channel d1: starting incremental level 0 datafile backupset
channel d1: specifying datafile(s) in backupset
including current control file in backupset
channel d1: starting piece 1 at 10-MAR-09
channel d1: finished piece 1 at 10-MAR-09
piece handle=/home/oracle/rman/RPTTRN_DB_FILE_135:681141627:1.dbf tag=TAG20090310T135925 comment=NON
E
channel d1: backup set complete, elapsed time: 00:00:01
Finished backup at 10-MAR-09

Starting Control File Autobackup at 10-MAR-09
piece handle=/opt/apps/oracle/product/10.2.0/dbs/c-860139398-20090310-01 comment=NONE
Finished Control File Autobackup at 10-MAR-09

sql statement: alter system archive log current

Starting backup at 10-MAR-09
current log archived
channel d1: starting archive log backupset
channel d1: specifying archive log(s) in backup set
input archive log thread=1 sequence=7 recid=41 stamp=679620297
channel d1: starting piece 1 at 10-MAR-09
channel d1: finished piece 1 at 10-MAR-09
piece handle=/home/oracle/rman/RPTTRN_DB_arch_137:681141635:1.dbf tag=TAG20090310T140035 comment=NON
E
channel d1: backup set complete, elapsed time: 00:00:08
channel d1: deleting archive log(s)
archive log filename=/oradb/oradata/RPTTRN/arch/RPTTRN_7_1_678536867.arc recid=41 stamp=679620297
channel d1: starting archive log backupset
channel d1: specifying archive log(s) in backup set
input archive log thread=1 sequence=8 recid=42 stamp=681141281
channel d1: starting piece 1 at 10-MAR-09
channel d1: finished piece 1 at 10-MAR-09
piece handle=/home/oracle/rman/RPTTRN_DB_arch_138:681141644:1.dbf tag=TAG20090310T140035 comment=NON
E
channel d1: backup set complete, elapsed time: 00:00:07
channel d1: deleting archive log(s)
archive log filename=/oradb/oradata/RPTTRN/arch/RPTTRN_8_1_678536867.arc recid=42 stamp=681141281
channel d1: starting archive log backupset
channel d1: specifying archive log(s) in backup set
input archive log thread=1 sequence=15 recid=49 stamp=681141633
channel d1: starting piece 1 at 10-MAR-09
channel d1: finished piece 1 at 10-MAR-09
piece handle=/home/oracle/rman/RPTTRN_DB_arch_139:681141652:1.dbf tag=TAG20090310T140035 comment=NON
E
channel d1: backup set complete, elapsed time: 00:00:02
channel d1: deleting archive log(s)
archive log filename=/oradb/oradata/RPTTRN/arch/RPTTRN_15_1_678536867.arc recid=49 stamp=681141633
channel d1: starting archive log backupset
channel d1: specifying archive log(s) in backup set
input archive log thread=1 sequence=9 recid=43 stamp=681141282
channel d1: starting piece 1 at 10-MAR-09
channel d1: finished piece 1 at 10-MAR-09
piece handle=/home/oracle/rman/RPTTRN_DB_arch_140:681141654:1.dbf tag=TAG20090310T140035 comment=NON
E
channel d1: backup set complete, elapsed time: 00:00:02
channel d1: deleting archive log(s)
archive log filename=/oradb/oradata/RPTTRN/arch/RPTTRN_9_1_678536867.arc recid=43 stamp=681141282
channel d1: starting archive log backupset
channel d1: specifying archive log(s) in backup set
input archive log thread=1 sequence=10 recid=44 stamp=681141442
channel d1: starting piece 1 at 10-MAR-09
channel d1: finished piece 1 at 10-MAR-09
piece handle=/home/oracle/rman/RPTTRN_DB_arch_141:681141656:1.dbf tag=TAG20090310T140035 comment=NON
E
channel d1: backup set complete, elapsed time: 00:00:02
channel d1: deleting archive log(s)
archive log filename=/oradb/oradata/RPTTRN/arch/RPTTRN_10_1_678536867.arc recid=44 stamp=681141442
channel d1: starting archive log backupset
channel d1: specifying archive log(s) in backup set
input archive log thread=1 sequence=11 recid=45 stamp=681141443
channel d1: starting piece 1 at 10-MAR-09
channel d1: finished piece 1 at 10-MAR-09
piece handle=/home/oracle/rman/RPTTRN_DB_arch_142:681141658:1.dbf tag=TAG20090310T140035 comment=NON
E
channel d1: backup set complete, elapsed time: 00:00:02
channel d1: deleting archive log(s)
archive log filename=/oradb/oradata/RPTTRN/arch/RPTTRN_11_1_678536867.arc recid=45 stamp=681141443
channel d1: starting archive log backupset
channel d1: specifying archive log(s) in backup set
input archive log thread=1 sequence=12 recid=46 stamp=681141444
channel d1: starting piece 1 at 10-MAR-09
channel d1: finished piece 1 at 10-MAR-09
piece handle=/home/oracle/rman/RPTTRN_DB_arch_143:681141661:1.dbf tag=TAG20090310T140035 comment=NON
E
channel d1: backup set complete, elapsed time: 00:00:01
channel d1: deleting archive log(s)
archive log filename=/oradb/oradata/RPTTRN/arch/RPTTRN_12_1_678536867.arc recid=46 stamp=681141444
channel d1: starting archive log backupset
channel d1: specifying archive log(s) in backup set
input archive log thread=1 sequence=13 recid=47 stamp=681141444
channel d1: starting piece 1 at 10-MAR-09
channel d1: finished piece 1 at 10-MAR-09
piece handle=/home/oracle/rman/RPTTRN_DB_arch_144:681141663:1.dbf tag=TAG20090310T140035 comment=NON
E
channel d1: backup set complete, elapsed time: 00:00:02
channel d1: deleting archive log(s)
archive log filename=/oradb/oradata/RPTTRN/arch/RPTTRN_13_1_678536867.arc recid=47 stamp=681141444
channel d1: starting archive log backupset
channel d1: specifying archive log(s) in backup set
input archive log thread=1 sequence=14 recid=48 stamp=681141445
channel d1: starting piece 1 at 10-MAR-09
channel d1: finished piece 1 at 10-MAR-09
piece handle=/home/oracle/rman/RPTTRN_DB_arch_145:681141665:1.dbf tag=TAG20090310T140035 comment=NON
E
channel d1: backup set complete, elapsed time: 00:00:02
channel d1: deleting archive log(s)
archive log filename=/oradb/oradata/RPTTRN/arch/RPTTRN_14_1_678536867.arc recid=48 stamp=681141445
channel d1: starting archive log backupset
channel d1: specifying archive log(s) in backup set
input archive log thread=1 sequence=16 recid=50 stamp=681141634
channel d1: starting piece 1 at 10-MAR-09
channel d1: finished piece 1 at 10-MAR-09
piece handle=/home/oracle/rman/RPTTRN_DB_arch_146:681141667:1.dbf tag=TAG20090310T140035 comment=NON
E
channel d1: backup set complete, elapsed time: 00:00:02
channel d1: deleting archive log(s)
archive log filename=/oradb/oradata/RPTTRN/arch/RPTTRN_16_1_678536867.arc recid=50 stamp=681141634
Finished backup at 10-MAR-09

Starting Control File Autobackup at 10-MAR-09
piece handle=/opt/apps/oracle/product/10.2.0/dbs/c-860139398-20090310-02 comment=NONE
Finished Control File Autobackup at 10-MAR-09

RMAN retention policy will be applied to the command
RMAN retention policy is set to recovery window of 6 days
Deleting the following obsolete backups and copies:
Type                 Key    Completion Time    Filename/Handle
-------------------- ------ ------------------ --------------------
Backup Set           163    11-FEB-09        
  Backup Piece       225    11-FEB-09          /opt/apps/oracle/product/10.2.0/dbs/c-860139398-20090
211-00
Backup Set           177    11-FEB-09        
  Backup Piece       226    11-FEB-09          /opt/apps/oracle/product/10.2.0/dbs/c-860139398-20090
211-01
Backup Set           194    11-FEB-09        
  Backup Piece       227    11-FEB-09          /opt/apps/oracle/product/10.2.0/dbs/c-860139398-20090
211-02
Backup Set           200    11-FEB-09        
  Backup Piece       228    11-FEB-09          /opt/apps/oracle/product/10.2.0/dbs/c-860139398-20090
211-03
Backup Set           217    11-FEB-09        
  Backup Piece       229    11-FEB-09          /opt/apps/oracle/product/10.2.0/dbs/c-860139398-20090
211-04
Backup Set           223    11-FEB-09        
  Backup Piece       230    11-FEB-09          /opt/apps/oracle/product/10.2.0/dbs/c-860139398-20090
211-05
deleted backup piece
backup piece handle=/opt/apps/oracle/product/10.2.0/dbs/c-860139398-20090211-00 recid=41 stamp=67853
2523
deleted backup piece
backup piece handle=/opt/apps/oracle/product/10.2.0/dbs/c-860139398-20090211-01 recid=55 stamp=67853
2624
deleted backup piece
backup piece handle=/opt/apps/oracle/product/10.2.0/dbs/c-860139398-20090211-02 recid=72 stamp=67853
3436
deleted backup piece
backup piece handle=/opt/apps/oracle/product/10.2.0/dbs/c-860139398-20090211-03 recid=78 stamp=67853
3452
deleted backup piece
backup piece handle=/opt/apps/oracle/product/10.2.0/dbs/c-860139398-20090211-04 recid=95 stamp=67853
3792
deleted backup piece
backup piece handle=/opt/apps/oracle/product/10.2.0/dbs/c-860139398-20090211-05 recid=101 stamp=6785
33806
Deleted 6 objects

released channel: d1

RMAN>


4. Copy full backup from szx032:/home/oracle/rman/ to szx031:/home/oracle/rman
   Copy initRPTTRN.ora Patameter from szx032 to same directory of SZX031
   Create same related directories on szx031:

   mkdir -p bdump cdump create pfile udump
   ... , and so on

5. Startup nomount (New RPTTRN ON SZX031)
[szx031]oracle:> export ORACLE_SID=RPTTRN
[szx031]oracle:> sqlplus /nolog

SQL*Plus: Release 10.2.0.3.0 - Production on Tue Mar 10 14:07:24 2009

Copyright (c) 1982, 2006, Oracle.  All Rights Reserved.

SQL> connect /as sysdba
Connected to an idle instance.
SQL> startup nomount;
ORACLE instance started.

Total System Global Area  838860800 bytes
Fixed Size                  2049128 bytes
Variable Size             746589080 bytes
Database Buffers           88080384 bytes
Redo Buffers                2142208 bytes
SQL>

6. Restore TRNRPT DB on SZX031 (Restore controlfile first)
RMAN> connect target /

connected to target database: RPTTRN (not mounted)

RMAN> connect catalog rmantrn/rmantrn@mesmig

connected to recovery catalog database

run {
allocate channel d1 type disk;
restore controlfile;
}

allocated channel: d1
channel d1: sid=1091 devtype=DISK

Starting restore at 10-MAR-09

channel d1: starting datafile backupset restore
channel d1: restoring control file
channel d1: reading from backup piece /opt/apps/oracle/product/10.2.0/dbs/c-8601
39398-20090310-02
ORA-19870: error reading backup piece /opt/apps/oracle/product/10.2.0/dbs/c-8601
39398-20090310-02
ORA-19505: failed to identify file "/opt/apps/oracle/product/10.2.0/dbs/c-860139
398-20090310-02"
ORA-27037: unable to obtain file status
HPUX-ia64 Error: 2: No such file or directory
Additional information: 3
failover to previous backup

channel d1: starting datafile backupset restore
channel d1: restoring control file
channel d1: reading from backup piece /opt/apps/oracle/product/10.2.0/dbs/c-8601
39398-20090310-01
ORA-19870: error reading backup piece /opt/apps/oracle/product/10.2.0/dbs/c-8601
39398-20090310-01
ORA-19505: failed to identify file "/opt/apps/oracle/product/10.2.0/dbs/c-860139
398-20090310-01"
ORA-27037: unable to obtain file status
HPUX-ia64 Error: 2: No such file or directory
Additional information: 3
failover to previous backup

channel d1: starting datafile backupset restore
channel d1: restoring control file
channel d1: reading from backup piece /home/oracle/rman/RPTTRN_DB_FILE_135:68114
1627:1.dbf
channel d1: restored backup piece 1
piece handle=/home/oracle/rman/RPTTRN_DB_FILE_135:681141627:1.dbf tag=TAG2009031
0T135925
channel d1: restore complete, elapsed time: 00:00:04
output filename=/oradb/oradata/RPTTRN/control01.ctl
output filename=/oradb/oradata/RPTTRN/control02.ctl
output filename=/oradb/oradata/RPTTRN/control03.ctl
Finished restore at 10-MAR-09
released channel: d1

RMAN>

Noted: the controlfiles were restored from backpiece.

7. Restore DB on szx031 (Database)

a. Restore archvielog first

RMAN>run {
2> allocate channel d1 type disk;
3> restore archivelog all;
4> }

allocated channel: d1
channel d1: sid=1091 devtype=DISK

Starting restore at 11-MAR-09

channel d1: starting archive log restore to default destination
channel d1: restoring archive log
archive log thread=1 sequence=28
channel d1: reading from backup piece /home/oracle/rman/RPTTRN_DB_arch_195:681207906:1.dbf
channel d1: restored backup piece 1
piece handle=/home/oracle/rman/RPTTRN_DB_arch_195:681207906:1.dbf tag=TAG20090311T082506
channel d1: restore complete, elapsed time: 00:00:07
channel d1: starting archive log restore to default destination
channel d1: restoring archive log
archive log thread=1 sequence=21
channel d1: reading from backup piece /home/oracle/rman/RPTTRN_DB_arch_196:681207911:1.dbf
channel d1: restored backup piece 1
piece handle=/home/oracle/rman/RPTTRN_DB_arch_196:681207911:1.dbf tag=TAG20090311T082506
channel d1: restore complete, elapsed time: 00:00:01
channel d1: starting archive log restore to default destination
channel d1: restoring archive log
archive log thread=1 sequence=23
channel d1: reading from backup piece /home/oracle/rman/RPTTRN_DB_arch_197:681207913:1.dbf
channel d1: restored backup piece 1
piece handle=/home/oracle/rman/RPTTRN_DB_arch_197:681207913:1.dbf tag=TAG20090311T082506
channel d1: restore complete, elapsed time: 00:00:01
channel d1: starting archive log restore to default destination
channel d1: restoring archive log
archive log thread=1 sequence=22
channel d1: reading from backup piece /home/oracle/rman/RPTTRN_DB_arch_198:681207915:1.dbf
channel d1: restored backup piece 1
piece handle=/home/oracle/rman/RPTTRN_DB_arch_198:681207915:1.dbf tag=TAG20090311T082506
channel d1: restore complete, elapsed time: 00:00:01
channel d1: starting archive log restore to default destination
channel d1: restoring archive log
archive log thread=1 sequence=24
channel d1: reading from backup piece /home/oracle/rman/RPTTRN_DB_arch_199:681207917:1.dbf
channel d1: restored backup piece 1
piece handle=/home/oracle/rman/RPTTRN_DB_arch_199:681207917:1.dbf tag=TAG20090311T082506
channel d1: restore complete, elapsed time: 00:00:02
channel d1: starting archive log restore to default destination
channel d1: restoring archive log
archive log thread=1 sequence=25
channel d1: reading from backup piece /home/oracle/rman/RPTTRN_DB_arch_200:681207919:1.dbf
channel d1: restored backup piece 1
piece handle=/home/oracle/rman/RPTTRN_DB_arch_200:681207919:1.dbf tag=TAG20090311T082506
channel d1: restore complete, elapsed time: 00:00:02
channel d1: starting archive log restore to default destination
channel d1: restoring archive log
archive log thread=1 sequence=26
channel d1: reading from backup piece /home/oracle/rman/RPTTRN_DB_arch_201:681207922:1.dbf
channel d1: restored backup piece 1
piece handle=/home/oracle/rman/RPTTRN_DB_arch_201:681207922:1.dbf tag=TAG20090311T082506
channel d1: restore complete, elapsed time: 00:00:03
channel d1: starting archive log restore to default destination
channel d1: restoring archive log
archive log thread=1 sequence=27
channel d1: reading from backup piece /home/oracle/rman/RPTTRN_DB_arch_202:681207924:1.dbf
channel d1: restored backup piece 1
piece handle=/home/oracle/rman/RPTTRN_DB_arch_202:681207924:1.dbf tag=TAG20090311T082506
channel d1: restore complete, elapsed time: 00:00:02
channel d1: starting archive log restore to default destination
channel d1: restoring archive log
archive log thread=1 sequence=29
channel d1: reading from backup piece /home/oracle/rman/RPTTRN_DB_arch_203:681207926:1.dbf
channel d1: restored backup piece 1
piece handle=/home/oracle/rman/RPTTRN_DB_arch_203:681207926:1.dbf tag=TAG20090311T082506
channel d1: restore complete, elapsed time: 00:00:02
channel d1: starting archive log restore to default destination
channel d1: restoring archive log
archive log thread=1 sequence=31
channel d1: reading from backup piece /home/oracle/rman/RPTTRN_DB_arch_205:681208467:1.dbf
channel d1: restored backup piece 1
piece handle=/home/oracle/rman/RPTTRN_DB_arch_205:681208467:1.dbf tag=TAG20090311T083427
channel d1: restore complete, elapsed time: 00:00:02
channel d1: starting archive log restore to default destination
channel d1: restoring archive log
archive log thread=1 sequence=30
channel d1: reading from backup piece /home/oracle/rman/RPTTRN_DB_arch_206:681208469:1.dbf
channel d1: restored backup piece 1
piece handle=/home/oracle/rman/RPTTRN_DB_arch_206:681208469:1.dbf tag=TAG20090311T083427
channel d1: restore complete, elapsed time: 00:00:02
channel d1: starting archive log restore to default destination
channel d1: restoring archive log
archive log thread=1 sequence=32
channel d1: reading from backup piece /home/oracle/rman/RPTTRN_DB_arch_207:681208472:1.dbf
channel d1: restored backup piece 1
piece handle=/home/oracle/rman/RPTTRN_DB_arch_207:681208472:1.dbf tag=TAG20090311T083427
channel d1: restore complete, elapsed time: 00:00:02
Finished restore at 11-MAR-09
released channel: d1

b. Restore DB

run {
allocate channel d1 type disk;
restore database;
switch datafile all;
}

allocated channel: d1
channel d1: sid=1091 devtype=DISK

Starting restore at 10-MAR-09

channel d1: starting datafile backupset restore
channel d1: specifying datafile(s) to restore from backup set
restoring datafile 00004 to /oradb/oradata/RPTTRN/mes_s01.dbf
channel d1: reading from backup piece /home/oracle/rman/RPTTRN_DB_FILE_120:68114
1565:1.dbf
channel d1: restored backup piece 1
piece handle=/home/oracle/rman/RPTTRN_DB_FILE_120:681141565:1.dbf tag=TAG2009031
0T135925
channel d1: restore complete, elapsed time: 00:03:55
channel d1: starting datafile backupset restore
channel d1: specifying datafile(s) to restore from backup set
restoring datafile 00005 to /oradb/oradata/RPTTRN/mes_l01.dbf
channel d1: reading from backup piece /home/oracle/rman/RPTTRN_DB_FILE_121:68114
1573:1.dbf
channel d1: restored backup piece 1
piece handle=/home/oracle/rman/RPTTRN_DB_FILE_121:681141573:1.dbf tag=TAG2009031
0T135925
channel d1: restore complete, elapsed time: 00:02:56
channel d1: starting datafile backupset restore
channel d1: specifying datafile(s) to restore from backup set
restoring datafile 00006 to /oradb/oradata/RPTTRN/odw_s01.dbf
channel d1: reading from backup piece /home/oracle/rman/RPTTRN_DB_FILE_122:68114
1576:1.dbf
channel d1: restored backup piece 1
piece handle=/home/oracle/rman/RPTTRN_DB_FILE_122:681141576:1.dbf tag=TAG2009031
0T135925
channel d1: restore complete, elapsed time: 00:02:55
channel d1: starting datafile backupset restore
channel d1: specifying datafile(s) to restore from backup set
restoring datafile 00007 to /oradb/oradata/RPTTRN/odw_l01.dbf
channel d1: reading from backup piece /home/oracle/rman/RPTTRN_DB_FILE_123:68114
1577:1.dbf
channel d1: restored backup piece 1
piece handle=/home/oracle/rman/RPTTRN_DB_FILE_123:681141577:1.dbf tag=TAG2009031
0T135925
channel d1: restore complete, elapsed time: 00:04:05
channel d1: starting datafile backupset restore
channel d1: specifying datafile(s) to restore from backup set
restoring datafile 00011 to /oradb/oradata/RPTTRN/rpt_s01.dbf
channel d1: reading from backup piece /home/oracle/rman/RPTTRN_DB_FILE_124:68114
1580:1.dbf
channel d1: restored backup piece 1
piece handle=/home/oracle/rman/RPTTRN_DB_FILE_124:681141580:1.dbf tag=TAG2009031
0T135925
channel d1: restore complete, elapsed time: 00:02:45
channel d1: starting datafile backupset restore
channel d1: specifying datafile(s) to restore from backup set
restoring datafile 00012 to /oradb/oradata/RPTTRN/rpt_l01.dbf
channel d1: reading from backup piece /home/oracle/rman/RPTTRN_DB_FILE_125:68114
1581:1.dbf
channel d1: restored backup piece 1
piece handle=/home/oracle/rman/RPTTRN_DB_FILE_125:681141581:1.dbf tag=TAG2009031
0T135925
channel d1: restore complete, elapsed time: 00:02:07
channel d1: starting datafile backupset restore
channel d1: specifying datafile(s) to restore from backup set
restoring datafile 00014 to /oradb/oradata/RPTTRN/int_s01.dbf
channel d1: reading from backup piece /home/oracle/rman/RPTTRN_DB_FILE_126:68114
1584:1.dbf
channel d1: restored backup piece 1
piece handle=/home/oracle/rman/RPTTRN_DB_FILE_126:681141584:1.dbf tag=TAG2009031
0T135925
channel d1: restore complete, elapsed time: 00:02:16
channel d1: starting datafile backupset restore
channel d1: specifying datafile(s) to restore from backup set
restoring datafile 00015 to /oradb/oradata/RPTTRN/int_l01.dbf
channel d1: reading from backup piece /home/oracle/rman/RPTTRN_DB_FILE_127:68114
1586:1.dbf
channel d1: restored backup piece 1
piece handle=/home/oracle/rman/RPTTRN_DB_FILE_127:681141586:1.dbf tag=TAG2009031
0T135925
channel d1: restore complete, elapsed time: 00:02:36
channel d1: starting datafile backupset restore
channel d1: specifying datafile(s) to restore from backup set
restoring datafile 00001 to /oradb/oradata/RPTTRN/system01.dbf
channel d1: reading from backup piece /home/oracle/rman/RPTTRN_DB_FILE_128:68114
1593:1.dbf
channel d1: restored backup piece 1
piece handle=/home/oracle/rman/RPTTRN_DB_FILE_128:681141593:1.dbf tag=TAG2009031
0T135925
channel d1: restore complete, elapsed time: 00:01:35
channel d1: starting datafile backupset restore
channel d1: specifying datafile(s) to restore from backup set
restoring datafile 00002 to /oradb/oradata/RPTTRN/undotbs01.dbf
channel d1: reading from backup piece /home/oracle/rman/RPTTRN_DB_FILE_129:68114
1608:1.dbf
channel d1: restored backup piece 1
piece handle=/home/oracle/rman/RPTTRN_DB_FILE_129:681141608:1.dbf tag=TAG2009031
0T135925
channel d1: restore complete, elapsed time: 00:02:06
channel d1: starting datafile backupset restore
channel d1: specifying datafile(s) to restore from backup set
restoring datafile 00013 to /oradb/oradata/RPTTRN/bob01.dbf
channel d1: reading from backup piece /home/oracle/rman/RPTTRN_DB_FILE_130:68114
1611:1.dbf
channel d1: restored backup piece 1
piece handle=/home/oracle/rman/RPTTRN_DB_FILE_130:681141611:1.dbf tag=TAG2009031
0T135925
channel d1: restore complete, elapsed time: 00:02:05
channel d1: starting datafile backupset restore
channel d1: specifying datafile(s) to restore from backup set
restoring datafile 00003 to /oradb/oradata/RPTTRN/sysaux01.dbf
channel d1: reading from backup piece /home/oracle/rman/RPTTRN_DB_FILE_131:68114
1614:1.dbf
channel d1: restored backup piece 1
piece handle=/home/oracle/rman/RPTTRN_DB_FILE_131:681141614:1.dbf tag=TAG2009031
0T135925
channel d1: restore complete, elapsed time: 00:00:56
channel d1: starting datafile backupset restore
channel d1: specifying datafile(s) to restore from backup set
restoring datafile 00009 to /oradb/oradata/RPTTRN/strmadmin01.dbf
channel d1: reading from backup piece /home/oracle/rman/RPTTRN_DB_FILE_132:68114
1621:1.dbf
channel d1: restored backup piece 1
piece handle=/home/oracle/rman/RPTTRN_DB_FILE_132:681141621:1.dbf tag=TAG2009031
0T135925
channel d1: restore complete, elapsed time: 00:00:56
channel d1: starting datafile backupset restore
channel d1: specifying datafile(s) to restore from backup set
restoring datafile 00008 to /oradb/oradata/RPTTRN/log4plsql01.dbf
channel d1: reading from backup piece /home/oracle/rman/RPTTRN_DB_FILE_133:68114
1623:1.dbf
channel d1: restored backup piece 1
piece handle=/home/oracle/rman/RPTTRN_DB_FILE_133:681141623:1.dbf tag=TAG2009031
0T135925
channel d1: restore complete, elapsed time: 00:00:26
channel d1: starting datafile backupset restore
channel d1: specifying datafile(s) to restore from backup set
restoring datafile 00010 to /oradb/oradata/RPTTRN/xdb01.dbf
channel d1: reading from backup piece /home/oracle/rman/RPTTRN_DB_FILE_134:68114
1624:1.dbf
channel d1: restored backup piece 1
piece handle=/home/oracle/rman/RPTTRN_DB_FILE_134:681141624:1.dbf tag=TAG2009031
0T135925
channel d1: restore complete, elapsed time: 00:00:26
Finished restore at 10-MAR-09

released channel: d1

RMAN>

8. Recover database on szx031
[szx031]oracle:>set ORACLE_SID=RPTTRN
[szx031]oracle:> sqlplus /nolog

SQL*Plus: Release 10.2.0.3.0 - Production on Tue Mar 10 14:49:03 2009

Copyright (c) 1982, 2006, Oracle.  All Rights Reserved.

SQL> connect /as sysdba
Connected.
SQL> alter database mount;

Database altered.

9. Recover database and open DB with resetlogs;

[szx031]oracle:> sqlplus /nolog

SQL*Plus: Release 10.2.0.3.0 - Production on Wed Mar 11 09:07:26 2009

Copyright (c) 1982, 2006, Oracle.  All Rights Reserved.

SQL> connect /as sysdba
Connected.
SQL> alter database mount;

Database altered.

SQL> recover database using backup controlfile until cancel;

ORA-00279: change 3375023 generated at 03/11/2009 08:23:52 needed for thread 1
ORA-00289: suggestion : /oradb/oradata/RPTTRN/arch/RPTTRN_28_1_678536867.arc
ORA-00280: change 3375023 for thread 1 is in sequence #28


Specify log: {=suggested | filename | AUTO | CANCEL}
auto
 
ORA-00279: change 3375087 generated at 03/11/2009 08:25:02 needed for thread 1
ORA-00289: suggestion : /oradb/oradata/RPTTRN/arch/RPTTRN_29_1_678536867.arc
ORA-00280: change 3375087 for thread 1 is in sequence #29
ORA-00278: log file '/oradb/oradata/RPTTRN/arch/RPTTRN_28_1_678536867.arc' no
longer needed for this recovery


ORA-00279: change 3375098 generated at 03/11/2009 08:25:05 needed for thread 1
ORA-00289: suggestion : /oradb/oradata/RPTTRN/arch/RPTTRN_30_1_678536867.arc
ORA-00280: change 3375098 for thread 1 is in sequence #30
ORA-00278: log file '/oradb/oradata/RPTTRN/arch/RPTTRN_29_1_678536867.arc' no
longer needed for this recovery


ORA-00279: change 3375114 generated at 03/11/2009 08:25:25 needed for thread 1
ORA-00289: suggestion : /oradb/oradata/RPTTRN/arch/RPTTRN_31_1_678536867.arc
ORA-00280: change 3375114 for thread 1 is in sequence #31
ORA-00278: log file '/oradb/oradata/RPTTRN/arch/RPTTRN_30_1_678536867.arc' no
longer needed for this recovery


ORA-00279: change 3375402 generated at 03/11/2009 08:34:25 needed for thread 1
ORA-00289: suggestion : /oradb/oradata/RPTTRN/arch/RPTTRN_32_1_678536867.arc
ORA-00280: change 3375402 for thread 1 is in sequence #32
ORA-00278: log file '/oradb/oradata/RPTTRN/arch/RPTTRN_31_1_678536867.arc' no
longer needed for this recovery


ORA-00279: change 3375414 generated at 03/11/2009 08:34:26 needed for thread 1
ORA-00289: suggestion : /oradb/oradata/RPTTRN/arch/RPTTRN_33_1_678536867.arc
ORA-00280: change 3375414 for thread 1 is in sequence #33
ORA-00278: log file '/oradb/oradata/RPTTRN/arch/RPTTRN_32_1_678536867.arc' no
longer needed for this recovery


ORA-00308: cannot open archived log
'/oradb/oradata/RPTTRN/arch/RPTTRN_33_1_678536867.arc'
ORA-27037: unable to obtain file status
HPUX-ia64 Error: 2: No such file or directory
Additional information: 3


SQL> alter database open ;
alter database open
*
ERROR at line 1:
ORA-01589: must use RESETLOGS or NORESETLOGS option for database open


SQL> alter database open resetlogs;

Database altered.


Noted:

I hitted below error during restoring archivelog,

RMAN-6025 : RMAN Requests Very Old Log Sequence Number for Recovery

Referred Doc ID:  238422.1, problem was fixed.

select fname, sequence#,archived, low_scn,next_scn
    from al
    where dbinc_key=(select dbinc_key from rc_database_incarnation
                     where name = 'RPTTRN'
                       and current_incarnation = 'YES');                      
                      
create table al_bk as select * from al;

truncate table al;

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/69934/viewspace-566743/,如需转载,请注明出处,否则将追究法律责任。

上一篇: 没有了~
请登录后发表评论 登录
全部评论

注册时间:2008-10-15

  • 博文量
    3
  • 访问量
    5449