rman异机恢复


1,原库rman备份,包括控制文件,密码文件,参数文件等

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';   

2,scp相关介质到备库,我这里直接使用nfs挂载,目录不变,为了恢复简单,尽量主备库使用相同的目录

3,创建相关目录

[oracle@dtydb5 ~]$ mkdir -p /oracle/app/oracle/admin/hrdbprim/adump
[oracle@dtydb5 ~]$ mkdir -p /oracle/app/oracle/oradata/hrdbprim/

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

5,备机上使用rman恢复控制文件


rman target /

RMAN>  restore controlfile from '/data/backup/HRDBPRIM_control_81_1_1_20120820.ctl';

6,数据库启动到mount状态
sys@HRDBPRIM(dtydb5)> alter database mount;

数据库已更改。

7,使用rman restore 数据库

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


8,recover 数据库
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:34
9,打开数据库
bei> alter database open RESETLOGS;
*
第 1 行出现错误:
ORA-01092: ORACLE instance terminated. Disconnection forced
ORA-18008: cannot find OUTLN schema
进程 ID: 29091
会话 ID: 225 序列号: 3

10,原因是outln用户被删除导致,使用metalink的文章进行了恢复
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



11,恢复完成,数据库正常打开了
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
数据库装载完毕。
数据库已经打开。


参考资料:
Unable To Start The Database With OUTLN Schema Dropped ORA-01092& ORA-18008 [ID 855104.1]
http://blog.csdn.net/tianlesoftware/article/details/6245209
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值