添加 redolog 組成員

查詢當前狀態redolog

SQL> select group#,sequence#,bytes,members,status from v$log;

GROUP# SEQUENCE# BYTES MEMBERS STATUS

1 61 52428800 1 INACTIVE
2 64 52428800 1 CURRENT
3 0 52428800 1 UNUSED

SQL> alter database add logfile member 'D:\oracle\oradata\test\REDO03_B.log' to group 3;
Database altered.

SQL> select * from v$logfile;

GROUP# STATUS TYPE MEMBER IS_
------- ------- ---
3 ONLINE D:\ORACLE\ORADATA\TEST\REDO03.LOG NO
2 ONLINE D:\ORACLE\ORADATA\TEST\REDO02.LOG NO
1 ONLINE D:\ORACLE\ORADATA\TEST\REDO01.LOG NO
3 INVALID ONLINE D:\ORACLE\ORADATA\TEST\REDO03_B.LOG NO

SQL> select group#,sequence#,bytes,members,status from v$log;

GROUP# SEQUENCE# BYTES MEMBERS STATUS

1 61 52428800 1 INACTIVE
2 64 52428800 1 CURRENT
3 0 52428800 2 UNUSED

切換logfile到第三組;
SQL> alter system switch logfile ;
System altered.

SQL> select group#,sequence#,bytes,members,status from v$log;

GROUP# SEQUENCE# BYTES MEMBERS STATUS

1 61 52428800 1 INACTIVE
2 64 52428800 1 ACTIVE
3 65 52428800 2 CURRENT

將redolog日誌歸檔

SQL> alter system checkpoint;
System altered.

SQL> select group#,sequence#,bytes,members,status from v$log;

GROUP# SEQUENCE# BYTES MEMBERS STATUS

1 61 52428800 1 INACTIVE
2 64 52428800 1 INACTIVE
3 65 52428800 2 CURRENT

爲前兩組添加組成員

SQL> alter database add logfile member 'D:\oracle\oradata\test\REDO01_B.log' to group 1;
Database altered.

SQL> alter database add logfile member 'D:\oracle\oradata\test\REDO02_B.log' to group 2;
Database altered.

SQL> select group#,member from v$logfile;

GROUP# MEMBER

3 D:\ORACLE\ORADATA\TEST\REDO03.LOG
2 D:\ORACLE\ORADATA\TEST\REDO02.LOG
1 D:\ORACLE\ORADATA\TEST\REDO01.LOG
3 D:\ORACLE\ORADATA\TEST\REDO03_B.LOG
1 D:\ORACLE\ORADATA\TEST\REDO01_B.LOG
2 D:\ORACLE\ORADATA\TEST\REDO02_B.LOG

6 rows selected.

SQL> select * from v$logfile;

GROUP# STATUS TYPE MEMBER IS_
------- ------- ---
3 ONLINE D:\ORACLE\ORADATA\TEST\REDO03.LOG NO
2 ONLINE D:\ORACLE\ORADATA\TEST\REDO02.LOG NO
1 ONLINE D:\ORACLE\ORADATA\TEST\REDO01.LOG NO
3 ONLINE D:\ORACLE\ORADATA\TEST\REDO03_B.LOG NO
1 INVALID ONLINE D:\ORACLE\ORADATA\TEST\REDO01_B.LOG NO
2 INVALID ONLINE D:\ORACLE\ORADATA\TEST\REDO02_B.LOG NO

6 rows selected.

SQL> alter system switch logfile;
System altered.

SQL> alter system switch logfile;
System altered.

SQL> select * from v$logfile;

GROUP# STATUS TYPE MEMBER IS_
------- ------- ---
3 ONLINE D:\ORACLE\ORADATA\TEST\REDO03.LOG NO
2 ONLINE D:\ORACLE\ORADATA\TEST\REDO02.LOG NO
1 ONLINE D:\ORACLE\ORADATA\TEST\REDO01.LOG NO
3 ONLINE D:\ORACLE\ORADATA\TEST\REDO03_B.LOG NO
1 ONLINE D:\ORACLE\ORADATA\TEST\REDO01_B.LOG NO
2 ONLINE D:\ORACLE\ORADATA\TEST\REDO02_B.LOG NO

6 rows selected.oracle

————————————————————————————————————————
重慶思莊OCP認證培訓班火熱報名中,每個月循環開班,更多詳情請訪問思莊網站諮詢在線客服!網站

相關文章
相關標籤/搜索