1.创建单实例pfile文件,对应db_name参数,dbs下对应sid
11.建立临时表空间
create temporary tablespace temp tempfile 'xxxxxx' size 512m;
*.audit_file_dest='/u01/app/oracle/admin/cn100db/adump'
*.audit_trail='db'
*.compatible='11.2.0.0.0'
*.control_files='/u01/app/oracle/oradata/cn100db/control01.ctl'
*.db_block_size=8192
*.db_domain=''
*.db_name='cn100db'
*.db_recovery_file_dest='/u01/app/oracle/recovery_area'
*.db_recovery_file_dest_size=4070572032
*.diagnostic_dest='/u01/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=cn100dbXDB)'
*.log_archive_dest_1='location=/u01/app/oracle/archlog'
*.memory_target=8206107648
*.open_cursors=300
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.undo_tablespace='UNDOTBS1'
*.audit_trail='db'
*.compatible='11.2.0.0.0'
*.control_files='/u01/app/oracle/oradata/cn100db/control01.ctl'
*.db_block_size=8192
*.db_domain=''
*.db_name='cn100db'
*.db_recovery_file_dest='/u01/app/oracle/recovery_area'
*.db_recovery_file_dest_size=4070572032
*.diagnostic_dest='/u01/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=cn100dbXDB)'
*.log_archive_dest_1='location=/u01/app/oracle/archlog'
*.memory_target=8206107648
*.open_cursors=300
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.undo_tablespace='UNDOTBS1'
2.启动到nomout
SQL> startup nomout
SQL> startup nomout
3.将rac的rman备份数据库与每个节点的归档日子,拷贝到单实例
scp xxxx xxxxxx
scp xxxx xxxxxx
4.恢复controlfile文件从备份中
RMAN> restore controfile from '/backjup/xxxx';
RMAN> restore controfile from '/backjup/xxxx';
5.启动到mount,查看控制文件中备份
SQL> alter datbase mount;
RMAN> list backupset;
SQL> alter datbase mount;
RMAN> list backupset;
6.还原数据文件,并rename到新目录
RMAN>
run{
set newname for datafile 1 to '/u01/app/oracle/oradata/system01.dbf';
set newname for datafile 2 to '/u01/app/oracle/oradata/sysaux01.dbf';
set newname for datafile 3 to '/u01/app/oracle/oradata/undotbs01.dbf';
set newname for datafile 4 to '/u01/app/oracle/oradata/users01.dbf';
set newname for datafile 5 to '/u01/app/oracle/oradata/undotbs02.dbf';
set newname for datafile 6 to '/u01/app/oracle/oradata/lunar.274.796133339';
set newname for datafile 7 to '/u01/app/oracle/oradata/space_data_order_01_01.dbf';
set newname for datafile 8 to '/u01/app/oracle/oradata/space_data_order_02_01.dbf';
set newname for datafile 9 to '/u01/app/oracle/oradata/space_data_order_03_01.dbf';
set newname for datafile 10 to '/u01/app/oracle/oradata/system02.dbf';
set newname for datafile 11 to '/u01/app/oracle/oradata/sysaux02.dbf';
restore database;
switch datafile all;
}
RMAN>
run{
set newname for datafile 1 to '/u01/app/oracle/oradata/system01.dbf';
set newname for datafile 2 to '/u01/app/oracle/oradata/sysaux01.dbf';
set newname for datafile 3 to '/u01/app/oracle/oradata/undotbs01.dbf';
set newname for datafile 4 to '/u01/app/oracle/oradata/users01.dbf';
set newname for datafile 5 to '/u01/app/oracle/oradata/undotbs02.dbf';
set newname for datafile 6 to '/u01/app/oracle/oradata/lunar.274.796133339';
set newname for datafile 7 to '/u01/app/oracle/oradata/space_data_order_01_01.dbf';
set newname for datafile 8 to '/u01/app/oracle/oradata/space_data_order_02_01.dbf';
set newname for datafile 9 to '/u01/app/oracle/oradata/space_data_order_03_01.dbf';
set newname for datafile 10 to '/u01/app/oracle/oradata/system02.dbf';
set newname for datafile 11 to '/u01/app/oracle/oradata/sysaux02.dbf';
restore database;
switch datafile all;
}
7.还原归档,对应list backupset的sequence及thread
RMAN>
run
{allocate channel c1 type disk;
set archivelog destination to '/u01/app/oracle';
restore archivelog sequence between 225 and 226 thread 1;
allocate channel c2 type disk;
set archivelog destination to '/u01/app/oracle';
restore archivelog sequence between 164 and 165 thread=2;
release channel c1;
release channel c2;
}
RMAN>
run
{allocate channel c1 type disk;
set archivelog destination to '/u01/app/oracle';
restore archivelog sequence between 225 and 226 thread 1;
allocate channel c2 type disk;
set archivelog destination to '/u01/app/oracle';
restore archivelog sequence between 164 and 165 thread=2;
release channel c1;
release channel c2;
}
8.恢复到最新归档
SQL> recover database until cancel;
SQL> recover database until cancel;
9.由于rac环境的redolog在asm中,需要重建controlfile重定向redolog文件路径.
SQL> alter database backup controlfile to trace;
SQL> shutdown immediate
SQL> alter database backup controlfile to trace;
SQL> shutdown immediate
10.查找controlfile trace 修改redolog对应位置
STARTUP NOMOUNT
CREATE CONTROLFILE REUSE DATABASE "CN100DB" RESETLOGS ARCHIVELOG
MAXLOGFILES 192
MAXLOGMEMBERS 3
MAXDATAFILES 1024
MAXINSTANCES 32
MAXLOGHISTORY 292
LOGFILE
GROUP 1 '/u01/app/oracle/oradata/redo01.log' SIZE 100M BLOCKSIZE 512,
GROUP 2 '/u01/app/oracle/oradata/redo02.log' SIZE 100M BLOCKSIZE 512,
GROUP 5 '/u01/app/oracle/oradata/redo03.log' SIZE 300M BLOCKSIZE 512,
GROUP 6 '/u01/app/oracle/oradata/redo04.log' SIZE 100M BLOCKSIZE 512
DATAFILE
'/u01/app/oracle/oradata/system01.dbf',
'/u01/app/oracle/oradata/sysaux01.dbf',
'/u01/app/oracle/oradata/undotbs01.dbf',
'/u01/app/oracle/oradata/users01.dbf',
'/u01/app/oracle/oradata/undotbs02.dbf',
'/u01/app/oracle/oradata/lunar.274.796133339',
'/u01/app/oracle/oradata/space_data_order_01_01.dbf',
'/u01/app/oracle/oradata/space_data_order_02_01.dbf',
'/u01/app/oracle/oradata/space_data_order_03_01.dbf',
'/u01/app/oracle/oradata/space_data_order_04_01.dbf',
'/u01/app/oracle/oradata/system02.dbf',
'/u01/app/oracle/oradata/sysaux02.dbf'
CHARACTER SET ZHS16GBK
;
CREATE CONTROLFILE REUSE DATABASE "CN100DB" RESETLOGS ARCHIVELOG
MAXLOGFILES 192
MAXLOGMEMBERS 3
MAXDATAFILES 1024
MAXINSTANCES 32
MAXLOGHISTORY 292
LOGFILE
GROUP 1 '/u01/app/oracle/oradata/redo01.log' SIZE 100M BLOCKSIZE 512,
GROUP 2 '/u01/app/oracle/oradata/redo02.log' SIZE 100M BLOCKSIZE 512,
GROUP 5 '/u01/app/oracle/oradata/redo03.log' SIZE 300M BLOCKSIZE 512,
GROUP 6 '/u01/app/oracle/oradata/redo04.log' SIZE 100M BLOCKSIZE 512
DATAFILE
'/u01/app/oracle/oradata/system01.dbf',
'/u01/app/oracle/oradata/sysaux01.dbf',
'/u01/app/oracle/oradata/undotbs01.dbf',
'/u01/app/oracle/oradata/users01.dbf',
'/u01/app/oracle/oradata/undotbs02.dbf',
'/u01/app/oracle/oradata/lunar.274.796133339',
'/u01/app/oracle/oradata/space_data_order_01_01.dbf',
'/u01/app/oracle/oradata/space_data_order_02_01.dbf',
'/u01/app/oracle/oradata/space_data_order_03_01.dbf',
'/u01/app/oracle/oradata/space_data_order_04_01.dbf',
'/u01/app/oracle/oradata/system02.dbf',
'/u01/app/oracle/oradata/sysaux02.dbf'
CHARACTER SET ZHS16GBK
;
-- Database can now be opened zeroing the online logs.
ALTER DATABASE OPEN RESETLOGS;
ALTER DATABASE OPEN RESETLOGS;
11.建立临时表空间
create temporary tablespace temp tempfile 'xxxxxx' size 512m;
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/22990797/viewspace-749970/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/22990797/viewspace-749970/