手工切换日志
alter system switch logfile;
desc v$log
SQL> desc v$log;
Name Null? Type
----------------------------------------- -------- ----------------------------
GROUP# NUMBER
THREAD# NUMBER
SEQUENCE# NUMBER
BYTES NUMBER
BLOCKSIZE NUMBER
MEMBERS NUMBER
ARCHIVED VARCHAR2(3)
STATUS VARCHAR2(16)
FIRST_CHANGE# NUMBER
FIRST_TIME DATE
NEXT_CHANGE# NUMBER
NEXT_TIME DATE
SQL> select group#,thread#,sequence#,members,status from v$log;
GROUP# THREAD# SEQUENCE# MEMBERS STATUS
---------- ---------- ---------- ---------- ----------------
1 1 16 1 CURRENT
2 1 14 1 INACTIVE
3 1 15 1 INACTIVE
注意sequence 和 status
current 当前
inactive 无效,目前不适用
SQL> alter system switch logfile;
System altered.
SQL> select group#,thread#,sequence#,members,status from v$log;
GROUP# THREAD# SEQUENCE# MEMBERS STATUS
---------- ---------- ---------- ---------- ----------------
1 1 16 1 ACTIVE
2 1 17 1 CURRENT
3 1 15 1 INACTIVE
SQL>
强制执行检查点
SQL> show parameter fast_start_mtt
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
fast_start_mttr_target integer 0
SQL> alter system set fast_start_mttr_target=10;
System altered.
SQL> show parameter fast_start_mtt
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
fast_start_mttr_target integer 10
SQL> alter system checkpoint;
System altered.
添加redo log file 组
desc v$logfile
SQL> desc v$logfile
Name Null? Type
----------------------------------------- -------- ----------------------------
GROUP# NUMBER
STATUS VARCHAR2(7)
TYPE VARCHAR2(7)
MEMBER VARCHAR2(513)
IS_RECOVERY_DEST_FILE VARCHAR2(3)
SQL> col member format a40;
SQL> select * from v$logfile;
GROUP# STATUS TYPE MEMBER IS_
---------- ------- ------- ---------------------------------------- ---
3 ONLINE /u01/oradata/houzhh/redo03.log NO
2 ONLINE /u01/oradata/houzhh/redo02.log NO
1 ONLINE /u01/oradata/houzhh/redo01.log NO
SQL> alter database add logfile group 4
2 ('/u01/oradata/houzhh/redo04.rdo') size 100M;
Database altered.
SQL> select * from v$logfile;
GROUP# STATUS TYPE MEMBER IS_
---------- ------- ------- ---------------------------------------- ---
3 ONLINE /u01/oradata/houzhh/redo03.log NO
2 ONLINE /u01/oradata/houzhh/redo02.log NO
1 ONLINE /u01/oradata/houzhh/redo01.log NO
4 ONLINE /u01/oradata/houzhh/redo04.rdo NO
SQL>
给组内添加一个成member
SQL> select group#,thread#,sequence#,members,archived,status from v$log;
GROUP# THREAD# SEQUENCE# MEMBERS ARC STATUS
---------- ---------- ---------- ---------- --- ----------------
4 1 0 1 YES UNUSED
SQL> alter database add logfile member '/u01/oradata/houzhh/redo04b.rdo' to group 4;
Database altered.
SQL> select group#,thread#,sequence#,members,archived,status from v$log;
GROUP# THREAD# SEQUENCE# MEMBERS ARC STATUS
---------- ---------- ---------- ---------- --- ----------------
4 1 0 2 YES UNUSED
SQL> select * from v$logfile where group#='4';
GROUP# STATUS TYPE MEMBER IS_
---------- ------- ------- ---------------------------------------- ---
4 ONLINE /u01/oradata/houzhh/redo04.rdo NO
4 INVALID ONLINE /u01/oradata/houzhh/redo04b.rdo NO