签到成功

知道了

CNDBA社区CNDBA社区

Oracle RAC 恢复到单实例后online redo log 处理

2025-06-19 11:35 63 0 原创 Oracle 19c
作者: dave

将RAC 备份恢复到单实例后做备库,因为online redo log 路劲不一样,需要删除重建,添加过程没啥问题,但是drop 会存在如下错误。http://www.cndba.cn/cndba/dave/article/131638

1. 问题一:ORA-01624: log 11 needed for crash recovery of instance cndba

SQL> alter database drop logfile group 11;
alter database drop logfile group 11
*
ERROR at line 1:
ORA-01624: log 11 needed for crash recovery of instance cndba (thread 1)
ORA-00312: online log 11 thread 1: '/u01/archivelog/onlinelog/group_11.309.1110205273'
ORA-00312: online log 11 thread 1: '/u01/archivelog/onlinelog/group_11.2159.1110205289'

SQL> select GROUP#,members,BYTES/1024/1024 size_M,STATUS,ARCHIVED from v$log;

    GROUP#    MEMBERS      SIZE_M STATUS       ARC
---------- ---------- ---------- ---------------- ---
     1        1         500 UNUSED       YES
     2        1         500 UNUSED       YES
     3        1         500 UNUSED       YES
     4        1         500 UNUSED       YES
     5        1         500 UNUSED       YES
     6        1         500 UNUSED       YES
     7        1         500 UNUSED       YES
     8        1         500 UNUSED       YES
     9        1         500 UNUSED       YES
    10        1         500 UNUSED       YES
    11        2         500 CLEARING      YES
    13        2         500 CLEARING      YES
    14        2         500 CLEARING      YES
    15        2         500 CLEARING      YES
    16        2         500 CURRENT      YES
    17        2         500 CLEARING      YES
    18        2         500 CLEARING      YES
    19        2         500 CLEARING      YES
    20        2         500 CLEARING      YES
    21        2         500 CURRENT      YES

20 rows selected.

这种问题只需要先执行下clear 就可以了,这里报错没关系:http://www.cndba.cn/cndba/dave/article/131638http://www.cndba.cn/cndba/dave/article/131638http://www.cndba.cn/cndba/dave/article/131638http://www.cndba.cn/cndba/dave/article/131638

SQL> alter database clear logfile group 11;
alter database clear logfile group 11
*
ERROR at line 1:
ORA-00344: unable to re-create online log '/u01/archivelog/onlinelog/group_11.309.1110205273'
ORA-27040: file create error, unable to create file
Linux-x86_64 Error: 2: No such file or directory
Additional information: 1

SQL> alter database drop logfile group 11;

Database altered.

问题二:current的redo 无法删除

SQL> select GROUP#,members,BYTES/1024/1024 size_M,STATUS,ARCHIVED from v$log;

    GROUP#    MEMBERS      SIZE_M STATUS       ARC
---------- ---------- ---------- ---------------- ---
     1        1         500 UNUSED       YES
     2        1         500 UNUSED       YES
     3        1         500 UNUSED       YES
     4        1         500 UNUSED       YES
     5        1         500 UNUSED       YES
     6        1         500 UNUSED       YES
     7        1         500 UNUSED       YES
     8        1         500 UNUSED       YES
     9        1         500 UNUSED       YES
    10        1         500 UNUSED       YES
    17        1         500 CURRENT      YES
    19        1         500 UNUSED       YES
    21        2         500 CLEARING      YES

13 rows selected.

这里 current 状态可以在主库执行 switch logfile 进行切换,因为从库是只读的:

SQL> alter system switch logfile;

System altered.

SQL> alter system switch logfile;

System altered.

问题三:ORA-01623: log 21 is current log for instance cndba:

SQL> alter database clear logfile group 21;
alter database clear logfile group 21
*
ERROR at line 1:
ORA-00344: unable to re-create online log '/u01/archivelog/onlinelog/group_21.341.1110205541'
ORA-27040: file create error, unable to create file
Linux-x86_64 Error: 2: No such file or directory
Additional information: 1


SQL> alter database drop logfile group 21;
alter database drop logfile group 21
*
ERROR at line 1:
ORA-01623: log 21 is current log for instance cndba (thread 1) - cannot drop
ORA-00312: online log 21 thread 1: '/u01/archivelog/onlinelog/group_21.341.1110205541'
ORA-00312: online log 21 thread 1: '/u01/archivelog/onlinelog/group_21.2150.1110205557'

SQL> select GROUP#,members,BYTES/1024/1024 size_M,STATUS,ARCHIVED from v$log;

    GROUP#    MEMBERS      SIZE_M STATUS       ARC
---------- ---------- ---------- ---------------- ---
     1        1         500 UNUSED       YES
     2        1         500 UNUSED       YES
     3        1         500 UNUSED       YES
     4        1         500 UNUSED       YES
     5        1         500 UNUSED       YES
     6        1         500 UNUSED       YES
     7        1         500 UNUSED       YES
     8        1         500 UNUSED       YES
     9        1         500 UNUSED       YES
    10        1         500 UNUSED       YES
    17        1         500 CLEARING      YES
    19        1         500 CURRENT      YES
    21        2         500 CLEARING      YES

13 rows selected.

这里就是状态不一致的问题,如果是直接恢复单实例,就好处理,直接disable 后就可以drop了,但是我们目前还是只读的从库,所以不能执行这个命令:http://www.cndba.cn/cndba/dave/article/131638http://www.cndba.cn/cndba/dave/article/131638http://www.cndba.cn/cndba/dave/article/131638

SQL> show parameter thread;              

NAME                     TYPE     VALUE
------------------------------------ ----------- ------------------------------
parallel_threads_per_cpu         integer     2
thread                     integer     0
SQL> alter database disable thread 1;
alter database disable thread 1
                       *
ERROR at line 1:
ORA-16000: database open for read-only access

SQL> alter database drop logfile group 21;

因为当前也DG 也没有影响,所以暂时不处理,等以后切换的时候在来处理这个redo log 的问题。 http://www.cndba.cn/cndba/dave/article/131638http://www.cndba.cn/cndba/dave/article/131638

版权声明:本文为博主原创文章,未经博主允许不得转载。

用户评论
* 以下用户言论只代表其个人观点,不代表CNDBA社区的观点或立场
dave

dave

关注

人的一生应该是这样度过的:当他回首往事的时候,他不会因为虚度年华而悔恨,也不会因为碌碌无为而羞耻;这样,在临死的时候,他就能够说:“我的整个生命和全部精力,都已经献给世界上最壮丽的事业....."

  • 2279
    原创
  • 3
    翻译
  • 579
    转载
  • 196
    评论
  • 访问:8159773次
  • 积分:4413
  • 等级:核心会员
  • 排名:第1名
精华文章
    最新问题
    查看更多+
    热门文章
      热门用户
      推荐用户
        Copyright © 2016 All Rights Reserved. Powered by CNDBA · 皖ICP备2022006297号-1·

        QQ交流群

        注册联系QQ