1.把rman备份集及日志拷贝到目标机上相同目录2.讲目标数据库启动到nomount状态,SQL> startup nomount;
ORACLE instance started.
Total System Global Area 1241513984 bytes
Fixed Size 2065376 bytes
Variable Size 318770208 bytes
Database Buffers 905969664 bytes
Redo Buffers 14708736 bytes
SQL>
3.恢复控制文件,进入rman target/
restore controlfile from 'D:\RMANBACK\CTL_ORCL_20141212_18'
3.讲数据库启动到mount状态
RMAN> alter database mount;
database mounted
released channel: ORA_DISK_1
RMAN>
更改rman路径
catalog backuppiece 'D:\RMANBACK\DBFULL_ORCL_0DPQ064V_1_13.BAK';
catalog backuppiece 'D:\RMANBACK\DBFULL_ORCL_0EPQ064V_1_14.BAK';
catalog backuppiece 'D:\RMANBACK\DBFULL_ORCL_0FPQ0653_1_15.BAK';
catalog backuppiece 'D:\RMANBACK\DBFULL_ORCL_0GPQ066O_1_16.BAK';
catalog backuppiece 'D:\RMANBACK\DBFULL_ORCL_0HPQ066P_1_17.BAK';
4.在主库上执行sql
--再rman target/ 执行
run{
allocate channel c1 type disk;
allocate channel c2 type disk;
allocate channel c3 type disk;
release channel c1;
release channel c2;
release channel c3;
restore database;
switch datafile all;
}
--5.重新创建控制文件
--sql下执行,生成控制文件脚本
alter database backup controlfile to trace as 'd:\cont.trc';
--数据库启动到mount状态下执行:
CREATE CONTROLFILE REUSE DATABASE "ORCL" RESETLOGS ARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 100
MAXINSTANCES 8
MAXLOGHISTORY 292
LOGFILE
GROUP 1 'E:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\REDO01.LOG' SIZE 50M,
GROUP 2 'E:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\REDO02.LOG' SIZE 50M,
GROUP 3 'E:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\REDO03.LOG' SIZE 50M
-- STANDBY LOGFILE
DATAFILE
'E:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\SYSTEM01.DBF',
'E:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\UNDOTBS01.DBF',
'E:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\SYSAUX01.DBF',
'E:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\USERS01.DBF',
'E:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\ZLTOOLSTBS.DBF',
'E:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\ZL9BASEITEM.DBF',
'E:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\ZL9PATIENT.DBF',
'E:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\ZL9EXPENSE.DBF',
'E:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\ZL9MEDLST.DBF',
'E:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\ZL9DUEREC.DBF',
'E:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\ZL9CISREC.DBF',
'E:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\ZL9EPRLOB.DBF',
'E:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\ZL9EPRDAT.DBF',
'E:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\ZL9CISAUDIT.DBF',
'E:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\ZL9INDEXHIS.DBF',
'E:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\ZL9INDEXCIS.DBF',
'E:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\ZLBAKZLHIS.DBF'
CHARACTER SET ZHS16GBK
;
6.注册归档日志文件路径,mount状态下ramn target/
catalog start with 'D:\ARCHIVE'
7.介质恢复,mount状态下ramn target/
recover database
8.启动数据库
alter database open resetlogs;
9.增加临时表空间数据文件
alter tablespace temp add tempfile 'D:\oracle\product\10.2.0\oradata\orcl\temp02.dbf' size 4096M;
alter tablespace ZLTOOLSTMP add tempfile 'D:\oracle\product\10.2.0\oradata\orcl\zltooltemp01.dbf' size 4096M;