【rac】實驗四:增加日誌組
1. 準備工作
1.1. 檢視日誌組基本情況
[oracle@rac1 ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Sat Oct 29 18:46:28 2016
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
SYS@RACDB1>
SYS@RACDB1>select group#,thread#,members,status,bytes/1024/1024 size_m from v$log;
GROUP# THREAD# MEMBERS STATUS SIZE_M
---------- ---------- ---------- ---------------- ----------
1 1 2 CURRENT 50
2 1 2 INACTIVE 50
3 2 2 INACTIVE 50
4 2 2 CURRENT 50
1.2. 檢視日誌成員路徑
SYS@RACDB1>col member for a50
SYS@RACDB1>select group#,member from v$logfile order by 1;
GROUP# MEMBER
---------- --------------------------------------------------
1 +FRA/racdb/onlinelog/group_1.257.926529029
1 +DATA/racdb/onlinelog/group_1.261.926529029
2 +FRA/racdb/onlinelog/group_2.258.926529029
2 +DATA/racdb/onlinelog/group_2.262.926529029
3 +DATA/racdb/onlinelog/group_3.266.926529301
3 +FRA/racdb/onlinelog/group_3.259.926529301
4 +DATA/racdb/onlinelog/group_4.267.926529301
4 +FRA/racdb/onlinelog/group_4.260.926529301
8 rows selected.
2. 增加日誌組
SYS@RACDB1>alter database add logfile thread 1 group 5 '+DATA' size 50m;
Database altered.
SYS@RACDB1>alter database add logfile thread 1 group 6 '+DATA' size 50m;
Database altered.
SYS@RACDB1>alter database add logfile thread 2 group 7 '+DATA' size 50m;
Database altered.
SYS@RACDB1>alter database add logfile thread 2 group 8 '+DATA' size 50m;
Database altered.
SYS@RACDB1>select group#,thread#,members,status,bytes/1024/1024 size_m from v$log order by 1,2;
GROUP# THREAD# MEMBERS STATUS SIZE_M
---------- ---------- ---------- ---------------- ----------
1 1 2 CURRENT 50
2 1 2 INACTIVE 50
3 2 2 INACTIVE 50
4 2 2 CURRENT 50
5 1 1 UNUSED 50
6 1 1 UNUSED 50
7 2 1 UNUSED 50
8 2 1 UNUSED 50
8 rows selected.
SYS@RACDB1>select group#,member from v$logfile order by 1 ;
GROUP# MEMBER
---------- --------------------------------------------------
1 +DATA/racdb/onlinelog/group_1.261.926529029
1 +FRA/racdb/onlinelog/group_1.257.926529029
2 +DATA/racdb/onlinelog/group_2.262.926529029
2 +FRA/racdb/onlinelog/group_2.258.926529029
3 +DATA/racdb/onlinelog/group_3.266.926529301
3 +FRA/racdb/onlinelog/group_3.259.926529301
4 +DATA/racdb/onlinelog/group_4.267.926529301
4 +FRA/racdb/onlinelog/group_4.260.926529301
5 +DATA/racdb/onlinelog/group_5.272.926535655
6 +DATA/racdb/onlinelog/group_6.269.926535221
7 +DATA/racdb/onlinelog/group_7.270.926535251
GROUP# MEMBER
---------- --------------------------------------------------
8 +DATA/racdb/onlinelog/group_8.271.926535323
12 rows selected.
3. 刪除日誌組
刪除一節點的 1 號日誌組, 刪除二節點的 3 號日誌組
1) 檢視日誌組的狀態,
發現 1 號日誌組的狀態為 CURRENT
SYS@RACDB1>select group#,thread#,members,status,bytes/1024/1024 size_m from v$log order by 1,2;
GROUP# THREAD# MEMBERS STATUS SIZE_M
---------- ---------- ---------- ---------------- ----------
1 1 2 CURRENT 50
2 1 2 INACTIVE 50
3 2 2 INACTIVE 50
4 2 2 CURRENT 50
5 1 1 UNUSED 50
6 1 1 UNUSED 50
7 2 1 UNUSED 50
8 2 1 UNUSED 50
8 rows selected.
2) 手工切換一下日誌組, 檢視日誌組狀態, 狀態為 ACTIVE
SYS@RACDB1>alter system switch logfile;
System altered.
SYS@RACDB1>select group#,thread#,members,status,bytes/1024/1024 size_m from v$log order by 1,2;
GROUP# THREAD# MEMBERS STATUS SIZE_M
---------- ---------- ---------- ---------------- ----------
1 1 2 ACTIVE 50
2 1 2 INACTIVE 50
3 2 2 INACTIVE 50
4 2 2 CURRENT 50
5 1 1 CURRENT 50
6 1 1 UNUSED 50
7 2 1 UNUSED 50
8 2 1 UNUSED 50
8 rows selected.
3) 日誌組的狀態為 ACTIVE 時, 說明在例項恢復時需要這個日誌組, 所以不能刪除, 手工執行檢查點事件, 使其日誌組狀態變為 INACTIVE
SYS@RACDB1>alter system checkpoint;
System altered.
SYS@RACDB1>select group#,thread#,members,status,bytes/1024/1024 size_m from v$log order by 1,2;
GROUP# THREAD# MEMBERS STATUS SIZE_M
---------- ---------- ---------- ---------------- ----------
1 1 2 INACTIVE 50
2 1 2 INACTIVE 50
3 2 2 INACTIVE 50
4 2 2 CURRENT 50
5 1 1 CURRENT 50
6 1 1 UNUSED 50
7 2 1 UNUSED 50
8 2 1 UNUSED 50
8 rows selected.
4) 刪除 1 號日誌組
SYS@RACDB1>alter database drop logfile group 1;
Database altered.
SYS@RACDB1>select group#,thread#,members,status,bytes/1024/1024 size_m from v$log order by 1,2;
GROUP# THREAD# MEMBERS STATUS SIZE_M
---------- ---------- ---------- ---------------- ----------
2 1 2 INACTIVE 50
3 2 2 INACTIVE 50
4 2 2 CURRENT 50
5 1 1 CURRENT 50
6 1 1 UNUSED 50
7 2 1 UNUSED 50
8 2 1 UNUSED 50
7 rows selected.
5) 刪除 3 號日誌組
SYS@RACDB1>alter database drop logfile group 3;
Database altered.
SYS@RACDB1>select group#,thread#,members,status,bytes/1024/1024 size_m from v$log order by 1,2;
GROUP# THREAD# MEMBERS STATUS SIZE_M
---------- ---------- ---------- ---------------- ----------
2 1 2 INACTIVE 50
4 2 2 CURRENT 50
5 1 1 CURRENT 50
6 1 1 UNUSED 50
7 2 1 UNUSED 50
8 2 1 UNUSED 50
6 rows selected.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/31397003/viewspace-2128194/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 【rac】實驗三:增加日誌組成員
- 10G DATAGUARD增加REDO日誌組、刪除日誌組、刪除日誌成員實驗
- ORACLE 11G RAC 增加日誌組及增大日誌檔案Oracle
- 【rac】實驗二:增加控制檔案
- 在ASM下增加一個日誌組成員ASM
- RAC環境下的redo日誌組重建
- 7.增加日誌
- 線上修改REDO LOG的大小及增加新的日誌組
- 簡述oracle日誌組的四種狀態Oracle
- rac日誌收集方法
- 【kingsql分享】RAC擴大online日誌組大小SQL
- Oracle日誌組新增冗餘檔案和日誌組Oracle
- 11月26實驗室日誌
- 11g rac 日誌
- oracle 修改日誌大小及增加日誌成員Oracle
- 日誌追蹤:log增加traceId
- 對日誌檔案組和日誌檔案組成員的管理
- Oracle 11g RAC檢視ASM日誌、grid日誌和DB日誌OracleASM
- RAC 開啟歸檔日誌
- RAC 11g的日誌
- ORACLE RAC 日誌結構解析Oracle
- RAC的告警日誌檔案
- 網格RAC基礎日誌
- oracle中清空日誌組Oracle
- 增加日誌檔案,修改當前日誌檔案大小
- 日誌第四天
- 關於Oracle12C rac DDL日誌的測試驗證Oracle
- Logminer簡單分析日誌的實驗
- 聯機日誌損壞恢復實驗
- redo日誌組資訊查詢
- 線上重建redo log日誌組
- 刪除日誌組成員
- 手工建立多路重做日誌組
- Physical Standby上開啟flashback database實驗日誌Database
- 【RAC】RAC環境下歸檔日誌格式約定
- go fiber: 增加訪問日誌accesslogGo
- 刪除重做日誌檔案組的四大限制條件
- 為oracle新增重做日誌組及重做日誌成員Oracle