您好,登錄后才能下訂單哦!
連接數據庫服務器,查詢現有在線日志組信息并添加在線日志組。
Connected to Oracle Database 11g Enterprise Edition Release 11.2.0.4.0
Connected as system
SQL> select * from v$logfile;
GROUP# STATUS TYPE MEMBER IS_RECOVERY_DEST_FILE
---------- ------- ------- ------------------------------------------------- ---------------------
2 ONLINE +DATA/oracle/onlinelog/group_2.262.900549871 NO
2 ONLINE +FRA/oracle/onlinelog/group_2.258.900549873 YES
1 ONLINE +DATA/oracle/onlinelog/group_1.261.900549865 NO
1 ONLINE +FRA/oracle/onlinelog/group_1.257.900549867 YES
3 ONLINE +DATA/oracle/onlinelog/group_3.265.900550437 NO
3 ONLINE +FRA/oracle/onlinelog/group_3.259.900550441 YES
4 ONLINE +DATA/oracle/onlinelog/group_4.266.900550445 NO
4 ONLINE +FRA/oracle/onlinelog/group_4.260.900550449 YES
8 rows selected
添加新的日志組文件
SQL> alter database add logfile thread 1 group 5 ('+DATA/oracle/onlinelog/group5','+FRA/oracle/onlinelog/group5') size 200M;
Database altered
SQL> alter database add logfile thread 2 group 6 ('+DATA/oracle/onlinelog/group6','+FRA/oracle/onlinelog/group6') size 200M;
Database altered
SQL> alter database add logfile thread 1 group 7 ('+DATA/oracle/onlinelog/group7','+FRA/oracle/onlinelog/group7') size 200M;
Database altered
SQL> alter database add logfile thread 2 group 8 ('+DATA/oracle/onlinelog/group8','+FRA/oracle/onlinelog/group8') size 200M;
Database altered
SQL> select * from v$logfile;
GROUP# STATUS TYPE MEMBER IS_RECOVERY_DEST_FILE
---------- ------- ------- ----------------------------------------------- ---------------------
2 ONLINE +DATA/oracle/onlinelog/group_2.262.900549871 NO
2 ONLINE +FRA/oracle/onlinelog/group_2.258.900549873 YES
1 ONLINE +DATA/oracle/onlinelog/group_1.261.900549865 NO
1 ONLINE +FRA/oracle/onlinelog/group_1.257.900549867 YES
3 ONLINE +DATA/oracle/onlinelog/group_3.265.900550437 NO
3 ONLINE +FRA/oracle/onlinelog/group_3.259.900550441 YES
4 ONLINE +DATA/oracle/onlinelog/group_4.266.900550445 NO
4 ONLINE +FRA/oracle/onlinelog/group_4.260.900550449 YES
5 ONLINE +DATA/oracle/onlinelog/group5 NO
5 ONLINE +FRA/oracle/onlinelog/group5 NO
6 ONLINE +DATA/oracle/onlinelog/group6 NO
6 ONLINE +FRA/oracle/onlinelog/group6 NO
7 ONLINE +DATA/oracle/onlinelog/group7 NO
7 ONLINE +FRA/oracle/onlinelog/group7 NO
8 ONLINE +DATA/oracle/onlinelog/group8 NO
8 ONLINE +FRA/oracle/onlinelog/group8 NO
16 rows selected
SQL> select thread#,group#,archived,status from v$log;
THREAD# GROUP# ARCHIVED STATUS
---------- ---------- -------- ----------------
1 1 NO CURRENT
1 2 YES INACTIVE
2 3 YES INACTIVE
2 4 NO CURRENT
1 5 YES UNUSED
2 6 YES UNUSED
1 7 YES UNUSED
2 8 YES UNUSED
8 rows selected
切換日志
SQL> alter system switch logfile;
System altered
SQL> alter system switch logfile;
System altered
SQL> alter system switch logfile;
System altered
SQL> alter system switch logfile;
System altered
SQL> alter system switch logfile;
System altered
SQL> select thread#,group#,archived,status from v$log;
THREAD# GROUP# ARCHIVED STATUS
---------- ---------- -------- ----------------
1 1 YES ACTIVE
1 2 YES ACTIVE
2 3 YES INACTIVE
2 4 YES ACTIVE
1 5 NO CURRENT
2 6 YES ACTIVE
1 7 YES INACTIVE
2 8 NO CURRENT
8 rows selected
SQL> select * from v$logfile;
GROUP# STATUS TYPE MEMBER IS_RECOVERY_DEST_FILE
---------- ------- ------- ----------------------------------------------- ---------------------
2 ONLINE +DATA/oracle/onlinelog/group_2.262.900549871 NO
2 ONLINE +FRA/oracle/onlinelog/group_2.258.900549873 YES
1 ONLINE +DATA/oracle/onlinelog/group_1.261.900549865 NO
1 ONLINE +FRA/oracle/onlinelog/group_1.257.900549867 YES
3 ONLINE +DATA/oracle/onlinelog/group_3.265.900550437 NO
3 ONLINE +FRA/oracle/onlinelog/group_3.259.900550441 YES
4 ONLINE +DATA/oracle/onlinelog/group_4.266.900550445 NO
4 ONLINE +FRA/oracle/onlinelog/group_4.260.900550449 YES
5 ONLINE +DATA/oracle/onlinelog/group5 NO
5 ONLINE +FRA/oracle/onlinelog/group5 NO
6 ONLINE +DATA/oracle/onlinelog/group6 NO
6 ONLINE +FRA/oracle/onlinelog/group6 NO
7 ONLINE +DATA/oracle/onlinelog/group7 NO
7 ONLINE +FRA/oracle/onlinelog/group7 NO
8 ONLINE +DATA/oracle/onlinelog/group8 NO
8 ONLINE +FRA/oracle/onlinelog/group8 NO
16 rows selected
SQL> select thread#,group#,archived,status from v$log;
THREAD# GROUP# ARCHIVED STATUS
---------- ---------- -------- ----------------
1 1 YES INACTIVE
1 2 YES INACTIVE
2 3 YES INACTIVE
2 4 YES INACTIVE
1 5 NO CURRENT
2 6 YES INACTIVE
1 7 YES INACTIVE
2 8 NO CURRENT
8 rows selected
刪除原有在線日志組,同時物理文件也會自動刪除。
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> alter database drop logfile group 4;
Database altered
SQL> select thread#,group#,archived,status from v$log;
THREAD# GROUP# ARCHIVED STATUS
---------- ---------- -------- ----------------
1 5 NO CURRENT
2 6 YES INACTIVE
1 7 YES INACTIVE
2 8 NO CURRENT
SQL> select * from v$logfile;
GROUP# STATUS TYPE MEMBER IS_RECOVERY_DEST_FILE
---------- ------- ------- --------------------------------- ---------------------
5 ONLINE +DATA/oracle/onlinelog/group5 NO
5 ONLINE +FRA/oracle/onlinelog/group5 NO
6 ONLINE +DATA/oracle/onlinelog/group6 NO
6 ONLINE +FRA/oracle/onlinelog/group6 NO
7 ONLINE +DATA/oracle/onlinelog/group7 NO
7 ONLINE +FRA/oracle/onlinelog/group7 NO
8 ONLINE +DATA/oracle/onlinelog/group8 NO
8 ONLINE +FRA/oracle/onlinelog/group8 NO
8 rows selected
SQL> /
GROUP# STATUS TYPE MEMBER IS_RECOVERY_DEST_FILE
---------- ------- ------- -------------------------------- ---------------------
5 ONLINE +DATA/oracle/onlinelog/group5 NO
5 ONLINE +FRA/oracle/onlinelog/group5 NO
6 ONLINE +DATA/oracle/onlinelog/group6 NO
6 ONLINE +FRA/oracle/onlinelog/group6 NO
7 ONLINE +DATA/oracle/onlinelog/group7 NO
7 ONLINE +FRA/oracle/onlinelog/group7 NO
8 ONLINE +DATA/oracle/onlinelog/group8 NO
8 ONLINE +FRA/oracle/onlinelog/group8 NO
8 rows selected
SQL> select thread#,group#,archived,status from v$log;
THREAD# GROUP# ARCHIVED STATUS
---------- ---------- -------- ----------------
1 5 NO CURRENT
2 6 YES INACTIVE
1 7 YES INACTIVE
2 8 NO CURRENT
SQL> alter system switch logfile;
System altered
SQL> /
System altered
SQL> /
System altered
SQL> /
System altered
SQL> /
System altered
SQL> select * from v$logfile;
GROUP# STATUS TYPE MEMBER IS_RECOVERY_DEST_FILE
---------- ------- ------- --------------------------------- ---------------------
5 ONLINE +DATA/oracle/onlinelog/group5 NO
5 ONLINE +FRA/oracle/onlinelog/group5 NO
6 ONLINE +DATA/oracle/onlinelog/group6 NO
6 ONLINE +FRA/oracle/onlinelog/group6 NO
7 ONLINE +DATA/oracle/onlinelog/group7 NO
7 ONLINE +FRA/oracle/onlinelog/group7 NO
8 ONLINE +DATA/oracle/onlinelog/group8 NO
8 ONLINE +FRA/oracle/onlinelog/group8 NO
8 rows selected
SQL> select thread#,group#,archived,status from v$log;
THREAD# GROUP# ARCHIVED STATUS
---------- ---------- -------- ----------------
1 5 YES ACTIVE
2 6 NO CURRENT
1 7 NO CURRENT
2 8 YES ACTIVE
SQL>
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。