為oracle新增重做日誌組及重做日誌成員
新增重做日誌組:
SYS@orcl 08-SEP-14>select group#,type,member from v$logfile;
GROUP# TYPE MEMBER
------- ------- --------------------------------------------------
3 ONLINE /u01/app/oracle/oradata/orcl/redo03.log
2 ONLINE /u01/app/oracle/oradata/orcl/redo02.log
1 ONLINE /u01/app/oracle/oradata/orcl/redo01.log
SYS@orcl 08-SEP-14>alter database add logfile group 4
2 ('/u01/app/oracle/oradata/orcl/redo04.log')
3 size 50m;
SYS@orcl 08-SEP-14>select group#,sequence#,bytes/1024/1024||'MB',status from v$log;
GROUP# SEQUENCE# BYTES/1024/1024||'MB' STATUS
------- ---------- ------------------------------------------ ----------------
1 25 50MB CURRENT
2 23 50MB INACTIVE
3 24 50MB INACTIVE
4 0 50MB UNUSED
為日誌組新增成員:
SYS@orcl 09-SEP-14>select group#,status,member from v$logfile;
GROUP# STATUS MEMBER
------- ------- --------------------------------------------------
3 /u01/app/oracle/oradata/orcl/redo03.log
2 /u01/app/oracle/oradata/orcl/redo02.log
1 /u01/app/oracle/oradata/orcl/redo01.log
4 /u01/app/oracle/oradata/orcl/redo04.log
SYS@orcl 09-SEP-14>alter database add logfile member
2 '/u01/app/redolog/redo01a.log' to group 1,
3 '/u01/app/redolog/redo02a.log' to group 2,
4 '/u01/app/redolog/redo03a.log' to group 3,
5 '/u01/app/redolog/redo04a.log' to group 4;
Database altered.
SYS@orcl 09-SEP-14>select group#,status,member,type from v$logfile;
GROUP# STATUS MEMBER TYPE
------- ------- -------------------------------------------------- -------
3 /u01/app/oracle/oradata/orcl/redo03.log ONLINE
2 /u01/app/oracle/oradata/orcl/redo02.log ONLINE
1 /u01/app/oracle/oradata/orcl/redo01.log ONLINE
4 /u01/app/oracle/oradata/orcl/redo04.log ONLINE
1 INVALID /u01/app/redolog/redo01a.log ONLINE
2 INVALID /u01/app/redolog/redo02a.log ONLINE
3 INVALID /u01/app/redolog/redo03a.log ONLINE
4 INVALID /u01/app/redolog/redo04a.log ONLINE
8 rows selected.
SYS@orcl 08-SEP-14>select group#,type,member from v$logfile;
GROUP# TYPE MEMBER
------- ------- --------------------------------------------------
3 ONLINE /u01/app/oracle/oradata/orcl/redo03.log
2 ONLINE /u01/app/oracle/oradata/orcl/redo02.log
1 ONLINE /u01/app/oracle/oradata/orcl/redo01.log
2 ('/u01/app/oracle/oradata/orcl/redo04.log')
3 size 50m;
GROUP# SEQUENCE# BYTES/1024/1024||'MB' STATUS
------- ---------- ------------------------------------------ ----------------
1 25 50MB CURRENT
2 23 50MB INACTIVE
3 24 50MB INACTIVE
4 0 50MB UNUSED
SYS@orcl 09-SEP-14>select group#,status,member from v$logfile;
GROUP# STATUS MEMBER
------- ------- --------------------------------------------------
3 /u01/app/oracle/oradata/orcl/redo03.log
2 /u01/app/oracle/oradata/orcl/redo02.log
1 /u01/app/oracle/oradata/orcl/redo01.log
4 /u01/app/oracle/oradata/orcl/redo04.log
2 '/u01/app/redolog/redo01a.log' to group 1,
3 '/u01/app/redolog/redo02a.log' to group 2,
4 '/u01/app/redolog/redo03a.log' to group 3,
5 '/u01/app/redolog/redo04a.log' to group 4;
Database altered.
GROUP# STATUS MEMBER TYPE
------- ------- -------------------------------------------------- -------
3 /u01/app/oracle/oradata/orcl/redo03.log ONLINE
2 /u01/app/oracle/oradata/orcl/redo02.log ONLINE
1 /u01/app/oracle/oradata/orcl/redo01.log ONLINE
4 /u01/app/oracle/oradata/orcl/redo04.log ONLINE
1 INVALID /u01/app/redolog/redo01a.log ONLINE
2 INVALID /u01/app/redolog/redo02a.log ONLINE
3 INVALID /u01/app/redolog/redo03a.log ONLINE
4 INVALID /u01/app/redolog/redo04a.log ONLINE
8 rows selected.
切換日誌四次之後,狀態為invalid的日誌組成員變為null。
SYS@orcl 09-SEP-14>select group#,status,member,type from v$logfile;
GROUP# STATUS MEMBER TYPE
------- ------- -------------------------------------------------- -------
3 /u01/app/oracle/oradata/orcl/redo03.log ONLINE
2 /u01/app/oracle/oradata/orcl/redo02.log ONLINE
1 /u01/app/oracle/oradata/orcl/redo01.log ONLINE
4 /u01/app/oracle/oradata/orcl/redo04.log ONLINE
1 /u01/app/redolog/redo01a.log ONLINE
2 /u01/app/redolog/redo02a.log ONLINE
3 /u01/app/redolog/redo03a.log ONLINE
4 /u01/app/redolog/redo04a.log ONLINE
8 rows selected.
刪除日誌組成員:(注意,如果這個組裡面只有唯一的一個成員,那麼是不能刪除的)
SYS@orcl 09-SEP-14>alter database drop logfile member
2 '/u01/app/redolog/redo01a.log',
3 '/u01/app/redolog/redo02a.log',
4 '/u01/app/redolog/redo03a.log',
5 '/u01/app/redolog/redo04a.log';
alter database drop logfile member
*
ERROR at line 1:
ORA-01609: log 1 is the current log for thread 1 - cannot drop members
ORA-00312: online log 1 thread 1: '/u01/app/oracle/oradata/orcl/redo01.log'
ORA-00312: online log 1 thread 1: '/u01/app/redolog/redo01a.log'
可以看到例項正在使用的redo log是不能刪除的,於是我們先刪除其他組的成員:
SYS@orcl 09-SEP-14>alter database drop logfile member
2 '/u01/app/redolog/redo02a.log',
3 '/u01/app/redolog/redo03a.log',
4 '/u01/app/redolog/redo04a.log';
Database altered.
接著,我們再切換日誌:
SYS@orcl 09-SEP-14>select group#,sequence#,status from v$log;
GROUP# SEQUENCE# STATUS
------- ---------- ----------------
1 29 CURRENT
2 27 INACTIVE
3 28 INACTIVE
4 26 INACTIVE
SYS@orcl 09-SEP-14>alter system switch logfile;
System altered.
SYS@orcl 09-SEP-14>select group#,sequence#,status from v$log;
GROUP# SEQUENCE# STATUS
------- ---------- ----------------
1 29 ACTIVE
2 27 INACTIVE
3 28 INACTIVE
4 30 CURRENT
再刪除日誌組1的成員redo01a.log:
SYS@orcl 09-SEP-14>alter database drop logfile member
2 '/u01/app/redolog/redo01a.log';
Database altered.
檢視日誌組及日誌組成員資訊:
SYS@orcl 09-SEP-14>select group#,status,type,member from v$logfile;
GROUP# STATUS TYPE MEMBER
------- ------- ------- --------------------------------------------------
3 ONLINE /u01/app/oracle/oradata/orcl/redo03.log
2 ONLINE /u01/app/oracle/oradata/orcl/redo02.log
1 ONLINE /u01/app/oracle/oradata/orcl/redo01.log
4 ONLINE /u01/app/oracle/oradata/orcl/redo04.log
SYS@orcl 09-SEP-14>select group#,status,member,type from v$logfile;
GROUP# STATUS MEMBER TYPE
------- ------- -------------------------------------------------- -------
3 /u01/app/oracle/oradata/orcl/redo03.log ONLINE
2 /u01/app/oracle/oradata/orcl/redo02.log ONLINE
1 /u01/app/oracle/oradata/orcl/redo01.log ONLINE
4 /u01/app/oracle/oradata/orcl/redo04.log ONLINE
1 /u01/app/redolog/redo01a.log ONLINE
2 /u01/app/redolog/redo02a.log ONLINE
3 /u01/app/redolog/redo03a.log ONLINE
4 /u01/app/redolog/redo04a.log ONLINE
8 rows selected.
SYS@orcl 09-SEP-14>alter database drop logfile member
2 '/u01/app/redolog/redo01a.log',
3 '/u01/app/redolog/redo02a.log',
4 '/u01/app/redolog/redo03a.log',
5 '/u01/app/redolog/redo04a.log';
alter database drop logfile member
*
ERROR at line 1:
ORA-01609: log 1 is the current log for thread 1 - cannot drop members
ORA-00312: online log 1 thread 1: '/u01/app/oracle/oradata/orcl/redo01.log'
ORA-00312: online log 1 thread 1: '/u01/app/redolog/redo01a.log'
SYS@orcl 09-SEP-14>alter database drop logfile member
2 '/u01/app/redolog/redo02a.log',
3 '/u01/app/redolog/redo03a.log',
4 '/u01/app/redolog/redo04a.log';
Database altered.
接著,我們再切換日誌:
SYS@orcl 09-SEP-14>select group#,sequence#,status from v$log;
GROUP# SEQUENCE# STATUS
------- ---------- ----------------
1 29 CURRENT
2 27 INACTIVE
3 28 INACTIVE
4 26 INACTIVE
System altered.
SYS@orcl 09-SEP-14>select group#,sequence#,status from v$log;
GROUP# SEQUENCE# STATUS
------- ---------- ----------------
1 29 ACTIVE
2 27 INACTIVE
3 28 INACTIVE
4 30 CURRENT
SYS@orcl 09-SEP-14>alter database drop logfile member
2 '/u01/app/redolog/redo01a.log';
Database altered.
SYS@orcl 09-SEP-14>select group#,status,type,member from v$logfile;
GROUP# STATUS TYPE MEMBER
------- ------- ------- --------------------------------------------------
3 ONLINE /u01/app/oracle/oradata/orcl/redo03.log
2 ONLINE /u01/app/oracle/oradata/orcl/redo02.log
1 ONLINE /u01/app/oracle/oradata/orcl/redo01.log
4 ONLINE /u01/app/oracle/oradata/orcl/redo04.log
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29800581/viewspace-1266379/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Oracle11g redo log 建立、新增、刪除(重做日誌組,重做日誌檔案)Oracle
- Oracle的重做日誌Oracle
- 【備份恢復】 恢復重做日誌組成員
- 重做日誌
- 聯機重做日誌、歸檔日誌、備用重做日誌
- 16、重做日誌檔案的狀態及重做日誌組的狀態說明
- oracle 恢復重做日誌Oracle
- 手工建立多路重做日誌組
- 重做日誌管理
- oracle線上調整重做日誌Oracle
- Oracle重做日誌調整技巧Oracle
- redo重做日誌管理
- 恢復重做日誌
- Oracle重做日誌檔案基礎Oracle
- oracle 聯機重做日誌檔案Oracle
- oracle 11g rac 新增重做日誌檔案Oracle
- MySQL重做日誌(redo log)MySql
- 重做日誌的恢復
- 重做日誌基礎操作
- dml操作重做日誌分析
- Oracle資料庫重做日誌及歸檔日誌的工作原理說明Oracle資料庫
- 【REDO】刪除聯機重做日誌檔案組成員的注意事項
- 修改Oracle重做日誌檔案的大小Oracle
- logmnr分析線上重做日誌
- 重做日誌大小的設定
- 2 Day DBA-管理Oracle例項-管理聯機重做日誌- 多路複用聯機重做日誌Oracle
- oracle基礎練習5章 重做日誌Oracle
- logmnr分析歸檔重做日誌
- 重做日誌檔案中的SCN
- SQL Server重做日誌管理機制SQLServer
- 7.管理重做日誌(筆記)筆記
- 2 Day DBA-管理Oracle例項-管理聯機重做日誌-練習:多路複用聯機重做日誌Oracle
- 新增日誌檔案組與日誌檔案成員
- Oracle Redo(重做日誌) 模擬故障和恢復Oracle Redo
- oracle 修改日誌大小及增加日誌成員Oracle
- 刪除日誌組成員
- Oracle歸檔日誌比聯機重做日誌小很多的情況總結Oracle
- [20170412]分析重做日誌.txt