小言_互联网的博客

ORA-00349|激活 ADG 备库时遇到的问题

661人阅读  评论(0)

作者 | JiekeXu

来源 | JiekeXu DBA之路(ID: JiekeXu_IT)

大家好,我是 JiekeXu,很高兴又和大家见面了,今天和大家聊聊 激活 ADG 备库时遇到的问题,欢迎点击上方蓝字关注我,标星或置顶,更多干货第一时间到达!

近日有一套实时同步的 ASM 管理的单机 11204 ADG 备库,由于业务需要,想要脱离主库的约束,想激活拉成读写库直接升级成 ASM 管理的 19C,闪回快照模式无法满足要求,只能 ALTER DATABASE ACTIVATE STANDBY DATABASE 强制切成可读写的主库。说干就干,先将其切成主库,升级过程等下次在一起讨论。


   
  1. --主库
  2. --主库设置为 defer, 取消备库日志应用,关库启动到 mount 状态进行。
  3. show parameter log_archive_dest_state_2
  4. alter system set log_archive_dest_state_2= defer scope=both sid= '*';
  5. --备库
  6. alter database recover managed standby database cancel;
  7. shu immediate
  8. startup mount
  9. --强制拉成主库,很遗憾报错 ORA -00349
  10. SQL> ALTER DATABASE ACTIVATE STANDBY DATABASE;
  11. ALTER DATABASE ACTIVATE STANDBY DATABASE
  12. *
  13. ERROR at line 1:
  14. ORA -00349: failure obtaining block size for '+JIEKE_DATA'
  15. ORA -15001: diskgroup "JIEKE_DATA" does not exist or is not mounted
  16. ORA -15001: diskgroup "JIEKE_DATA" does not exist or is not mounted

使用 ACTIVATE 命令想强制拉成主库,很遗憾如下图报错 ORA-00349。alert 日志中发现有很多清理 redo log 的报错,“ORA-00313: open failed…”无法打开日志组 5、6、23,于是查看日志组成员确实发现 redolog 创建的有问题,member 成员显示的为不存在的磁盘组 “+JIEKE_DATA” 而不是具体路径,真是存在的磁盘组“+JIEKER_DATA”。这就是问题所在,redolog 创建错误,切成主库时 redolog 又是必须的,故报错了,那么现在就是将这个错误的 redolog 重建,问题就会得到解决。但实际上不是这样的,折腾了好久也没解决,继续往下看。


   
  1. GROUP# Member
  2. ---------- ---------------------------------------------------------------------------------------------------
  3. 5 +JIEKE_DATA
  4. 5 +JIEKE_DATA
  5. 6 +JIEKE_DATA
  6. 6 +JIEKE_DATA
  7. 23 +JIEKE_DATA
  8. 23 +JIEKE_DATA
  9. 11 +JIEKER_DATA/jiekexu/onlinelog/group_11 .1621 .1065127343
  10. 11 +JIEKER_ARCH/jiekexu/onlinelog/group_11 .389 .1065127355
  11. 12 +JIEKER_DATA/jiekexu/onlinelog/group_12 .1620 .1065127363
  12. 12 +JIEKER_ARCH/jiekexu/onlinelog/group_12 .395 .1065127371
  13. 13 +JIEKER_DATA/jiekexu/onlinelog/group_13 .1619 .1065127381
  14. SELECT to_char(f.group#) groupno, to_char(l.thread#) thread, f.member member, f. type redo_file_type, l.status group_status, f.status member_status, l.bytes/ 1024/ 1024 bytes, l.archived archived
  15. FROM v$logfile f, v$log l WHERE f.group# = l.grSQL> oup# ORDER BY f.group#, f.member;
  16. SQL> SQL> SQL> SQL> SQL> SQL> SQL> SQL> SQL> 2
  17. Group Thread Member Redo Type Group Status Member Status Size(M) Archived
  18. ------ ------ -------------------- ---------- ------------ --------------- -------- ----------
  19. 5 1 +JIEKE_DATA ONLINE CLEARING INVALID 4, 096 YES
  20. 1 +JIEKE_DATA ONLINE CLEARING INVALID 4, 096 YES
  21. 6 2 +JIEKE_DATA ONLINE CLEARING INVALID 4, 096 YES
  22. 2 +JIEKE_DATA ONLINE CLEARING INVALID 4, 096 YES
  23. 23 1 +JIEKE_DATA ONLINE CLEARING_CUR INVALID 4, 096 YES
  24. RENT
  25. 1 +JIEKE_DATA ONLINE CLEARING_CUR INVALID 4, 096 YES
  26. RENT
  27. 27 2 +JIEKER_DATA/jiekexu/ ONLINE UNUSED 4, 096 YES
  28. onlinelog/group_27 .1
  29. 741.1065129955
  30. 28 2 +JIEKER_DATA/jiekexu/ ONLINE UNUSED 4, 096 YES
  31. onlinelog/group_28 .1
  32. 742.1065129973

alert 日志如下:


   
  1. Errors in file /app/oracle/diag/rdbms/jiekexu/jiekexu/trace/jiekexu_ora_30872.trc:
  2. ORA -00313: open failed for members of log group 5 of thread 1
  3. Clearing online redo logfile 5 +JIEKE_DATA
  4. Clearing online log 5 of thread 1 sequence number 4751
  5. Errors in file /app/oracle/diag/rdbms/jiekexu/jiekexu/trace/jiekexu_ora_30872.trc:
  6. ORA -00313: open failed for members of log group 5 of thread 1
  7. Errors in file /app/oracle/diag/rdbms/jiekexu/jiekexu/trace/jiekexu_ora_30872.trc:
  8. ORA -00313: open failed for members of log group 5 of thread 1
  9. Clearing online redo logfile 5 complete
  10. Errors in file /app/oracle/diag/rdbms/jiekexu/jiekexu/trace/jiekexu_ora_30872.trc:
  11. ORA -00313: open failed for members of log group 6 of thread 2
  12. Clearing online redo logfile 6 +JIEKE_DATA
  13. Clearing online log 6 of thread 2 sequence number 2592
  14. Errors in file /app/oracle/diag/rdbms/jiekexu/jiekexu/trace/jiekexu_ora_30872.trc:
  15. ORA -00313: open failed for members of log group 6 of thread 2
  16. Errors in file /app/oracle/diag/rdbms/jiekexu/jiekexu/trace/jiekexu_ora_30872.trc:
  17. ORA -00313: open failed for members of log group 6 of thread 2
  18. Clearing online redo logfile 6 complete
  19. Errors in file /app/oracle/diag/rdbms/jiekexu/jiekexu/trace/jiekexu_ora_30872.trc:
  20. ORA -00313: open failed for members of log group 23 of thread 1
  21. Clearing online redo logfile 23 +JIEKE_DATA
  22. Clearing online log 23 of thread 1 sequence number 4752
  23. Errors in file /app/oracle/diag/rdbms/jiekexu/jiekexu/trace/jiekexu_ora_30872.trc:
  24. ORA -00313: open failed for members of log group 23 of thread 1
  25. Errors in file /app/oracle/diag/rdbms/jiekexu/jiekexu/trace/jiekexu_ora_30872.trc:
  26. ORA -00313: open failed for members of log group 23 of thread 1
  27. Clearing online redo logfile 23 complete
  28. Resetting resetlogs activation ID 2008461997 ( 0x77b6b2ad)
  29. Errors in file /app/oracle/diag/rdbms/jiekexu/jiekexu/trace/jiekexu_ora_30872.trc:
  30. ORA -00313: open failed for members of log group 5 of thread 1
  31. Errors in file /app/oracle/diag/rdbms/jiekexu/jiekexu/trace/jiekexu_ora_30872.trc:
  32. ORA -00313: open failed for members of log group 5 of thread 1
  33. ORA -349 signalled during: ALTER DATABASE ACTIVATE PHYSICAL STANDBY DATABASE...
  34. Tue Mar 02 22: 42: 30 2021
  35. alter database drop logfile group 23
  36. ORA -1623 signalled during: alter database drop logfile group 23...
  37. Tue Mar 02 22: 45: 07 2021
  38. RFS[ 7]: Assigned to RFS process 10180
  39. RFS[ 7]: Opened log for thread 2 sequence 2592 dbid 1797812601 branch 1063804222
  40. Archived Log entry 1100 added for thread 2 sequence 2592 rlc 1063804222 ID 0x77b6b2ad dest 2:
  41. Tue Mar 02 22: 45: 08 2021
  42. RFS[ 8]: Assigned to RFS process 10277
  43. RFS[ 8]: Selected log 17 for thread 2 sequence 2593 dbid 1797812601 branch 1063804222
  44. Tue Mar 02 22: 45: 08 2021
  45. Primary database is in MAXIMUM PERFORMANCE mode

重建备库 redolog

那么,这里将上演的是重建备库 redolog 的相关操作步骤。


   
  1. SQL> alter database drop logfile group 27;
  2. alter database drop logfile group 27
  3. *
  4. ERROR at line 1:
  5. ORA -01156: recovery or flashback in progress may need access to files
  6. --由于开启了日志应用进程,直接删除会报错,故需要停止日志应用,修改参数 standby_file_management 为手动。
  7. SQL> alter database recover managed standby database cancel;
  8. Database altered.
  9. SQL> alter system set standby_file_management= 'manual' scope=both sid= '*';
  10. Database altered.
  11. SQL> show parameter standby_file_management
  12. NAME TYPE VALUE
  13. ------------------------------------ ---------------------- ------------------------------
  14. standby_file_management string manual
  15. SQL> alter database drop logfile group 27;
  16. Database altered.
  17. --由于日志组不能少于 2 个,故 日志组 28 不不能够删除。
  18. SQL> alter database drop logfile group 28;
  19. alter database drop logfile group 28
  20. *
  21. ERROR at line 1:
  22. ORA -01567: dropping log 28 would leave less than 2 log files for instance JIEKEXU2 (thread 2)
  23. ORA -00312: online log 28 thread 2: '+JIEKER_DATA/jiekexu/onlinelog/group_28.1742.1065129973'

下面则通过继续应用日志、重启、主库切日志、重命名等各种手段继续尝试删除这三个有问题的日志组。


   
  1. --重启备库删除日志组 623,由于是当前日志组无法删除,庆幸日志组 5 成功删除了。
  2. SQL> alter database drop logfile group 6;
  3. alter database drop logfile group 6
  4. *
  5. ERROR at line 1:
  6. ORA -01623: log 6 is current log for instance JIEKEXU2 (thread 2) - cannot drop
  7. ORA -00312: online log 6 thread 2: '+JIEKE_DATA'
  8. ORA -00312: online log 6 thread 2: '+JIEKE_DATA'
  9. SQL> alter database drop logfile group 5;
  10. Database altered.
  11. SQL> alter database drop logfile group 23;
  12. alter database drop logfile group 23
  13. *
  14. ERROR at line 1:
  15. ORA -01623: log 23 is current log for instance jiekexu (thread 1) - cannot drop
  16. ORA -00312: online log 23 thread 1: '+JIEKE_DATA'
  17. ORA -00312: online log 23 thread 1: '+JIEKE_DATA'
  18. --只剩两组日志组也是当前日志组,则当前日志组无法删除,尝试进行 rename 操作,但也是无效或者缺失命令。
  19. SQL> alter database rename '+JIEKE_DATA' to '+JIEKER_DATA';
  20. alter database rename '+JIEKE_DATA' to '+JIEKER_DATA'
  21. *
  22. ERROR at line 1:
  23. ORA -02231: missing or invalid option to ALTER DATABASE
  24. SQL> alter database rename '+JIEKE_DATA' to '+JIEKER_DATA/jiekexu/onlinelog/group_6.dbf';
  25. alter database rename '+JIEKE_DATA' to '+JIEKER_DATA/jiekexu/onlinelog/group_6.dbf'
  26. *
  27. ERROR at line 1:
  28. ORA -02231: missing or invalid option to ALTER DATABASE
  29. --当然继续激活为主库肯定也是报错。那就继续开启日志同步模式,先保持备库同步吧。
  30. SQL> ALTER DATABASE ACTIVATE STANDBY DATABASE;
  31. ALTER DATABASE ACTIVATE STANDBY DATABASE
  32. *
  33. ERROR at line 1:
  34. ORA -00349: failure obtaining block size for '+JIEKE_DATA'
  35. ORA -15001: diskgroup "JIEKE_DATA" does not exist or is not mounted
  36. ORA -15001: diskgroup "JIEKE_DATA" does not exist or is not mounted
  37. SQL> alter database recover managed standby database using current logfile disconnect from session;
  38. Database altered.

重建备库控制文件解决

第二日早晨,睡醒之后头脑清晰想到备库既然无法删除,那主库肯定是可以删除的。通过主库删除日志组 6、23 之后,再重建一个备库的控制文件就可以解决。这样也很简单,主库删除备库有问题的两组日志组后使用 rman 备份一个备库的 控制文件,然后 scp 到备库,备库重启到 nomount 恢复控制文件,启动到 mount 就好了。


   
  1. --主库:
  2. SQL> alter database drop logfile group 6;
  3. Database altered.
  4. SQL> alter database drop logfile group 23;
  5. Database altered.
  6. rman target /
  7. RMAN> backup current controlfile for standby format '/home/oracle/backup20210303%d_%I_%s_%p.ctl';
  8. scp /home/oracle/backup20210303%d_%I_%s_%p.ctl jiekeadg:/home/oracle/
  9. --备库
  10. SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
  11. Database altered.
  12. SQL> shu immediate
  13. ORA -01109: database not open
  14. Database dismounted.
  15. ORACLE instance shut down.
  16. SQL> startup nomount
  17. ORACLE instance started.
  18. Total System Global Area 1.0689E+11 bytes
  19. Fixed Size 2265864 bytes
  20. Variable Size 4.2144E+10 bytes
  21. Database Buffers 6.4425E+10 bytes
  22. Redo Buffers 323678208 bytes
  23. SQL> exit
  24. jiekeadg:/home/oracle(jiekexu)>rman target /
  25. Recovery Manager: Release 11.2 .0 .4 .0 - Production on Wed Mar 3 10: 07: 34 2021
  26. Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
  27. connected to target database: JIEKEXU (not mounted)
  28. RMAN> restore standby controlfile from '/home/oracle/backup20210303JIEKEXU_1797812601_106_1.ctl';
  29. Starting restore at 2021 -03 -03 10: 08: 03
  30. using target database control file instead of recovery catalog
  31. allocated channel: ORA_DISK_1
  32. channel ORA_DISK_1: SID= 3009 device type=DISK
  33. channel ORA_DISK_1: restoring control file
  34. channel ORA_DISK_1: restore complete, elapsed time: 00: 00: 01
  35. output file name=+JIEKER_DATA/jiekexu/controlfile/current .1739 .1065125909
  36. output file name=+JIEKER_ARCH/jiekexu/controlfile/current .323 .1065125911
  37. Finished restore at 2021 -03 -03 10: 08: 04
  38. RMAN> sql 'alter database mount';
  39. sql statement: alter database mount
  40. released channel: ORA_DISK_1
  41. RMAN> exit
  42. -- SQLPLUS 里应用 MRP0 进程同步数据。
  43. jiekeadg:/home/oracle(jiekexu)>sqlplus / as sysdba
  44. SQL> alter database recover managed standby database using current logfile disconnect from session;
  45. Database altered.
  46. SQL> /
  47. NAME VALUE UNIT TIME_COMPUTED
  48. ------------- -------------------- ------------------------------ ------------------------------
  49. transport lag + 00 00: 00: 00 day( 2) to second( 0) interval 03/ 03/ 2021 10: 19: 08
  50. apply lag + 00 00: 00: 00 day( 2) to second( 0) interval 03/ 03/ 2021 10: 19: 08

重建控制文件后恢复的备库中就没有了错误的磁盘组,但这样时间长一些则备库日志应用会延迟,因为 standby_log 日志状态全部为 UNASSIGNED 的。需要重建备库 standby redolog 日志组后它的状态才会变成 ACTIVE。
取消日志应用,修改参数为 manual 删除原有日志组,重建日志组改回参数应用日志同步进程即可。


   
  1. SELECT to_char(f.group#) groupno, to_char(l.thread#) thread, f.member member, f. type redo_file_type, l.status group_status, f.status member_status, l.bytes/ 1024/ 1024 bytes, l.archived archived
  2. FROM v$logfile f, v$log l WHERE f.group# = l.group# ORDER BY f.group#, f.member;SQL>
  3. SQL> SQL> SQL> SQL> SQL> SQL> SQL> SQL> SQL> 2
  4. Group Thread Member Redo Type Group Status Member Status Size(M) Archived
  5. ------ ------ -------------------- ---------- ------------ --------------- -------- ----------
  6. 1 1 +JIEKE_DATA ONLINE CLEARING INVALID 4, 096 YES
  7. 1 +JIEKE_DATA ONLINE CLEARING INVALID 4, 096 YES
  8. 2 1 +JIEKE_DATA ONLINE CLEARING INVALID 4, 096 YES
  9. 1 +JIEKE_DATA ONLINE CLEARING INVALID 4, 096 YES
  10. 3 1 +JIEKE_DATA ONLINE CLEARING INVALID 4, 096 YES
  11. 1 +JIEKE_DATA ONLINE CLEARING INVALID 4, 096 YES
  12. 4 1 +JIEKE_DATA ONLINE CURRENT INVALID 4, 096 YES
  13. 1 +JIEKE_DATA ONLINE CURRENT INVALID 4, 096 YES
  14. 5 1 +JIEKE_DATA ONLINE CLEARING INVALID 4, 096 YES
  15. 1 +JIEKE_DATA ONLINE CLEARING INVALID 4, 096 YES
  16. 7 2 +JIEKE_DATA ONLINE CLEARING INVALID 4, 096 YES
  17. 2 +JIEKE_DATA ONLINE CLEARING INVALID 4, 096 YES
  18. 8 2 +JIEKE_DATA ONLINE CLEARING INVALID 4, 096 YES
  19. 2 +JIEKE_DATA ONLINE CLEARING INVALID 4, 096 YES
  20. 9 2 +JIEKE_DATA ONLINE CLEARING INVALID 4, 096 YES
  21. 2 +JIEKE_DATA ONLINE CLEARING INVALID 4, 096 YES
  22. 10 2 +JIEKE_DATA ONLINE CURRENT INVALID 4, 096 YES
  23. 2 +JIEKE_DATA ONLINE CURRENT INVALID 4, 096 YES
  24. 24 2 +JIEKE_DATA ONLINE CLEARING INVALID 4, 096 YES
  25. 2 +JIEKE_DATA ONLINE CLEARING INVALID 4, 096 YES
  26. SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
  27. Database altered.
  28. SQL> show parameter standby_file_management
  29. NAME TYPE VALUE
  30. ------------------------------------ ---------------------- ------------------------------standby_file_management string manual
  31. SQL>
  32. SQL> select inst_id,GROUP#,THREAD#,SEQUENCE#,USED,ARCHIVED,STATUS from gv$standby_log;
  33. INST_ID GROUP# THREAD# SEQUENCE# USED Archived STATUS
  34. ---------- ---------- ---------- ---------- ---------- ---------- --------------------
  35. 1 11 1 0 0 YES UNASSIGNED
  36. 1 12 1 0 0 YES UNASSIGNED
  37. 1 13 1 0 0 YES UNASSIGNED
  38. 1 14 1 0 0 YES UNASSIGNED
  39. 1 15 1 0 0 YES UNASSIGNED
  40. alter database drop logfile group 11;
  41. alter database drop logfile group 12;
  42. alter database drop logfile group 13;
  43. alter database drop logfile group 14;
  44. alter database drop logfile group 15;
  45. ALTER DATABASE ADD standby LOGFILE THREAD 1 ( '+JIEKER_DATA', '+JIEKER_ARCH') SIZE 4G;
  46. ALTER DATABASE ADD standby LOGFILE THREAD 1 ( '+JIEKER_DATA', '+JIEKER_ARCH') SIZE 4G;
  47. ALTER DATABASE ADD standby LOGFILE THREAD 1 ( '+JIEKER_DATA', '+JIEKER_ARCH') SIZE 4G;
  48. ALTER DATABASE ADD standby LOGFILE THREAD 1 ( '+JIEKER_DATA', '+JIEKER_ARCH') SIZE 4G;
  49. ALTER DATABASE ADD standby LOGFILE THREAD 1 ( '+JIEKER_DATA', '+JIEKER_ARCH') SIZE 4G;
  50. SQL> select inst_id,GROUP#,THREAD#,SEQUENCE#,USED,ARCHIVED,STATUS from gv$standby_log;
  51. INST_ID GROUP# THREAD# SEQUENCE# USED Archived STATUS
  52. ---------- ---------- ---------- ---------- ---------- ---------- --------------------
  53. 1 6 1 4797 3026358272 YES ACTIVE
  54. 1 11 1 0 0 YES UNASSIGNED
  55. 1 12 1 0 0 YES UNASSIGNED
  56. 1 13 1 0 0 YES UNASSIGNED
  57. 1 14 1 0 0 YES UNASSIGNED
  58. SQL> alter system set standby_file_management= 'AUTO' scope=both sid= '*';
  59. SQL> alter database open;
  60. alter database recover managed standby database using current logfile disconnect from session;
  61. Database altered.

找到最终问题所在

完成重建后,本以为已经万事大吉了,但一开库应用日志却发现后台日志中所有 redolog 日志组都被清理了。这才意识到问题的根源所在,立马查看了路径相关的参数发现 db_create_online_log_dest 参数设置错误,导致创建出了错误的磁盘组


   
  1. jiekeadg:/home/oracle(jiekexu)>sqlplus / as sysdba
  2. SQL*Plus: Release 11.2 .0 .4 .0 Production on Wed Mar 3 10: 52: 04 2021
  3. Copyright (c) 1982, 2013, Oracle. All rights reserved.
  4. Connected to:
  5. Oracle Database 11g Enterprise Edition Release 11.2 .0 .4 .0 - 64bit Production
  6. With the Partitioning, Automatic Storage Management, OLAP, Data Mining
  7. and Real Application Testing options
  8. SQL> show parameter db_create_online_log_dest_
  9. NAME TYPE VALUE
  10. ------------------------------------ ----------- ------------------------------
  11. db_create_online_log_dest_1 string +JIEKE_DATA
  12. db_create_online_log_dest_2 string +JIEKE_DATA
  13. db_create_online_log_dest_3 string
  14. db_create_online_log_dest_4 string
  15. db_create_online_log_dest_5 string
  16. SQL> alter system set db_create_online_log_dest_1= '+JIEKER_DATA' scope=spfile;
  17. System altered.
  18. SQL> alter system set db_create_online_log_dest_2= '+JIEKER_DATA' scope=spfile;
  19. System altered.

但是现在修改完参数所有的日志组成员也都出现在错误的磁盘组了,因为有了当前日志组 4、10 占用了,重建日志组也行不通,故只能再次重建备库控制文件了。以上主库备份控制文件传到备库恢复的过程再来一遍即可。


   
  1. SELECT to_char(f.group#) groupno, to_char(l.thread#) thread, f.member member, f. type redo_file_type, l.status group_status, f.status member_status, l.bytes/ 1024/ 1024 bytes, l.archived archived
  2. FROM v$logfile f, v$log l WHERE f.group# = l.group# ORDER BY f.group#, f.member;SQL>
  3. SQL> SQL> SQL> SQL> SQL> SQL> SQL> SQL> SQL> 2
  4. Group Thread Member Redo Type Group Status Member Status Size(M) Archived
  5. ------ ------ -------------------- ---------- ------------ --------------- -------- ----------
  6. 1 1 +JIEKE_DATA ONLINE CLEARING INVALID 4, 096 YES
  7. 1 +JIEKE_DATA ONLINE CLEARING INVALID 4, 096 YES
  8. 2 1 +JIEKE_DATA ONLINE CLEARING INVALID 4, 096 YES
  9. 1 +JIEKE_DATA ONLINE CLEARING INVALID 4, 096 YES
  10. 3 1 +JIEKE_DATA ONLINE CLEARING INVALID 4, 096 YES
  11. 1 +JIEKE_DATA ONLINE CLEARING INVALID 4, 096 YES
  12. 4 1 +JIEKE_DATA ONLINE CURRENT INVALID 4, 096 YES
  13. 1 +JIEKE_DATA ONLINE CURRENT INVALID 4, 096 YES
  14. 5 1 +JIEKE_DATA ONLINE CLEARING INVALID 4, 096 YES
  15. 1 +JIEKE_DATA ONLINE CLEARING INVALID 4, 096 YES
  16. 7 2 +JIEKE_DATA ONLINE CLEARING INVALID 4, 096 YES
  17. 2 +JIEKE_DATA ONLINE CLEARING INVALID 4, 096 YES
  18. 8 2 +JIEKE_DATA ONLINE CLEARING INVALID 4, 096 YES
  19. 2 +JIEKE_DATA ONLINE CLEARING INVALID 4, 096 YES
  20. 9 2 +JIEKE_DATA ONLINE CLEARING INVALID 4, 096 YES
  21. 2 +JIEKE_DATA ONLINE CLEARING INVALID 4, 096 YES
  22. 10 2 +JIEKE_DATA ONLINE CURRENT INVALID 4, 096 YES
  23. 2 +JIEKE_DATA ONLINE CURRENT INVALID 4, 096 YES
  24. 24 2 +JIEKE_DATA ONLINE CLEARING INVALID 4, 096 YES
  25. 2 +JIEKE_DATA ONLINE CLEARING INVALID 4, 096 YES
  26. 20 rows selected.

最终激活备库

再一次重建后正常恢复同步,然后关闭实例启动到 mount 状态,激活 ADG 备库,重启验证即可。


   
  1. SQL> shu immediate
  2. Database closed.
  3. Database dismounted.
  4. ORACLE instance shut down.
  5. SQL>
  6. SQL> startup mount
  7. ORACLE instance started.
  8. Total System Global Area 1.0689E+11 bytes
  9. Fixed Size 2265864 bytes
  10. Variable Size 4.2144E+10 bytes
  11. Database Buffers 6.4425E+10 bytes
  12. Redo Buffers 323678208 bytes
  13. Database mounted.
  14. SQL>
  15. SQL> ALTER DATABASE ACTIVATE STANDBY DATABASE;
  16. Database altered.
  17. SQL> alter database open;
  18. Database altered.
  19. SQL> select DATABASE_ROLE from v$database;
  20. DATABASE_ROLE
  21. --------------------------------
  22. PRIMARY
  23. SQL> shu immediate
  24. Database closed.
  25. Database dismounted.
  26. ORACLE instance shut down.
  27. SQL> startup
  28. ORACLE instance started.
  29. Total System Global Area 1.0689E+11 bytes
  30. Fixed Size 2265864 bytes
  31. Variable Size 4.2144E+10 bytes
  32. Database Buffers 6.4425E+10 bytes
  33. Redo Buffers 323678208 bytes
  34. Database mounted.
  35. Database opened.
  36. SQL> exit

那么小伙伴们今天就到这里了,以下地址均可找到我,感兴趣的可添加我个人微信【JiekeXu_DBA】一起交流学习。

————————————————————————————
公众号:JiekeXu DBA之路
墨天轮:https://www.modb.pro/u/4347
CSDN :https://blog.csdn.net/JiekeXu
腾讯云:https://cloud.tencent.com/developer/user/5645107
————————————————————————————

Oracle 12c 及以上版本补丁更新说明及下载方法(收藏版)

一线运维 DBA 五年经验常用 SQL 大全(一)

一线运维 DBA 五年经验常用 SQL 大全(二)

Oracle 21C 新特性:数据泵相关新特性汇总

震惊:Oracle 11gR2 RAC ADG 并没有高可用

如何通过 Shell 监控异常等待事件和活跃会话 

Oracle 12C 最新补丁下载与安装操作指北

DBA 常用的软件工具有哪些(分享篇)?

Oracle 每日一题系列合集

百花齐放的国产数据库


转载:https://blog.csdn.net/JiekeXu/article/details/114465428
查看评论
* 以上用户言论只代表其个人观点,不代表本网站的观点或立场