Backing up an Oracle Data Guard environment
Using the full backup previously taken at the standby, we perform a recovery of the tablespace
on the primary, using RMAN. For the restore, the tablespace needs to be offline.
oracle@oracle2[DG1]:/oradata/DG1$ cat restore_payroll.rcv
run {
allocate channel 'dev_0' type 'sbt_tape'
parms 'ENV=(OB2BARTYPE=Oracle8,OB2APPNAME=DG1,OB2BARLIST=Ora1_DG1_Online)';
sql 'alter tablespace payroll offline immediate ';
restore tablespace payroll;
recover tablespace payroll;
sql 'alter tablespace payroll online ';
}
oracle@oracle2[DG1]:/oradata/DG1$ rman target / catalog rman/xxx@rcat_oracle3
Recovery Manager: Release 10.1.0.3.0 - 64bit Production
Copyright (c) 1995, 2004, Oracle. All rights reserved.
connected to target database: DG1 (DBID=1531960840)
connected to recovery catalog database
RMAN> @restore_payroll.rcv
RMAN> run {
2> allocate channel 'dev_0' type 'sbt_tape'
3> parms 'ENV=(OB2BARTYPE=Oracle8,OB2APPNAME=DG1,OB2BARLIST=Ora1_DG1_Online)';
4> sql 'alter tablespace payroll offline immediate ';
5> restore tablespace payroll;
6> recover tablespace payroll;
7> sql 'alter tablespace payroll online ';
8> }
allocated channel: dev_0
channel dev_0: sid=107 devtype=SBT_TAPE
channel dev_0: Data Protector A.05.50/330
sql statement: alter tablespace payroll offline immediate
Starting restore at 2005-05-04
channel dev_0: starting datafile backupset restore
channel dev_0: specifying datafile(s) to restore from backup set
restoring datafile 00006 to /oradata/DG1/payroll01.dbf
[Normal] From: OB2BAR_Oracle8@oracle2 "DG1" Time: 05/04/05 09:07:23
Starting OB2BAR Restore: oracle1:Ora1_DG1_Online<DG1_428:557398844:1>.dbf "Oracle8"
[Normal] From: OB2BAR_Oracle8@oracle2 "DG1" Time: 05/04/05 09:08:25
Completed OB2BAR Restore: oracle1:Ora1_DG1_Online<DG1_428:557398844:1>.dbf "Oracle8"
channel dev_0: restored backup piece 1
piece handle=Ora1_DG1_Online<DG1_428:557398844:1>.dbf tag=TAG20050504T090043
channel dev_0: restore complete
Finished restore at 2005-05-04
Starting recover at 2005-05-04
starting media recovery
media recovery complete
Finished recover at 2005-05-04
sql statement: alter tablespace payroll online
released channel: dev_0
RMAN> **end-of-file**
23