[20131028]理解archivelog completed,before,after,until-time.txt
[20131028]理解archivelog completed,before,after,until-time.txt
理解在執行rman的"DELETE ARCHIVELOG ALL COMPLETED BEFORE" 與 "DELETE ARCHIVELOG UNTIL TIME "的區別.
RMAN> list archivelog all ;
...
498 1 555 A 2013-10-25 11:32:09
Name: /u01/app/oracle11g/archivelog/1_555_798551880.dbf
499 1 556 A 2013-10-25 11:32:15
Name: /u01/app/oracle11g/archivelog/1_556_798551880.dbf
500 1 557 A 2013-10-28 08:58:36
Name: /u01/app/oracle11g/archivelog/1_557_798551880.dbf
501 1 558 A 2013-10-28 10:09:22
Name: /u01/app/oracle11g/archivelog/1_558_798551880.dbf
--刪除一些記錄:
RMAN> delete archivelog sequence between 1 and 555;
RMAN> list archivelog all ;
List of Archived Log Copies for database with db_unique_name TEST
=====================================================================
Key Thrd Seq S Low Time
------- ---- ------- - -------------------
499 1 556 A 2013-10-25 11:32:15
Name: /u01/app/oracle11g/archivelog/1_556_798551880.dbf
500 1 557 A 2013-10-28 08:58:36
Name: /u01/app/oracle11g/archivelog/1_557_798551880.dbf
501 1 558 A 2013-10-28 10:09:22
Name: /u01/app/oracle11g/archivelog/1_558_798551880.dbf
--僅僅保留3個。
摘要:
Summary :
UNTIL TIME的TIME 指的是 ARCHIVELOG的FIRST_TIME ,即歸檔日誌中LOW SCN對應的時間戳;其意思為找出所有LOW SCN TIMESTAMP小於
等於指定的時間變數的歸檔日誌。
COMPLETED BEFORE 指的是ARCHIVELOG的COMPLETION_TIME,即實際歸檔操作完成的時間;其意思為找出所有歸檔完成時間小於指定的時
間變數的歸檔日誌。
COMPLETED AFTER 指的是ARCHIVELOG的COMPLETION_TIME,即實際歸檔操作完成的時間;其意思為找出所有歸檔完成時間大於等於指定
的時間變數的歸檔日誌。
--我的環境定義如下:
$ env | grep NLS
NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
NLS_TIMESTAMP_TZ_FORMAT=YYYY-MM-DD HH24:MI:SS.FF
NLS_TIMESTAMP_FORMAT=YYYY-MM-DD HH24:MI:SS.FF
NLS_DATE_FORMAT=YYYY-MM-DD HH24:MI:SS
--不然下面的日期時間不能這樣寫!
RMAN> list archivelog until time '2013-10-25 11:32:16';
List of Archived Log Copies for database with db_unique_name TEST
=====================================================================
Key Thrd Seq S Low Time
------- ---- ------- - -------------------
499 1 556 A 2013-10-25 11:32:15
Name: /u01/app/oracle11g/archivelog/1_556_798551880.dbf
RMAN> list archivelog all completed before '2013-10-25 11:32:16';
RMAN> list archivelog all completed before '2013-10-28 08:58:36';
RMAN> list archivelog all completed before '2013-10-28 08:58:37';
RMAN> list archivelog all completed before '2013-10-28 08:58:38';
List of Archived Log Copies for database with db_unique_name TEST
=====================================================================
Key Thrd Seq S Low Time
------- ---- ------- - -------------------
499 1 556 A 2013-10-25 11:32:15
Name: /u01/app/oracle11g/archivelog/1_556_798551880.dbf
--before '2013-10-28 08:58:38' 這樣seq=556才顯示出來。
--這樣的話:
delete archivelog until time '2013-10-25 11:32:16'; =>可以刪除seq=556的記錄。
delete archivelog all completed before '2013-10-28 08:58:38'; =>可以刪除seq=556的記錄。
理解在執行rman的"DELETE ARCHIVELOG ALL COMPLETED BEFORE" 與 "DELETE ARCHIVELOG UNTIL TIME "的區別.
RMAN> list archivelog all ;
...
498 1 555 A 2013-10-25 11:32:09
Name: /u01/app/oracle11g/archivelog/1_555_798551880.dbf
499 1 556 A 2013-10-25 11:32:15
Name: /u01/app/oracle11g/archivelog/1_556_798551880.dbf
500 1 557 A 2013-10-28 08:58:36
Name: /u01/app/oracle11g/archivelog/1_557_798551880.dbf
501 1 558 A 2013-10-28 10:09:22
Name: /u01/app/oracle11g/archivelog/1_558_798551880.dbf
--刪除一些記錄:
RMAN> delete archivelog sequence between 1 and 555;
RMAN> list archivelog all ;
List of Archived Log Copies for database with db_unique_name TEST
=====================================================================
Key Thrd Seq S Low Time
------- ---- ------- - -------------------
499 1 556 A 2013-10-25 11:32:15
Name: /u01/app/oracle11g/archivelog/1_556_798551880.dbf
500 1 557 A 2013-10-28 08:58:36
Name: /u01/app/oracle11g/archivelog/1_557_798551880.dbf
501 1 558 A 2013-10-28 10:09:22
Name: /u01/app/oracle11g/archivelog/1_558_798551880.dbf
SCOTT@test> SELECT recid, first_time, next_time, completion_time FROM v$archived_log where recid between 499 and 501;
RECID FIRST_TIME NEXT_TIME COMPLETION_TIME
---------- ------------------- ------------------- -------------------
499 2013-10-25 11:32:15 2013-10-28 08:58:36 2013-10-28 08:58:38
500 2013-10-28 08:58:36 2013-10-28 10:09:22 2013-10-28 10:09:23
501 2013-10-28 10:09:22 2013-10-28 16:23:13 2013-10-28 16:23:14
--僅僅保留3個。
摘要:
Summary :
UNTIL TIME的TIME 指的是 ARCHIVELOG的FIRST_TIME ,即歸檔日誌中LOW SCN對應的時間戳;其意思為找出所有LOW SCN TIMESTAMP小於
等於指定的時間變數的歸檔日誌。
COMPLETED BEFORE 指的是ARCHIVELOG的COMPLETION_TIME,即實際歸檔操作完成的時間;其意思為找出所有歸檔完成時間小於指定的時
間變數的歸檔日誌。
COMPLETED AFTER 指的是ARCHIVELOG的COMPLETION_TIME,即實際歸檔操作完成的時間;其意思為找出所有歸檔完成時間大於等於指定
的時間變數的歸檔日誌。
--我的環境定義如下:
$ env | grep NLS
NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
NLS_TIMESTAMP_TZ_FORMAT=YYYY-MM-DD HH24:MI:SS.FF
NLS_TIMESTAMP_FORMAT=YYYY-MM-DD HH24:MI:SS.FF
NLS_DATE_FORMAT=YYYY-MM-DD HH24:MI:SS
--不然下面的日期時間不能這樣寫!
RMAN> list archivelog until time '2013-10-25 11:32:16';
List of Archived Log Copies for database with db_unique_name TEST
=====================================================================
Key Thrd Seq S Low Time
------- ---- ------- - -------------------
499 1 556 A 2013-10-25 11:32:15
Name: /u01/app/oracle11g/archivelog/1_556_798551880.dbf
RMAN> list archivelog all completed before '2013-10-25 11:32:16';
RMAN> list archivelog all completed before '2013-10-28 08:58:36';
RMAN> list archivelog all completed before '2013-10-28 08:58:37';
RMAN> list archivelog all completed before '2013-10-28 08:58:38';
List of Archived Log Copies for database with db_unique_name TEST
=====================================================================
Key Thrd Seq S Low Time
------- ---- ------- - -------------------
499 1 556 A 2013-10-25 11:32:15
Name: /u01/app/oracle11g/archivelog/1_556_798551880.dbf
--before '2013-10-28 08:58:38' 這樣seq=556才顯示出來。
--這樣的話:
delete archivelog until time '2013-10-25 11:32:16'; =>可以刪除seq=556的記錄。
delete archivelog all completed before '2013-10-28 08:58:38'; =>可以刪除seq=556的記錄。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/267265/viewspace-775193/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 理解偽元素 :before 和 :after
- CSS 巧用 :before和:afterCSS
- CSS巧用:before和:afterCSS
- css偽元素(before與after)CSS
- 偽元素 before 和 after 初探
- 歸檔日誌until time和Completed、Before區別
- 對“checkpoint not completed!”的理解 (zt)
- before-after-hook鉤子函式Hook函式
- JUnit4 中@AfterClass @BeforeClass @after @before的區別對比
- css當中:before和:after選擇器CSS
- ::after和::before 要配合content屬性
- flask 中的before_request 與 after_requFlask
- CSS-選擇器15-:before與:afterCSS
- js如何控制css偽元素內容(before,after)JSCSS
- css中的:before與:after的簡單使用CSS
- 理解使用before,after偽類實現小三角形氣泡框
- 瞭解css中偽元素 before和after的用法CSS
- jquery中append、prepend, before和after方法的區別jQueryAPP
- css after和before選擇器使用程式碼例項CSS
- [Shell] get after|before year,month,day,week,hour,minute,second
- 關於Oralce Trigger中before、after的區別
- Java中單元測試中:@BeforeClass,@Before,@Test,@After,@AfterClass中的問題詳解Java
- 理解RMAN backup database plus archivelog命令DatabaseHive
- css3偽元素選擇器before 和 after 的使用CSSS3
- javascript獲取偽物件before和after定義的內容JavaScript物件
- mysql觸發器案例分析以及before和after的區別MySql觸發器
- 使用jiffies的時間比較函式time_after、time_before函式
- Spring Cloud Gateway 路由轉發之After(Before)路由斷言工廠使用SpringCloudGateway路由
- ::after和::before偽元素選擇器必須要配合content屬性
- 理解RMAN backup database plus archivelog delete all input命令DatabaseHivedelete
- 使用@AutoConfigureBefore、After、Order調整Spring Boot自動配置順序Spring Boot
- 利用:before和:after偽類製作CSS3 圓形按鈕 含demoCSSS3
- 05.深入理解JMM和Happens-BeforeAPP
- 偽類選擇器:愛恨法則;偽元素選擇器:before,after;清除浮動
- Jest 測試框架 beforeEach 的設計原理解析框架
- Restore ArchivelogRESTHive
- WPF Backgroundworker dowork work completed progress changed
- Delete Dataguard ArchivelogdeleteHive