温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

restore archivelog 的用法

发布时间:2020-08-13 10:14:09 来源:网络 阅读:19607 作者:omnipotent_X 栏目:大数据

1.备份所有归档日志文件

RMAN> backup archivelog all delete input;

第二: restore archivelog 的各种选项

0.根据rac线程restore archivelog from logseq 6160 thread 2;

1.restore archivelog all  恢复全部归档日志文件

RMAN> restore archivelog all;

2.只恢复 5到8这四个归档日志文件

RMAN> restore archivelog from logseq 5 until logseq 8;

3.恢复从第5个归档日志起

RMAN> restore archivelog from logseq 5;

4.恢复7天内的归档日志

RMAN> restore archivelog from time 'sysdate-7';

5. sequence between 写法

RMAN> restore archivelog sequence between 1 and 3;

6.恢复到哪个日志文件为止

RMAN> restore archivelog until logseq 3;

6.从第五个日志开始恢复

RMAN> restore archivelog low logseq 5;

7.到第5个日志为止

RMAN> restore archivelog high logseq 5;

如果想改变恢复到另外路径下 则可用下面语句

set archivelog destination to 'd:\backup';

RMAN> run
2> {allocate channel ci type disk;
3> set archivelog destination to 'd:\backup';
4> restore archivelog all;
5> release channel ci;
6> }


8.根据时间查看需要的备份集:

ERPDB1@/orabak>rman target /

RMAN> list backup of archivelog time between "to_date('2009-06-24 08:00:00','yyyy-mm-dd hh34:mi:ss')" and "to_date('2009-06-24 13:00','yyyy-mm-dd hh34:mi:ss')";

恢复指定时间段

RMAN> run {
2> set archivelog destination to '/orabak/testarch';
3> SQL 'ALTER SESSION SET NLS_DATE_FORMAT="YYYY-MM-DD:HH24:MI:SS"';
4> restore archivelog time between '2009-06-24 09:00:00' and '2009-06-24 12:10:00';
5> }


向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI