alter system switch log file; 多运行几次 rman target / run { allocate channel c1 type disk; allocate channel c2 type disk; backup database format '/data/backup/hrdbprim-%U' ; backup archivelog all delete all input format '/data/backup/ARC_%U'; } backup current controlfile format '/data/backup/%d_control_%s_%c_%p_%T.ctl';
4,启动数据库到nomount状态
hrdbprim> startup nomount pfile='/data/backup/initwj.ora'; ORACLE 例程已经启动。 Total System Global Area 1068937216 bytes Fixed Size 2233336 bytes Variable Size 364907528 bytes Database Buffers 692060160 bytes Redo Buffers 9736192 bytes
rman target / RMAN> restore controlfile from '/data/backup/HRDBPRIM_control_81_1_1_20120820.ctl';
RMAN> restore database; 启动 restore 于 2012-08-20 09:42:05 使用目标数据库控制文件替代恢复目录 分配的通道: ORA_DISK_1 通道 ORA_DISK_1: SID=249 设备类型=DISK 通道 ORA_DISK_1: 正在开始还原数据文件备份集 通道 ORA_DISK_1: 正在指定从备份集还原的数据文件 通道 ORA_DISK_1: 将数据文件 00002 还原到 /oracle/app/oracle/oradata/hrdbprim/sysaux01.dbf 通道 ORA_DISK_1: 将数据文件 00004 还原到 /oracle/app/oracle/oradata/hrdbprim/users01.dbf 通道 ORA_DISK_1: 正在读取备份片段 /data/backup/hrdbprim-28nj3tou_1_1 通道 ORA_DISK_1: 段句柄 = /data/backup/hrdbprim-28nj3tou_1_1 标记 = TAG20120820T092757 通道 ORA_DISK_1: 已还原备份片段 1 通道 ORA_DISK_1: 还原完成, 用时: 00:00:45 通道 ORA_DISK_1: 正在开始还原数据文件备份集 通道 ORA_DISK_1: 正在指定从备份集还原的数据文件 通道 ORA_DISK_1: 将数据文件 00001 还原到 /oracle/app/oracle/oradata/hrdbprim/system01.dbf 通道 ORA_DISK_1: 将数据文件 00003 还原到 /oracle/app/oracle/oradata/hrdbprim/undotbs01.dbf 通道 ORA_DISK_1: 正在读取备份片段 /data/backup/hrdbprim-27nj3tot_1_1 通道 ORA_DISK_1: 段句柄 = /data/backup/hrdbprim-27nj3tot_1_1 标记 = TAG20120820T092757 通道 ORA_DISK_1: 已还原备份片段 1 通道 ORA_DISK_1: 还原完成, 用时: 00:01:05 完成 restore 于 2012-08-20 09:43:57
RMAN> recover database until time '2012-08-20 09:40:00'; 启动 recover 于 2012-08-20 10:00:00 使用通道 ORA_DISK_1 RMAN-00571: =========================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== RMAN-00571: =========================================================== RMAN-03002: recover 命令 (在 08/20/2012 10:00:01 上) 失败 RMAN-20207: UNTIL TIME 或 RECOVERY WINDOW 在 RESETLOGS 时间之前 RMAN> list incarnation; 数据库原型列表 DB 关键字 Inc 关键字 DB 名 DB ID STATUS 重置 SCN 重置时间 ------- ------- -------- ---------------- --- ---------- ---------- 1 1 HRDBPRIM 4034584542 PARENT 1 2010-09-05 05:49:10 2 2 HRDBPRIM 4034584542 PARENT 972274 2012-08-02 09:38:42 3 3 HRDBPRIM 4034584542 CURRENT 3493546 2012-08-20 09:47:31 RMAN> recover database until time '2012-08-20 09:48:00'; 启动 recover 于 2012-08-20 10:14:32 使用通道 ORA_DISK_1 正在开始介质的恢复 线程 1 序列 120 的归档日志已作为文件 /oracle/app/oracle/oradata/hrdbprim/1_120_790249122.dbf 存在于磁盘上 线程 1 序列 121 的归档日志已作为文件 /oracle/app/oracle/oradata/hrdbprim/1_121_790249122.dbf 存在于磁盘上 归档日志文件名=/oracle/app/oracle/oradata/hrdbprim/1_120_790249122.dbf 线程=1 序列=120 归档日志文件名=/oracle/app/oracle/oradata/hrdbprim/1_121_790249122.dbf 线程=1 序列=121 介质恢复完成, 用时: 00:00:00 完成 recover 于 2012-08-20 10:14:349,打开数据库
bei> alter database open RESETLOGS; * 第 1 行出现错误: ORA-01092: ORACLE instance terminated. Disconnection forced ORA-18008: cannot find OUTLN schema 进程 ID: 29091 会话 ID: 225 序列号: 3
1-Restore the database to before dropping the outln schema. OR- 2-The following action can be done to workaround the situation, but please note that the following solution is not supported as dropping the outln schema is not a supported action in the first place: 1-startup mount: startup mount 2-run: alter system set replication_dependency_tracking =false scope=spfile; 3-Shutdown the database shutdown immediate 4-Startup the database in the upgrade mode. startup upgrade 5-Create the outln schema: the creation information can be extracted from : $OH/rdbms/admin/doptim.bsq 6-Run: alter system set replication_dependency_tracking =true scope=spfile; 7-shutdown the database shutdown immediate 8-startup the database startup
ORACLE 例程已经关闭。 1> startup ORACLE 例程已经启动。 Total System Global Area 1068937216 bytes Fixed Size 2233336 bytes Variable Size 369101832 bytes Database Buffers 687865856 bytes Redo Buffers 9736192 bytes 数据库装载完毕。 数据库已经打开。