DG修复:异常关库导致的数据库启动失败ORA-01110及GAP修复
问题描述:环境是rac -> rac的DG环境,备库rac被crsctl stop cluster集群强制关库,重新启动之后导致数据库启动失败,报错如下:
Errors in file /u01/app/oracle/diag/rdbms/racdg/racdg1/trace/racdg1_ora_4339.trc: ORA-10458: standby database requires recovery ORA-01196: file 1 is inconsistent due to a failed media recovery session ORA-01110: data file 1: '+DATA/racdg/datafile/system.330.1090392901' ORA-10458 signalled during: ALTER DATABASE OPEN...
1.数据库异常关闭之后重新启动失败
2.报错日式备库需要重新恢复,启动到mount状态进行recover。查看此时备库的状态,有延时,mrp在应用1310401号归档
SQL> shutdown immediate; SQL> startup mount; SQL> recover managed standby database using current logfile disconnect from session;
--查看进程状态 select process, status, thread#,sequence#, block#, blocks from v$managed_standby; --查看延时信息 set linesize 300 col name for a20 col value for a20 col time_computed for a30 select name,value,unit,time_computed from v$dataguard_stats where name in ('transport lag','apply lag');
3.重新开启mrp进程,但是发现延时一直还在增加,mrp还在应用1310401归档,没有继续应用后面的归档。此时查看主备库的日志文件输出,无报错信息;主库切换状态发现GAP
--查看DG切换状态
select open_mode,protection_mode,database_role,switchover_status from v$database;
备库
主库
4.主库提示有GAP,所以就查看主备库之间的归档差哪些,然后手动传输;首先使用命令查询缺失的归档
--查看异常归档 select * from v$archive_gap;
但是这条命令执行失败,换条命令在备库中查询,查询结果多大一百多条记录,归档缺失较多
--查询备库未曾应用的归档有哪些
select name,sequence#,creator,archived,applied from v$archived_log where order by FIRST_TIME ; select name,sequence#,creator,archived,applied from v$archived_log where APPLIED='NO' order by FIRST_TIME ;
5.查看备库归档路径下1310401号归档的是否存在
归档路径中只有到1310400号归档,而此时mrp确实是在等待1310401号归档,所以需要手动传输到备库中
6.主库手动重传缺失的归档到备库中
主库是RAC,但是归档文件放在文件系统中;备库也是RAC,归档放在asm磁盘中。传输文件过程比较麻烦,此时备库同步的是主库thread2的归档,也就是需要去主库的节点二的归档路径下,去传输缺失
主库传输所需要的归档
[root@node2 archivelog]# scp archive_2_13104* root@192.168.251.7:/home/grid/arch [root@node2 archivelog]# scp archive_2_13105* root@192.168.251.7:/home/grid/arch
7.备库将归档文件传输到asm磁盘中,传输过程中最好进入到需要传输文件的路径下去传输文件
[grid@zjw-rac1 ~]$ cd arch/
[grid@zjw-rac1 arch]$
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310401_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310402_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310403_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310404_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310405_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310406_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310407_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310408_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310409_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310410_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310411_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310412_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310413_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310414_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310415_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310416_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310417_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310418_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310419_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310420_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310421_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310422_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310423_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310424_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310425_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310426_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310427_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310428_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310429_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310430_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310431_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310432_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310433_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310434_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310435_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310436_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310437_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310438_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310439_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310440_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310441_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310442_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310443_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310444_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310445_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310446_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310447_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310448_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310449_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310450_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310451_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310452_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310453_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310454_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310455_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310456_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310457_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310458_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310459_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310460_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310461_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310462_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310463_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310464_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310465_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310466_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310467_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310468_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310469_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310470_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310471_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310472_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310473_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310474_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310475_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310476_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310477_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310478_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310479_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310480_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310481_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310482_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310483_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310484_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310485_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310486_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310487_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310488_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310489_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310490_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310491_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310492_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310493_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310494_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310495_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310496_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310497_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310498_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310499_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310500_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310501_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310502_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310503_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310504_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310505_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310506_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310507_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310508_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310509_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310510_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310511_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310512_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310513_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310514_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310515_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310516_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310517_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310518_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310519_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310520_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310521_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310522_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310523_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310524_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310525_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310526_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310527_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310528_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310529_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310530_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310531_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310532_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310533_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310534_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310535_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310536_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310537_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310538_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310539_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310540_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310541_975591944.log +fra/racdg/archivelog/2021_12_24/
ASMCMD [+fra/racdg/archivelog/2021_12_24] > cp /home/grid/arch/archive_2_1310542_975591944.log +fra/racdg/archivelog/2021_12_24/
8.在数据库中注册传输过来的归档文件
alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310402_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310403_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310404_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310405_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310406_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310407_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310408_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310409_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310410_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310411_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310412_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310413_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310414_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310415_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310416_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310417_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310418_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310419_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310420_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310421_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310422_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310423_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310424_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310425_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310426_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310427_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310428_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310429_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310430_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310431_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310432_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310433_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310434_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310435_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310436_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310437_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310438_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310439_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310440_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310441_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310442_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310443_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310444_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310445_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310446_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310447_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310448_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310449_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310450_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310451_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310452_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310453_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310454_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310455_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310456_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310457_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310458_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310459_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310460_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310461_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310462_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310463_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310464_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310465_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310466_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310467_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310468_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310469_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310470_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310471_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310472_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310473_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310474_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310475_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310476_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310477_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310478_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310479_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310480_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310481_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310482_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310483_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310484_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310485_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310486_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310487_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310488_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310489_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310490_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310491_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310492_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310493_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310494_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310495_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310496_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310497_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310498_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310499_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310500_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310501_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310502_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310503_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310504_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310505_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310506_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310507_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310508_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310509_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310510_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310511_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310512_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310513_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310514_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310515_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310516_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310517_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310518_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310519_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310520_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310521_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310522_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310523_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310524_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310525_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310526_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310527_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310528_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310529_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310530_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310531_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310532_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310533_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310534_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310535_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310536_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310537_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310538_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310539_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310540_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310541_975591944.log'; alter database register logfile '+fra/racdg/archivelog/2021_12_24/archive_2_1310542_975591944.log';
注册过程中的alert日志变化
可以看到传输完,可以继续应用归档了
9.打开备库数据库
SQL> alter database recover managed standby database cancel; Database altered. SQL> alter database open; Database altered. SQL> SQL> alter database recover managed standby database using current logfile disconnect from session; Database altered.
10.打开数据库发现归档不会自动传输,查看主库此时alert日志,还是跟密码文件有关
------------------------------------------------------------ Fri Dec 24 20:05:18 2021 Immediate Kill Session#: 3809, Serial#: 25361 Immediate Kill Session: sess: 0x4042b45680 OS pid: 55698 Immediate Kill Session#: 4298, Serial#: 13353 Immediate Kill Session: sess: 0x4042c182e0 OS pid: 1181 Fri Dec 24 20:05:47 2021 Error 1017 received logging on to the standby ------------------------------------------------------------ Check that the primary and standby are using a password file and remote_login_passwordfile is set to SHARED or EXCLUSIVE, and that the SYS password is same in the password files. returning error ORA-16191 ------------------------------------------------------------ Fri Dec 24 20:06:48 2021 Error 1017 received logging on to the standby ------------------------------------------------------------ Check that the primary and standby are using a password file and remote_login_passwordfile is set to SHARED or EXCLUSIVE, and that the SYS password is same in the password files. returning error ORA-16191 ------------------------------------------------------------
11.重新传输主库节点一的密码文件到节点二和备库的节点一和节点二,重新实时应用
SQL> alter database recover managed standby database cancel; Database altered. SQL> SQL> SQL> alter database recover managed standby database using current logfile disconnect from session; Database altered. --查看备库的同步状态 SQL> select process, status, thread#,sequence#, block#, blocks from v$managed_standby; PROCESS STATUS THREAD# SEQUENCE# BLOCK# BLOCKS --------- ------------ ---------- ---------- ---------- ---------- ARCH CLOSING 1 1386815 32768 1440 ARCH CLOSING 1 1386816 32768 1384 ARCH CONNECTED 0 0 0 0 ARCH CLOSING 1 1386818 32768 1503 ARCH CLOSING 2 1310544 28672 1978 RFS IDLE 0 0 0 0 RFS IDLE 0 0 0 0 RFS IDLE 0 0 0 0 RFS IDLE 0 0 0 0 RFS IDLE 1 1386819 32659 1 MRP0 APPLYING_LOG 1 1386819 32657 102400 PROCESS STATUS THREAD# SEQUENCE# BLOCK# BLOCKS --------- ------------ ---------- ---------- ---------- ---------- RFS IDLE 0 0 0 0 RFS IDLE 0 0 0 0 RFS IDLE 0 0 0 0 RFS IDLE 2 1310545 16917 7 RFS IDLE 0 0 0 0 16 rows selected.
SQL> select open_mode,protection_mode,database_role,switchover_status from v$database;
OPEN_MODE PROTECTION_MODE DATABASE_ROLE SWITCHOVER_STATUS
-------------------- -------------------- ---------------- --------------------
READ ONLY WITH APPLY MAXIMUM PERFORMANCE PHYSICAL STANDBY NOT ALLOWED
--查看主库的状态 SQL> select open_mode,protection_mode,database_role,switchover_status from v$database; OPEN_MODE PROTECTION_MODE DATABASE_ROLE SWITCHOVER_STATUS -------------------- -------------------- ---------------- -------------------- READ WRITE MAXIMUM PERFORMANCE PRIMARY SESSIONS ACTIVE
12.到此GAP修复完成,可以在主库多切换几次归档测试同步效果