oracle – How to change the thread of redo logfile group in standby database?


Is there some way to correct the thread of redo logfile group? it’s ok the thread to be wrong?

executing the following query I get de logfile groups, thread and members:

set linesize 2000;
set pagesize 0 embedded on;
col member for a80;
select * from (
select g.THREAD#,g.group#,m.type,m.member,g.bytes/1024/1024 "LOGGROUP_SIZE_MB",g.status,nvl(m.status,'FILE IS IN USE') as status_file from 
v$log g inner join v$logfile m on m.group#=g.group# 
union all
select g.THREAD#,g.group#,m.type,m.member,g.bytes/1024/1024 "LOGGROUP_SIZE_MB",g.status,nvl(m.status,'FILE IS IN USE') as status_file from 
v$standby_log g inner join v$logfile m on m.group#=g.group#)
order by type,THREAD#,group#
/

   THREAD#     GROUP# TYPE    MEMBER                                                                           LOGGROUP_SIZE_MB STATUS           STATUS_FILE
---------- ---------- ------- -------------------------------------------------------------------------------- ---------------- ---------------- --------------
         1          1 ONLINE  +DADOS/mootstb/onlinelog/group_1.276.1052413891                                                50 CLEARING         FILE IS IN USE
         1          1 ONLINE  +FRA/mootstb/onlinelog/group_1.264.1052413893                                                  50 CLEARING         FILE IS IN USE
         1          2 ONLINE  +DADOS/mootstb/onlinelog/group_2.277.1052413931                                                50 CURRENT          FILE IS IN USE
         1          2 ONLINE  +FRA/mootstb/onlinelog/group_2.265.1052413933                                                  50 CURRENT          FILE IS IN USE
         2          3 ONLINE  +DADOS/mootstb/onlinelog/group_3.278.1052413939                                                50 UNUSED           FILE IS IN USE
         2          3 ONLINE  +FRA/mootstb/onlinelog/group_3.266.1052413941                                                  50 UNUSED           FILE IS IN USE
         2          4 ONLINE  +DADOS/mootstb/onlinelog/group_4.279.1052413947                                                50 UNUSED           FILE IS IN USE
         2          4 ONLINE  +FRA/mootstb/onlinelog/group_4.267.1052413947                                                  50 UNUSED           FILE IS IN USE
         1          5 STANDBY +DADOS/mootstb/onlinelog/group_5.280.1052413961                                                50 UNASSIGNED       FILE IS IN USE
         1          5 STANDBY +FRA/mootstb/onlinelog/group_5.268.1052413963                                                  50 UNASSIGNED       FILE IS IN USE
         1          6 STANDBY +DADOS/mootstb/onlinelog/group_6.281.1052413969                                                50 ACTIVE           FILE IS IN USE
         1          6 STANDBY +FRA/mootstb/onlinelog/group_6.269.1052413969                                                  50 ACTIVE           FILE IS IN USE
         2          7 STANDBY +DADOS/mootstb/onlinelog/group_7.282.1052413975                                                50 UNASSIGNED       FILE IS IN USE
         2          7 STANDBY +FRA/mootstb/onlinelog/group_7.270.1052413975                                                  50 UNASSIGNED       FILE IS IN USE
         2          8 STANDBY +FRA/mootstb/onlinelog/group_8.271.1052413983                                                  50 UNASSIGNED       FILE IS IN USE
         2          8 STANDBY +DADOS/mootstb/onlinelog/group_8.283.1052413981                                                50 UNASSIGNED       FILE IS IN USE

You can see that I have some logfile groups with thread 1 and 2. This happen because I’ve duplicated this database from RAC environment.

My current thread in this environment (physical standby) is 0:

SQL> show parameters thread
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
parallel_threads_per_cpu             integer     2
thread                               integer     0

How can I change the thread of all redo logfile groups to 0 as well? I’ve tried to drop each and recreate, but this is not possible, for example, I need to switchlog the online logfile group 1 to drop, but the database is not open because is a standby:

SQL> alter database drop logfile group 1;
alter database drop logfile group 1
*
ERROR at line 1:
ORA-01624: log 1 needed for crash recovery of instance imootstb (thread 1)
ORA-00312: online log 1 thread 1: '+DADOS/mootstb/onlinelog/group_1.276.1052413891'
ORA-00312: online log 1 thread 1: '+FRA/mootstb/onlinelog/group_1.264.1052413893'

SQL> alter system switch logfile;
alter system switch logfile
*
ERROR at line 1:
ORA-01109: database not open

If it is not possible, it’s ok the thread keep wrong? or will have some strange behavior in the database?