10G/11G/12cr1版本中backup archivelog命令是否會觸發歸檔current logfile操作
被同事指出備份指令碼中缺少手動切換日誌的命令,事實上在10G及以上版本已經不需要此在指令碼中加上此語句。主要通過查閱官方文件及實驗,驗證10G/11G/12cr1版本中backup archivelog命令是否會觸發歸檔current logfile操作。
結果如下;如果資料庫在OPEN狀態,執行BACKUP ARCHIVELOG命令時,如果不使用UNTIL/SEQUENCE關鍵字,會自動執行日誌切換命令。
參考官方文件中描述:http://docs.oracle.com/cd/E11882_01/backup.112/e10643/rcmsynta007.htm#CHDCFGEI
http://docs.oracle.com/database/121/RCMRF/rcmsynta006.htm
If the database is open when you run BACKUP ARCHIVELOG, and if the UNTIL clause or SEQUENCE parameter is not specified, then RMAN runs ALTER SYSTEM ARCHIVE LOG CURRENT. ---這一句,如果資料庫在OPEN狀態,執行BACKUP ARCHIVELOG命令時,如果不使用UNTIL/SEQUENCE關鍵字,會執行日誌切換命令。
Note: If you run BACKUP ARCHIVELOG ALL, or if the specified log range includes logs from prior incarnations, then RMAN backs up logs from prior incarnations to ensure availability of all logs that may be required for recovery through an OPEN RESETLOGS.
----------------------------------
以下以11.2.0.4版本驗證:
開始備份操作:
[oracle@bys1 ~]$ rman target /
Recovery Manager: Release 11.2.0.4.0 - Production on Sat Jan 21 18:04:53 2017
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: BYS1 (DBID=4052277609)
RMAN> backup archivelog from time 'sysdate-1' format '/home/orcale/arch_%d_%t_%s.bak';
Starting backup at 2017/01/21 18:04:55 ------------>備份命令開始時間,與ALERT日誌中可以對應。
current log archived ------------>這句輸出可以發現是做了current redolog的歸檔;
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=58 device type=DISK
觀察ALERT日誌:
Sat Jan 21 18:02:20 2017
ALTER SYSTEM ARCHIVE LOG
Sat Jan 21 18:02:20 2017
Thread 1 advanced to log sequence 99 (LGWR switch)
Current log# 3 seq# 99 mem# 0: /u01/app/oradata/bys1/redo03.log
Sat Jan 21 18:02:20 2017
Archived Log entry 131 added for thread 1 sequence 98 ID 0xf1898b69 dest 1:
Sat Jan 21 18:04:55 2017 ------------>ALTER SYSTEM ARCHIVE LOG命令執行時間,與備份時輸出可以對應。
ALTER SYSTEM ARCHIVE LOG
Sat Jan 21 18:04:55 2017
Thread 1 advanced to log sequence 100 (LGWR switch)
Current log# 1 seq# 100 mem# 0: /u01/app/oradata/bys1/redo01.log
Sat Jan 21 18:04:56 2017
Archived Log entry 132 added for thread 1 sequence 99 ID 0xf1898b69 dest 1:
---------------------11GR2 RAC環境的驗證--在任意節點上執行兩個節點都進行切換
RAC節點1執行備份backup archivelog操作
[oracle@bys1 ~]$ rman target /
Recovery Manager: Release 11.2.0.4.0 - Production on Tue Feb 7 12:06:02 2017
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: BYSRAC (DBID=2682487210)
RMAN> backup archivelog from time 'sysdate-1/12' format '/home/oracle/arch_%d_%t_%s.bak';
Starting backup at 20170207 12:06:29
current log archived
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=32 instance=bysrac1 device type=DISK
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=49 RECID=79 STAMP=935323590
input archived log thread=2 sequence=34 RECID=80 STAMP=935323591
channel ORA_DISK_1: starting piece 1 at 20170207 12:06:39
channel ORA_DISK_1: finished piece 1 at 20170207 12:06:40
piece handle=/home/oracle/arch_BYSRAC_935323599_3.bak tag=TAG20170207T120639 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 20170207 12:06:40
RMAN> backup archivelog from time 'sysdate-1/12' format '/home/oracle/arch_%d_%t_%s.bak';
Starting backup at 20170207 12:08:32
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=49 RECID=79 STAMP=935323590
input archived log thread=2 sequence=34 RECID=80 STAMP=935323591
input archived log thread=1 sequence=50 RECID=81 STAMP=935323713
input archived log thread=2 sequence=35 RECID=82 STAMP=935323713
channel ORA_DISK_1: starting piece 1 at 20170207 12:08:36
channel ORA_DISK_1: finished piece 1 at 20170207 12:08:37
piece handle=/home/oracle/arch_BYSRAC_935323716_4.bak tag=TAG20170207T120835 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 20170207 12:08:37
觀察兩個節點的ALERT日誌:
節點1
Tue Feb 07 12:06:29 2017
ALTER SYSTEM ARCHIVE LOG
Tue Feb 07 12:06:30 2017
Thread 1 advanced to log sequence 50 (LGWR switch)
Current log# 2 seq# 50 mem# 0: +DATA/bysrac/onlinelog/group_2.258.927541487
Current log# 2 seq# 50 mem# 1: +DATA/bysrac/onlinelog/group_2.257.927541487
Tue Feb 07 12:06:30 2017
Archived Log entry 79 added for thread 1 sequence 49 ID 0x9fe402a6 dest 1:
Tue Feb 07 12:08:32 2017
ALTER SYSTEM ARCHIVE LOG
Tue Feb 07 12:08:33 2017
Thread 1 advanced to log sequence 51 (LGWR switch)
Current log# 1 seq# 51 mem# 0: +DATA/bysrac/onlinelog/group_1.267.927541485
Current log# 1 seq# 51 mem# 1: +DATA/bysrac/onlinelog/group_1.259.927541485
Tue Feb 07 12:08:33 2017
Archived Log entry 81 added for thread 1 sequence 50 ID 0x9fe402a6 dest 1:
節點2
Tue Feb 07 12:06:30 2017
Thread 2 advanced to log sequence 35 (LGWR switch)
Current log# 3 seq# 35 mem# 0: +DATA/bysrac/onlinelog/group_3.261.927541697
Current log# 3 seq# 35 mem# 1: +DATA/bysrac/onlinelog/group_3.269.927541699
Tue Feb 07 12:06:31 2017
Archived Log entry 80 added for thread 2 sequence 34 ID 0x9fe402a6 dest 1:
Tue Feb 07 12:08:33 2017
Thread 2 advanced to log sequence 36 (LGWR switch)
Current log# 4 seq# 36 mem# 0: +DATA/bysrac/onlinelog/group_4.270.927541701
Current log# 4 seq# 36 mem# 1: +DATA/bysrac/onlinelog/group_4.271.927541701
Tue Feb 07 12:08:33 2017
Archived Log entry 82 added for thread 2 sequence 35 ID 0x9fe402a6 dest 1:
檢視備份集資訊
RMAN> list backup of archivelog all;
List of Backup Sets
===================
BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ -----------------
3 3.00K DISK 00:00:00 20170207 12:06:39
BP Key: 3 Status: AVAILABLE Compressed: NO Tag: TAG20170207T120639
Piece Name: /home/oracle/arch_BYSRAC_935323599_3.bak
List of Archived Logs in backup set 3
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- ----------------- ---------- ---------
1 49 2344159 20170207 12:04:32 2344293 20170207 12:06:30
2 34 2344163 20170207 12:04:33 2344297 20170207 12:06:30
BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ -----------------
4 4.50K DISK 00:00:00 20170207 12:08:36
BP Key: 4 Status: AVAILABLE Compressed: NO Tag: TAG20170207T120835
Piece Name: /home/oracle/arch_BYSRAC_935323716_4.bak
List of Archived Logs in backup set 4
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- ----------------- ---------- ---------
1 49 2344159 20170207 12:04:32 2344293 20170207 12:06:30
1 50 2344293 20170207 12:06:30 2344410 20170207 12:08:33
2 34 2344163 20170207 12:04:33 2344297 20170207 12:06:30
2 35 2344297 20170207 12:06:30 2344414 20170207 12:08:33
相關文章
- ALTER SYSTEM SWITCH LOGFILE ALTER SYSTEM ARCHIVELOG CURRENT 區別Hive
- Oracle 11g RMAN備份-RMAN的backup database plus archivelog命令背後的操作OracleDatabaseHive
- 理解RMAN backup database plus archivelog命令DatabaseHive
- alter database archivelog manual__導致oracle10g switch logfile不自動歸檔DatabaseHiveOracle
- RMAN delete archivelog命令刪除歸檔日誌及歸檔日誌拷貝deleteHive
- RMAN - backup archivelog all 與 backup database plus archivelog 區別HiveDatabase
- 測試RMAN的backup archivelog all delete input會不會刪除還未傳輸到備庫的歸檔日誌Hivedelete
- 理解RMAN backup database plus archivelog delete all input命令DatabaseHivedelete
- oracle10g rac(rhel4)_rman備份歸檔出錯_backup archivelog allOracleHive
- 觸發器中操作LOB觸發器
- Oracle歸檔空間不足,delete archivelog all;命令失效時解決方法OracledeleteHive
- oracle 10G設定歸檔目錄及命令Oracle 10g
- alter system archive log current / all / switch logfileHive
- rman 還原歸檔日誌(restore archivelogRESTHive
- Oracle基礎 04 歸檔日誌 archivelogOracleHive
- rman 還原歸檔日誌(restore archivelog)RESTHive
- TSM中備份(Backup)和歸檔(Archive)的區別Hive
- 修改資料庫歸檔模式(ARCHIVELOG/NOARCHIVELOG)資料庫模式Hive
- rman中關於archivelog的操作Hive
- Oracle 資料庫歸檔配置-9i,10g,11gOracle資料庫
- crosscheck archivelog all;crosscheck backup of區別ROSHive
- BACKUP ARCHIVELOG with DELETE INPUT or DELET all..Hivedelete
- 10G 歸檔相關
- 10G設定歸檔
- alter system archive log current和alter system switch logfileHive
- 10g , 11g RAC 環境下開啟歸檔模式的方法模式
- ASM 中使用RMAN delete archivelog until time刪除歸檔檔案ASMdeleteHive
- oracle 11g 中 (oracle 10g) crsctl 的 替換命令Oracle 10g
- Backing Up Logs with BACKUP … PLUS ARCHIVELOGHive
- oracle 10g 歸檔日誌Oracle 10g
- 修改10g的歸檔地址
- 10G RAC歸檔設定
- Oracle 11g 通過登入觸發器跟蹤會話產生trace檔案Oracle觸發器會話
- 【ARCHIVELOG】怎樣統計歸檔日誌更準確Hive
- 如何啟動或關閉oracle的歸檔(ARCHIVELOG)模式OracleHive模式
- oracle 10g rac ocfs或者asm 修改為歸檔模式操作步驟Oracle 10gASM模式
- 檢視oracle資料庫是否歸檔和修改歸檔模式Oracle資料庫模式
- postgresql 觸發器操作SQL觸發器