SQL> select SEQUENCE#,first_time,next_time,APPLIED, THREAD# from v$archived_log order by SEQUENCE#,THREAD#; SEQUENCE# FIRST_TIME NEXT_TIME APPLIED THREAD# ---------- ------------ ------------ --------- ------- 59 07-AUG-20 07-AUG-20 YES 1 59 07-AUG-20 07-AUG-20 NO 1 60 07-AUG-20 07-AUG-20 YES 1 60 07-AUG-20 07-AUG-20 NO 1 61 07-AUG-20 07-AUG-20 NO 1 61 07-AUG-20 07-AUG-20 YES 1 62 07-AUG-20 07-AUG-20 NO 1 62 07-AUG-20 07-AUG-20 YES 1 SQL> set linesize 300 SQL> select LOG_MODE,CONTROLFILE_TYPE,OPEN_MODE,PROTECTION_MODE,DATABASE_ROLE,SWITCHOVER_STATUS from v$database; LOG_MODE CONTROL OPEN_MODE PROTECTION_MODE DATABASE_ROLE SWITCHOVER_STATUS ------------ ------- -------------------- -------------------- ---------------- -------------------- ARCHIVELOG CURRENT READ WRITE MAXIMUM PERFORMANCE PRIMARY TO STANDBY SQL> select GROUP#,BYTES/1024/1024 from v$log; GROUP# BYTES/1024/1024 ------ --------------- 1 50 2 50 3 50 SQL> select GROUP#,BYTES/1024/1024,STATUS from v$standby_log; GROUP# BYTES/1024/1024 STATUS ------ --------------- ---------- 4 50 UNASSIGNED 5 50 UNASSIGNED 6 50 UNASSIGNED SQL> |
SQL> select SEQUENCE#,first_time,next_time,APPLIED, THREAD# from v$archived_log order by SEQUENCE#,THREAD#; SEQUENCE# FIRST_TIME NEXT_TIME APPLIED THREAD# ---------- ------------ ------------ --------- ---------- 59 07-AUG-20 07-AUG-20 YES 1 60 07-AUG-20 07-AUG-20 YES 1 61 07-AUG-20 07-AUG-20 YES 1 62 07-AUG-20 07-AUG-20 YES 1 SQL> select LOG_MODE,CONTROLFILE_TYPE,OPEN_MODE,PROTECTION_MODE,DATABASE_ROLE,SWITCHOVER_STATUS from v$database; LOG_MODE CONTROL OPEN_MODE PROTECTION_MODE DATABASE_ROLE SWITCHOVER_STATUS ------------ ------- -------------------- -------------------- ---------------- -------------------- ARCHIVELOG STANDBY MOUNTED MAXIMUM PERFORMANCE PHYSICAL STANDBY SWITCHOVER PENDING SQL> select GROUP#,BYTES/1024/1024 from v$log; GROUP# BYTES/1024/1024 ---------- --------------- 1 50 3 50 2 50 SQL> select GROUP#,BYTES/1024/1024,STATUS from v$standby_log; GROUP# BYTES/1024/1024 STATUS ---------- --------------- ---------- 4 50 UNASSIGNED 5 50 UNASSIGNED 6 50 UNASSIGNED SQL> |
SQL> alter system set standby_file_management=manual; System altered. SQL> alter database recover managed standby database cancel; Database altered. |
SQL> alter database add logfile group 4 '/u01/oracle/oradata/orcl/redo04.log' size 500M; Database altered. SQL> alter database add logfile group 5 '/u01/oracle/oradata/orcl/redo05.log' size 500M; Database altered. SQL> alter database add logfile group 6 '/u01/oracle/oradata/orcl/redo06.log' size 500M; Database altered. SQL> alter database drop logfile group 1; Database altered. SQL> alter database drop logfile group 2; alter database drop logfile group 2 * ERROR at line 1: ORA-01623: log 2 is current log for instance orcl (thread 1) - cannot drop ORA-00312: online log 2 thread 1: '/u01/oracle/oradata/orcl/redo02.log' 这里切换一下日志,然后再操作 SQL> alter system switch logfile; System altered. SQL> / System altered. SQL> alter database drop logfile group 2; alter database drop logfile group 2 * ERROR at line 1: ORA-01624: log 2 needed for crash recovery of instance orcl (thread 1) ORA-00312: online log 2 thread 1: '/u01/oracle/oradata/orcl/redo02.log' 执行一下检查 SQL> alter system checkpoint; System altered. SQL> alter database drop logfile group 2; Database altered. SQL> alter database drop logfile group 3; Database altered. set linesize 500 col group# for 999 col mb for 999 col member for a100 col thread# for 999 col archived for a10 SQL> select a.group#,a.BYTES/1024/1024 mb,b.MEMBER,a.thread#,a.sequence#,a.members,a.archived,a.status,a.first_time,a.next_time from gv$log a,gv$logfile b where a.GROUP#=b.GROUP# group by a.group#,a.thread#,a.BYTES/1024/1024,b.MEMBER,a.sequence#,a.members,a.archived,a.status,a.first_time,a.next_time order by group#; GROUP# MB MEMBER THREAD# SEQUENCE# MEMBERS ARCHIVED STATUS FIRST_TIME NEXT_TIME ------ ---- ---------------------------------------------------------------------------------------------------- ------- ---------- ---------- ---------- ---------------- ------------ ------------ 4 500 /u01/oracle/oradata/orcl/redo04.log 1 64 1 YES INACTIVE 07-AUG-20 07-AUG-20 5 500 /u01/oracle/oradata/orcl/redo05log 1 65 1 NO CURRENT 07-AUG-20 6 500 /u01/oracle/oradata/orcl/redo06.log 1 0 1 YES UNUSED |
SQL> alter database add logfile group 4 '/u01/oracle/oradata/orcl/redo04.log' size 500M; Database altered. SQL> alter database add logfile group 5 '/u01/oracle/oradata/orcl/redo05.log' size 500M; Database altered. SQL> alter database add logfile group 6 '/u01/oracle/oradata/orcl/redo06.log' size 500M; Database altered. 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 orcl (thread 1) ORA-00312: online log 1 thread 1: '/u01/oracle/oradata/orcl/redo01.log' 清理一下redo SQL> ALTER DATABASE CLEAR LOGFILE GROUP 1; Database altered. SQL> ALTER DATABASE CLEAR LOGFILE GROUP 2; Database altered. SQL> ALTER DATABASE CLEAR LOGFILE GROUP 3; Database altered. 再执行删除原来的redo SQL> alter database drop logfile group 1; Database altered. SQL> alter database drop logfile group 2; Database altered. SQL> alter database drop logfile group 3; Database altered. SQL> set linesize 500 col group# for 999 col mb for 999 col member for a100 col thread# for 999 col archived for a10 SQL> select a.group#,a.BYTES/1024/1024 mb,b.MEMBER,a.thread#,a.sequence#,a.members,a.archived,a.status,a.first_time,a.next_time from gv$log a,gv$logfile b where a.GROUP#=b.GROUP# group by a.group#,a.thread#,a.BYTES/1024/1024,b.MEMBER,a.sequence#,a.members,a.archived,a.status,a.first_time,a.next_time order by group#; GROUP# MB MEMBER THREAD# SEQUENCE# MEMBERS ARCHIVED STATUS FIRST_TIME NEXT_TIME ------ ---- ---------------------------------------------------------------------------------------------------- ------- ---------- ---------- ---------- ---------------- ------------ ------------ 4 500 /u01/oracle/oradata/orcl/redo04.log 1 64 1 YES INACTIVE 07-AUG-20 07-AUG-20 5 500 /u01/oracle/oradata/orcl/redo05log 1 65 1 NO CURRENT 07-AUG-20 6 500 /u01/oracle/oradata/orcl/redo06.log 1 0 1 YES UNUSED |
SQL> alter database recover managed standby database disconnect from session; Database altered. SQL> alter system set standby_file_management=auto; System altered. |
欢迎光临 重庆思庄Oracle、Redhat认证学习论坛 (http://bbs.cqsztech.com/) | Powered by Discuz! X3.2 |