说明:本文为Oracle RMAN带库备份恢复/带库全备恢复/带库0级备份恢复操作概要
温馨提示:如果您发现本文哪里写的有问题或者有更好的写法请留言或私信我进行修改优化
①带库备份
rman target / catalog rman/rman@RMAN
run
{
allocate channel zzt_disk01 type 'sbt_tape' parms 'ENV=(TDPO_OPTFILE=/usr/tivoli/tsm/client/oracle/bin/tdpo.opt)';
allocate channel zzt_disk02 type 'sbt_tape' parms 'ENV=(TDPO_OPTFILE=/usr/tivoli/tsm/client/oracle/bin/tdpo.opt)';
allocate channel zzt_disk03 type 'sbt_tape' parms 'ENV=(TDPO_OPTFILE=/usr/tivoli/tsm/client/oracle/bin/tdpo.opt)';
#数据文件
crosscheck backup;
delete noprompt expired backup;
backup
incremental level 0 as compressed backupset
filesperset 10
tag zzt_level_0_data
format 'zzt_level_0_data_%s_%p_%t.dbf'
database;
#归档文件(为了恢复需要,只需要备份最近1天的即可)
sql 'alter system archive log current';
sql 'alter system archive log current';
sql 'alter system archive log current';
crosscheck archivelog all;
delete noprompt expired archivelog all;
backup
as compressed backupset archivelog
from time 'sysdate-1'
delete input
tag zzt_level_0_arch
filesperset 50
format 'zzt_level_0_arch_%s_%p_%t.arc';
#控制文件
backup current controlfile tag zzt_level_0_cont
format 'zzt_level_0_cont_%s_%p_%t.ctl' ;
#参数文件
backup spfile tag zzt_level_0_spfi
format 'zzt_level_0_spfi_%s_%p_%t.spf' ;
release channel zzt_disk01;
release channel zzt_disk02;
release channel zzt_disk03;
}
②带库恢复
rman target / catalog rman/rman@RMAN
run
{
allocate channel zzt_disk01 type 'sbt_tape' parms 'ENV=(TDPO_OPTFILE=/usr/tivoli/tsm/client/oracle/bin64/tdpo.opt)';
allocate channel zzt_disk02 type 'sbt_tape' parms 'ENV=(TDPO_OPTFILE=/usr/tivoli/tsm/client/oracle/bin64/tdpo.opt)';
allocate channel zzt_disk03 type 'sbt_tape' parms 'ENV=(TDPO_OPTFILE=/usr/tivoli/tsm/client/oracle/bin64/tdpo.opt)';
crosscheck backup;
crosscheck archivelog all;
restore spfile;
restore controlfile;
resotre database;
recover database;
release channel zzt_disk01;
release channel zzt_disk02;
release channel zzt_disk03;
}
※ 如果您觉得文章写的还不错, 别忘了在文末给作者点个赞哦 ~
over
今天的文章oracle备份和恢复命令_oracle备份和恢复命令[通俗易懂]分享到此就结束了,感谢您的阅读。
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
如需转载请保留出处:https://bianchenghao.cn/85620.html