分类:
2010-04-13 16:44:30
HowTo Restore RMAN Disk backups of RAC Database to Single Instance On Another Node [ID 415579.1] | |||||
| |||||
修改时间 20-NOV-2007 类型 HOWTO 状态 MODERATED |
In this Document
This document is being delivered to you via Oracle Support's Rapid Visibility (RaV) process, and therefore has not been subject to an independent technical review. |
RMAN> run{
2> allocate channel c1 type disk format '/oracle/10g/backup/%U';
3> backup database;
4> backup archivelog all;
5> }
allocated channel: c1
channel c1: sid=133 instance=racdb1 devtype=DISK
Starting backup at 12-FEB-07
channel c1: starting full datafile backupset
channel c1: specifying datafile(s) in backupset
input datafile fno=00001 name=/ocfs2/oradata/racdb/system01.dbf
input datafile fno=00002 name=/ocfs2/oradata/racdb/undotbs01.dbf
input datafile fno=00005 name=/ocfs2/oradata/racdb/undotbs02.dbf
input datafile fno=00003 name=/ocfs2/oradata/racdb/sysaux01.dbf
input datafile fno=00004 name=/ocfs2/oradata/racdb/users01.dbf
channel c1: starting piece 1 at 12-FEB-07
channel c1: finished piece 1 at 12-FEB-07
piece handle=/oracle/10g/backup/09i9sruq_1_1 tag=TAG20070212T162458 comment=NONE
channel c1: backup set complete, elapsed time: 00:01:05
Finished backup at 12-FEB-07
Starting backup at 12-FEB-07
current log archived
channel c1: starting archive log backupset
channel c1: specifying archive log(s) in backup set
input archive log thread=1 sequence=56 recid=3 stamp=613417105
input archive log thread=1 sequence=57 recid=4 stamp=613417106
input archive log thread=1 sequence=58 recid=5 stamp=614363168
input archive log thread=2 sequence=1 recid=1 stamp=613417090
input archive log thread=2 sequence=2 recid=2 stamp=613417093
input archive log thread=2 sequence=3 recid=6 stamp=614363170
channel c1: starting piece 1 at 12-FEB-07
channel c1: finished piece 1 at 12-FEB-07
piece handle=/oracle/10g/backup/0ai9ss14_1_1 tag=TAG20070212T162610 comment=NONE
channel c1: backup set complete, elapsed time: 00:00:04
Finished backup at 12-FEB-07
Starting Control File and SPFILE Autobackup at 12-FEB-07
piece handle=/oracle/10g/backup/c-610677177-20070212-00 comment=NONE
Finished Control File and SPFILE Autobackup at 12-FEB-07
released channel: c1
oracle@test-br ractest]$ sqlplus "/ as sysdba"
SQL*Plus: Release 10.2.0.1.0 - Production on Fri Feb 16 03:14:23 2007
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup nomount;
ORACLE instance started.
Total System Global Area 167772160 bytes
Fixed Size 1218292 bytes
Variable Size 62916876 bytes
Database Buffers 96468992 bytes
Redo Buffers 7168000 bytes
[oracle@test-br ractest]$ rman target / nocatalog
Recovery Manager: Release 10.2.0.1.0 - Production on Fri Feb 16 03:16:31 2007
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to target database: racdb (not mounted)
using target database control file instead of recovery catalog
RMAN> restore controlfile from '/u01/oracle/oradata/ractest/c-610677177-20070212-00';
Starting restore at 16-FEB-07
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=156 devtype=DISK
channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:02
output filename=/u01/oracle/oradata/ractest/control01.ctl
Finished restore at 16-FEB-07
RMAN> alter database mount;
database mounted
released channel: ORA_DISK_1
RMAN> catalog backuppiece '/u01/oracle/oradata/ractest/09i9sruq_1_1';
cataloged backuppiece
backup piece handle=/u01/oracle/oradata/ractest/09i9sruq_1_1 recid=10 stamp=614661579
RMAN> catalog backuppiece '/u01/oracle/oradata/ractest/0ai9ss14_1_1';
cataloged backuppiece
backup piece handle=/u01/oracle/oradata/ractest/0ai9ss14_1_1 recid=11 stamp=614661599
RMAN> list backup of archivelog all;
List of Archived Logs in backup set 9
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- --------- ---------- ---------
1 56 214541 01-FEB-07 226238 01-FEB-07
1 57 226238 01-FEB-07 226240 01-FEB-07
1 58 226240 01-FEB-07 233107 12-FEB-07
2 1 186185 28-JAN-07 225714 01-FEB-07
2 2 225714 01-FEB-07 226037 01-FEB-07
2 3 226037 01-FEB-07 233110 12-FEB-07
RMAN> run {
2> set until sequence 59 thread 1;
3> set newname for datafile 1 to '/u01/oracle/oradata/ractest/data/system01.dbf';
4> set newname for datafile 2 to '/u01/oracle/oradata/ractest/data/undotbs01.dbf';
5> set newname for datafile 3 to '/u01/oracle/oradata/ractest/data/sysaux01.dbf';
6> set newname for datafile 4 to '/u01/oracle/oradata/ractest/data/users01.dbf';
7> set newname for datafile 5 to '/u01/oracle/oradata/ractest/data/undotbs02.dbf';
8> restore database;
9> switch datafile all;
10> recover database;
11> }
SQL> select member from v$logfile;
MEMBER
--------------------------------------------------------------------------------
/ocfs2/oradata/racdb/redo01.log
/ocfs2/oradata/racdb/redo02.log
/ocfs2/oradata/racdb/redo03.log
/ocfs2/oradata/racdb/redo04.log
/ocfs2/oradata/racdb/redo05.log
/ocfs2/oradata/racdb/redo06.log
6 rows selected.
SQL> alter database rename file '/ocfs2/oradata/racdb/redo01.log' to '/u01/oracle/oradata/ractest/log/redo01.log';
Database altered.
SQL> alter database rename file '/ocfs2/oradata/racdb/redo02.log' to '/u01/oracle/oradata/ractest/log/redo02.log';
Database altered.
SQL> alter database rename file '/ocfs2/oradata/racdb/redo03.log' to '/u01/oracle/oradata/ractest/log/redo03.log';
Database altered.
SQL> alter database rename file '/ocfs2/oradata/racdb/redo04.log' to '/u01/oracle/oradata/ractest/log/redo04.log';
Database altered.
SQL> alter database rename file '/ocfs2/oradata/racdb/redo05.log' to '/u01/oracle/oradata/ractest/log/redo05.log';
Database altered.
SQL> alter database rename file '/ocfs2/oradata/racdb/redo06.log' to '/u01/oracle/oradata/ractest/log/redo06.log';
Database altered.
SQL> alter database open resetlogs;
Database altered.
SQL> select THREAD#, STATUS, ENABLED
2 from v$thread;
THREAD# STATUS ENABLED
---------- ------ --------
1 OPEN PUBLIC
2 CLOSED PRIVATE
SQL> select group# from v$log where THREAD#=2;
GROUP#
----------
4
5
6
SQL> alter database disable thread 2;
Database altered.
SQL> alter database drop logfile group 4;
alter database drop logfile group 4
*
ERROR at line 1:
ORA-00350: log 4 of instance racdb2 (thread 2) needs to be archived
ORA-00312: online log 4 thread 2: '/u01/oracle/oradata/ractest/log/redo04.log'
SQL> alter database clear unarchived logfile group 4;
Database altered.
SQL> alter database drop logfile group 4;
Database altered.
SQL> alter database drop logfile group 5;
Database altered.
SQL> alter database drop logfile group 6;
Database altered.
SQL> select THREAD#, STATUS, ENABLED from v$thread;
THREAD# STATUS ENABLED
---------- ------ --------
1 OPEN PUBLIC
SQL> sho parameter undo;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
undo_management string AUTO
undo_retention integer 900
undo_tablespace string UNDOTBS1
SQL>
SQL>
SQL> select tablespace_name from dba_tablespaces where contents='UNDO';
TABLESPACE_NAME
------------------------------
UNDOTBS1
UNDOTBS2
SQL> drop tablespace UNDOTBS2 including contents and datafiles;
Tablespace dropped.
SQL> select name from v$tempfile;
NAME
--------------------------------------------------------------------------------
/ocfs2/oradata/racdb/temp01.dbf
SQL> select tablespace_name from dba_tablespaces where contents='TEMPORARY';
TABLESPACE_NAME
------------------------------
TEMP
SQL> create temporary tablespace TEMP1
2 tempfile '/u01/oracle/oradata/ractest/data/temp01.dbf'
3 size 50M;
Tablespace created.
SQL> alter database default temporary tablespace TEMP1;
Database altered.
SQL> drop tablespace TEMP including contents and datafiles;
Tablespace dropped.