oracle备份归档文件,如何从指定备份片文件恢复归档??

declare

devtype varchar2(256);

done boolean;

begin

devtype:=sys.dbms_backup_restore.deviceAllocate(type=>'',ident=>'t1');

sys.dbms_backup_restore.restoreSetArchivedLog(destination=>'/data/oracle');

sys.dbms_backup_restore.restoreArchivedLog(thread=>1,sequence=>1859);

sys.dbms_backup_restore.restoreBackupPiece(done=>done,handle=>'/data/oracle/orcl/arc_ORCL_gus0emff_1_1_20170330_4638',params=>null);

sys.dbms_backup_restore.deviceDeallocate;

end;

意我们修改的地方是:destination=>'/archivelog02指定恢复出来归档日志的存放系统目录位置,thread表示rac的thread号,sequence为需要恢复的那个归档日志序列号,handle表示备份集的绝对路径。 修改完毕后,直接在sqlplus命令窗口执行即可。

--这是rman中还记录归档日志的信息

RMAN> run {

2> set archivelog destination to '/data/oracle';

3> restore archivelog sequence 1868;

4> }

executing command: SET ARCHIVELOG DESTINATION

Starting restore at 31-MAR-17

using channel ORA_DISK_1

using channel ORA_DISK_2

using channel ORA_DISK_3

using channel ORA_DISK_4

archived log for thread 1 with sequence 1868 is already on disk as file /data/oracle/orcl/arch/1_1868_930687580.dbf

restore not done; all files read only, offline, or already restored

Finished restore at 31-MAR-17

RMAN> run {

2> set archivelog destination to '/data/oracle';

3> restore archivelog sequence 1868;

4> }

executing command: SET ARCHIVELOG DESTINATION

Starting restore at 31-MAR-17

using channel ORA_DISK_1

using channel ORA_DISK_2

using channel ORA_DISK_3

using channel ORA_DISK_4

channel ORA_DISK_1: starting archived log restore to user-specified destination

archived log destination=/data/oracle

channel ORA_DISK_1: restoring archived log

archived log thread=1 sequence=1868

channel ORA_DISK_1: reading from backup piece /data/oracle/orcl/arc_h6s0h0f3_1_1

channel ORA_DISK_1: piece handle=/data/oracle/orcl/arc_h6s0h0f3_1_1 tag=TAG20170331T134708

channel ORA_DISK_1: restored backup piece 1

channel ORA_DISK_1: restore complete, elapsed time: 00:00:01

Finished restore at 31-MAR-17

RMAN>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值