大家好,欢迎来到IT知识分享网。
ROSE HA切换节点导致DG失败、恢复:
由于ROSE HA每个节点单独使用spfile参数文件,节点切换后,导致DG失效,因此重新恢复DG,操作如下:
理论上直接修改新节点的参数文件,然后将归档日志copy至备库,应用即可,但是当发现切换后,手动执行rman整库备份,且备份归档日志后,清理了归档日志:
#!/bin/sh
dat=`date +%Y%m%d`
su – oracle <
export ORACLE_SID=XX
mkdir -p /home/oracle/rman_bak/$dat/archivelog
find /home/oracle/rman_bak/201* -mtime +7 -exec rm -fr {} \;
rman target / log ‘/home/oracle/rman_bak/rmanbak.log’
crosscheck backup;
delete expired backup;
yes
backup as compressed backupset database format “/home/oracle/rman_bak/$dat/data_%d_%U” INCLUDE CURRENT CONTROLFILE;
#backup as compressed backupset format “/home/oracle/rman_bak/$dat/archivelog/log_%U” archivelog all;
backup as compressed backupset format “/home/oracle/rman_bak/$dat/archivelog/log_%U” archivelog all delete all input;
#echo “/home/oracle/rmanbak/archivelog/${dat}/”;
exit;
EOF
echo $dat >>/home/oracle/rman_bak/rmanbak.log
最后实际操作如下:
创建备库控制文件(是不是不需要此步的,备库使用现有控制文件,难道不会出问题??使用后未发现问题,但有疑问):
#alter database create standby controlfile as‘/home/oracle/rman_bak/standbycontrol.ctl’;
将rman中的归档日志备份文件与控制文件copy至备库相应目录下(或在主库位置还原归档日志,将还原的归档日志copy至备库,然后重新注册:alter database register logfile‘路径’;);
# shutdown immediate备库,将现使用的控制文件替换为copy过来的控制文件;
查看备库最后的归档文件大小;
还原归档日志文件;
# rman target /
run{
set archivelog destination to ‘/home/oracle/app/arch/dgXX’;
restore archivelog from logseq 1630;–也可指定恢复的归档日志文件的范围from logseq 1630 until logseq 1730;
}
重启备库至mount状态,应用日志,发现正常。
以下内容转:
RMAN> restore archivelog all from ‘/u01/oracle/oradata/backup/AA_ARC_20060509_5_1.bak’;
Starting restore at 09-MAY-06
using channel ORA_DISK_1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 05/09/2006 14:06:22
RMAN-06509: only SPFILE or controlfile can be restored from autobackup
#百度的结果是,restore archivelog from这种语法,from backuppiece会报如上错,from tag没问题,但实测均不成功。
一.备份所有归档日志文件
RMAN> backup archivelog all delete input;
二: restore archivelog的各种选项
1.恢复全部归档日志文件
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;
7.从第五个日志开始恢复
RMAN> restore archivelog low logseq 5;
8.到第5个日志为止
RMAN> restore archivelog high logseq 5;
9.Rac下还原指定线程的日志
restore archivelog from logseq 1 until logseq 5 thread 1;
三:如果想改变恢复到另外路径下 则可用下面语句
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> }
免责声明:本站所有文章内容,图片,视频等均是来源于用户投稿和互联网及文摘转载整编而成,不代表本站观点,不承担相关法律责任。其著作权各归其原作者或其出版社所有。如发现本站有涉嫌抄袭侵权/违法违规的内容,侵犯到您的权益,请在线联系站长,一经查实,本站将立刻删除。 本文来自网络,若有侵权,请联系删除,如若转载,请注明出处:https://yundeesoft.com/16083.html