【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日誌收集方法
- mybaits原始碼分析--日誌模組(四)AI原始碼
- 日誌追蹤:log增加traceId
- 11月26實驗室日誌
- 日誌模組
- go fiber: 增加訪問日誌accesslogGo
- 日誌篇:模組日誌總體介紹
- RAC 增加SCAN IP
- oracle rac 增加磁碟Oracle
- 日誌第四天
- [20211105]索引分裂 塊清除 日誌增加.txt索引
- oracle rac+adg調整redo日誌組導致adg備庫ogg抽取程式abendOracle
- Apache Camel日誌四種方法Apache
- (四)Logstash收集、解析日誌方法
- 日誌記錄模組logging
- SpringAop實現許可權校驗與日誌列印Spring
- Python 日誌庫 logging 的理解和實踐經驗Python
- 實訓日誌
- ArgoWorkflow教程(四)---Workflow & 日誌歸檔Go
- 實驗四
- nodejs 日誌模組 winston 的使用NodeJS
- [20211105]索引分裂塊清除日誌增加(唯一索引).txt索引
- 『無為則無心』Python日誌 — 65、日誌模組logging的使用Python
- SpringBoot日誌實現Spring Boot
- 日誌最佳實踐
- Django基礎之四(日誌)【待續】Django
- iman——衝刺日誌(第四天)
- MySQL四種日誌binlog/redolog/relaylog/undologMySql
- oracle 12C RAC 12.1.0.2 叢集日誌(cluster log)目錄Oracle
- Oracle實驗6--掌握Oracle資料庫的日誌操作Oracle資料庫
- 『無為則無心』Python日誌 — 67、logging日誌模組處理流程Python
- 『無為則無心』Python日誌 — 64、Python日誌模組logging介紹Python
- Oracle RAC一鍵部署003(使用者組校驗)Oracle
- python-包及日誌模組使用Python
- python之logging日誌模組詳解Python
- Python:使用logging模組記錄日誌Python
- Python強大的日誌模組loggingPython
- 日誌服務 HarmonyOS NEXT 日誌採集最佳實踐
- 智慧線上客服系統原始碼GOFLY開發日誌- 4. gin框架增加日誌中介軟體原始碼Go框架