redo日誌檔案學習筆記(一)
關於redo日誌檔案,今天因為要做redo日誌的線上遷移,所以特意做了個簡單的總結。
1. 如果要把redo的切換資訊顯示到alert日誌中,需要設定個引數。
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> show parameter check
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_block_checking string FALSE
db_block_checksum string TYPICAL
log_checkpoint_interval integer 0
log_checkpoint_timeout integer 1800
log_checkpoints_to_alert boolean FALSE
SQL> alter system set log_checkpoints_to_alert=true;
System altered.
2.檢視redo的情況,current表示當前所屬的redo日誌組。
SQL> select group#,status from v$log;
GROUP# STATUS
---------- ----------------
1 INACTIVE
2 INACTIVE
3 INACTIVE
4 CURRENT
3.強制切換日誌,使用switch logfile,切換後,current日誌組切換到了第一組,剛剛的日誌組4變成了active狀態。 表示dbwr還沒有把髒資料寫入資料檔案。
需要出發dbwr來寫入,或者等待一會兒。
alert日誌內容如下;
--alter system switch logfile;
Mon Mar 24 18:16:46 2014
Beginning log switch checkpoint up to RBA [0xb1d.2.10], SCN: 10583135604156
Thread 1 advanced to log sequence 2845 (LGWR switch)
Current log# 1 seq# 2845 mem# 0: /dbccbsPT1/oracle/PETCUS1/oracnt01/redolog_A1/redo/redo01A.log
Current log# 1 seq# 2845 mem# 1: /dbccbsPT1/oracle/PETCUS1/oracnt02/redolog_B1/redo/redo01B.log
Mon Mar 24 18:16:46 2014
Archived Log entry 2844 added for thread 1 sequence 2844 ID 0x4a0d6000 dest 1:
SQL> select group#,status from v$log;
GROUP# STATUS
---------- ----------------
1 CURRENT
2 INACTIVE
3 INACTIVE
4 ACTIVE
4.再強制切換一次日誌,日誌組繼續切換,可以看到有兩個日誌組成了active,
alert日誌內容如下;
--alter system switch logfile;
Mon Mar 24 18:17:35 2014
Beginning log switch checkpoint up to RBA [0xb1e.2.10], SCN: 10583135604180
Thread 1 advanced to log sequence 2846 (LGWR switch)
Current log# 3 seq# 2846 mem# 0: /dbccbsPT1/oracle/PETCUS1/oracnt01/redolog_A3/redo/redo03A.log
Current log# 3 seq# 2846 mem# 1: /dbccbsPT1/oracle/PETCUS1/oracnt02/redolog_B3/redo/redo03B.log
Mon Mar 24 18:17:35 2014
Archived Log entry 2845 added for thread 1 sequence 2845 ID 0x4a0d6000 dest 1:
SQL> select group#,status from v$log;
GROUP# STATUS
---------- ----------------
1 ACTIVE
2 INACTIVE
3 CURRENT
4 ACTIVE
5.如果進行全量檢查點,強制dbwr寫入資料檔案,可以出發全量檢查點。
alert日誌內容如下:
--alter system checkpoint;
Mon Mar 24 18:18:48 2014
Beginning global checkpoint up to RBA [0xb1e.4c.10], SCN: 10583135604229
Completed checkpoint up to RBA [0xb1e.4c.10], SCN: 10583135604229
Completed checkpoint up to RBA [0xb1e.2.10], SCN: 10583135604180
Completed checkpoint up to RBA [0xb1d.2.10], SCN: 10583135604156
SQL> select group#,status from v$log;
GROUP# STATUS
---------- ----------------
1 INACTIVE
2 INACTIVE
3 CURRENT
4 INACTIVE
6.過了一會兒,可以看到日誌中會出現增量檢查點,增量檢查點的優先順序比全量的要低。
Mon Mar 24 18:19:22 2014
Incremental checkpoint up to RBA [0xb1e.4c.0], current log tail at RBA [0xb1e.5f.0]
7.觸發日誌歸檔
--alter system archive log current;
Mon Mar 24 18:20:51 2014
ALTER SYSTEM ARCHIVE LOG
Mon Mar 24 18:20:51 2014
Beginning log switch checkpoint up to RBA [0xb1f.2.10], SCN: 10583135604443
Thread 1 advanced to log sequence 2847 (LGWR switch)
Current log# 2 seq# 2847 mem# 0: /dbccbsPT1/oracle/PETCUS1/oracnt01/redolog_A2/redo/redo02A.log
Current log# 2 seq# 2847 mem# 1: /dbccbsPT1/oracle/PETCUS1/oracnt02/redolog_B2/redo/redo02B.log
Archived Log entry 2846 added for thread 1 sequence 2846 ID 0x4a0d6000 dest 1:
SQL> select group#,status from v$log;
GROUP# STATUS
---------- ----------------
1 INACTIVE
2 CURRENT
3 ACTIVE
4 INACTIVE
和alter system switch logfile的差別在於,對於日誌組3,執行alter system archive log current和alter system switch logfile會有所不同
GROUP# THREAD# SEQUENCE# MEMBERS SIZE_MB ARC STATUS
---------- ---------- ---------- ---------- ---------- --- ----------------
1 1 685 2 2048 YES ACTIVE
2 1 686 2 2048 YES ACTIVE
3 1 687 2 2048 NO ACTIVE
4 1 688 2 2048 NO CURRENT
1. 如果要把redo的切換資訊顯示到alert日誌中,需要設定個引數。
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> show parameter check
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_block_checking string FALSE
db_block_checksum string TYPICAL
log_checkpoint_interval integer 0
log_checkpoint_timeout integer 1800
log_checkpoints_to_alert boolean FALSE
SQL> alter system set log_checkpoints_to_alert=true;
System altered.
2.檢視redo的情況,current表示當前所屬的redo日誌組。
SQL> select group#,status from v$log;
GROUP# STATUS
---------- ----------------
1 INACTIVE
2 INACTIVE
3 INACTIVE
4 CURRENT
3.強制切換日誌,使用switch logfile,切換後,current日誌組切換到了第一組,剛剛的日誌組4變成了active狀態。 表示dbwr還沒有把髒資料寫入資料檔案。
需要出發dbwr來寫入,或者等待一會兒。
alert日誌內容如下;
--alter system switch logfile;
Mon Mar 24 18:16:46 2014
Beginning log switch checkpoint up to RBA [0xb1d.2.10], SCN: 10583135604156
Thread 1 advanced to log sequence 2845 (LGWR switch)
Current log# 1 seq# 2845 mem# 0: /dbccbsPT1/oracle/PETCUS1/oracnt01/redolog_A1/redo/redo01A.log
Current log# 1 seq# 2845 mem# 1: /dbccbsPT1/oracle/PETCUS1/oracnt02/redolog_B1/redo/redo01B.log
Mon Mar 24 18:16:46 2014
Archived Log entry 2844 added for thread 1 sequence 2844 ID 0x4a0d6000 dest 1:
SQL> select group#,status from v$log;
GROUP# STATUS
---------- ----------------
1 CURRENT
2 INACTIVE
3 INACTIVE
4 ACTIVE
4.再強制切換一次日誌,日誌組繼續切換,可以看到有兩個日誌組成了active,
alert日誌內容如下;
--alter system switch logfile;
Mon Mar 24 18:17:35 2014
Beginning log switch checkpoint up to RBA [0xb1e.2.10], SCN: 10583135604180
Thread 1 advanced to log sequence 2846 (LGWR switch)
Current log# 3 seq# 2846 mem# 0: /dbccbsPT1/oracle/PETCUS1/oracnt01/redolog_A3/redo/redo03A.log
Current log# 3 seq# 2846 mem# 1: /dbccbsPT1/oracle/PETCUS1/oracnt02/redolog_B3/redo/redo03B.log
Mon Mar 24 18:17:35 2014
Archived Log entry 2845 added for thread 1 sequence 2845 ID 0x4a0d6000 dest 1:
SQL> select group#,status from v$log;
GROUP# STATUS
---------- ----------------
1 ACTIVE
2 INACTIVE
3 CURRENT
4 ACTIVE
5.如果進行全量檢查點,強制dbwr寫入資料檔案,可以出發全量檢查點。
alert日誌內容如下:
--alter system checkpoint;
Mon Mar 24 18:18:48 2014
Beginning global checkpoint up to RBA [0xb1e.4c.10], SCN: 10583135604229
Completed checkpoint up to RBA [0xb1e.4c.10], SCN: 10583135604229
Completed checkpoint up to RBA [0xb1e.2.10], SCN: 10583135604180
Completed checkpoint up to RBA [0xb1d.2.10], SCN: 10583135604156
SQL> select group#,status from v$log;
GROUP# STATUS
---------- ----------------
1 INACTIVE
2 INACTIVE
3 CURRENT
4 INACTIVE
6.過了一會兒,可以看到日誌中會出現增量檢查點,增量檢查點的優先順序比全量的要低。
Mon Mar 24 18:19:22 2014
Incremental checkpoint up to RBA [0xb1e.4c.0], current log tail at RBA [0xb1e.5f.0]
7.觸發日誌歸檔
--alter system archive log current;
Mon Mar 24 18:20:51 2014
ALTER SYSTEM ARCHIVE LOG
Mon Mar 24 18:20:51 2014
Beginning log switch checkpoint up to RBA [0xb1f.2.10], SCN: 10583135604443
Thread 1 advanced to log sequence 2847 (LGWR switch)
Current log# 2 seq# 2847 mem# 0: /dbccbsPT1/oracle/PETCUS1/oracnt01/redolog_A2/redo/redo02A.log
Current log# 2 seq# 2847 mem# 1: /dbccbsPT1/oracle/PETCUS1/oracnt02/redolog_B2/redo/redo02B.log
Archived Log entry 2846 added for thread 1 sequence 2846 ID 0x4a0d6000 dest 1:
SQL> select group#,status from v$log;
GROUP# STATUS
---------- ----------------
1 INACTIVE
2 CURRENT
3 ACTIVE
4 INACTIVE
和alter system switch logfile的差別在於,對於日誌組3,執行alter system archive log current和alter system switch logfile會有所不同
GROUP# THREAD# SEQUENCE# MEMBERS SIZE_MB ARC STATUS
---------- ---------- ---------- ---------- ---------- --- ----------------
1 1 685 2 2048 YES ACTIVE
2 1 686 2 2048 YES ACTIVE
3 1 687 2 2048 NO ACTIVE
4 1 688 2 2048 NO CURRENT
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/23718752/viewspace-1128739/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Go學習筆記-Zap日誌Go筆記
- struts 日誌包(學習筆記)筆記
- 【轉】oracle學習筆記(三)之檢查Oracle的告警日誌檔案Oracle筆記
- 修改online redo日誌檔案大小
- Laravel8學習筆記-日誌元件Laravel筆記元件
- 【redo】日誌檔案的丟失解決方法
- 【REDO】刪除REDO LOG重做日誌組後需要手工刪除對應的日誌檔案
- 【REDO】重做日誌檔案(redo log files)管理(增,刪,改,查,切)
- MySQL提升筆記(3)日誌檔案詳解MySql筆記
- 記錄日誌檔案
- redo log日誌挖掘(一)
- Spring Boot 學習筆記(5):日誌配置Spring Boot筆記
- 【恢復】Redo日誌檔案丟失的恢復
- oracle聯機日誌檔案REDO LOGFILE簡述Oracle
- DG學習筆記(5)_Standby Redo Log筆記
- Java學習筆記之檔案Java筆記
- VC++學習筆記---配置檔案(一) ini檔案和propritiesC++筆記
- Laravel 學習筆記一: 專案框架和配置檔案Laravel筆記框架
- win8 學習筆記二 輸出日誌筆記
- REDO日誌損壞,非歸檔模式資料檔案恢復模式
- 日誌模組(一標頭檔案就實現了日誌記錄)
- Object C學習筆記25-檔案管理(一)Object筆記
- Oracle11g redo log 建立、新增、刪除(重做日誌組,重做日誌檔案)Oracle
- REDO日誌管理
- 每天產生REDO歸檔日誌量
- 【REDO】Oracle 日誌挖掘,分析歸檔日誌線上日誌主要步驟Oracle
- DVWA-檔案包含學習筆記筆記
- 【C#學習筆記】讀檔案C#筆記
- 【C#學習筆記】寫檔案C#筆記
- 學習筆記:robots.txt檔案筆記
- 8.管理歸檔日誌(筆記)筆記
- Oracle redo日誌內容探索(一)Oracle Redo
- UI自動化學習筆記- 日誌相關操作UI筆記
- Java小白的學習日記一(自用筆記)Java筆記
- 記錄一則clear重做日誌檔案的案例
- Laravel 指定日誌檔案記錄任意日誌Laravel
- redo日誌損壞
- redo重做日誌管理