将RAC 备份恢复到单实例后做备库,因为online redo log 路劲不一样,需要删除重建,添加过程没啥问题,但是drop 会存在如下错误。
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 就可以了,这里报错没关系:
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了,但是我们目前还是只读的从库,所以不能执行这个命令:
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 的问题。
版权声明:本文为博主原创文章,未经博主允许不得转载。