oracle 控制檔案及引數檔案何時自動備份
結論:
-
當 CONFIGURE CONTROLFILE AUTOBACKUP OFF;時,僅備份1號資料檔案(system)和全備資料庫時,會自動備份控制檔案和引數檔案。 而當控制檔案自動備份關閉時,備份指令碼包含備份控制檔案及歸檔,資料庫備份順序是備份資料庫->自動備份控制檔案和引數檔案->備份控制檔案(備份指令碼指定的)->備份歸檔。 而當控制檔案自動備份關閉時,備份指令碼僅包含備份全庫及備份歸檔(不包含備份控制檔案時),資料庫備份順序是備份資料庫->自動備份控制檔案和引數檔案->備份歸檔。
-
當 CONFIGURE CONTROLFILE AUTOBACKUP ON;時,備份任意檔案(資料檔案、歸檔檔案)及全備,都會自動備份控制檔案和引數檔案。
注意:前提:資料庫使用的是spfile,而不是pfile。
實驗如下:
一、控制檔案自動備份關閉
[oracle@sz-cenaccte-18 backup]$ rman target /
Recovery Manager: Release 11.2.0.3.0 - Production on Thu Aug 4 16:18:15 2022
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: TEST (DBID=2409816349)
RMAN> show all;
using target database control file instead of recovery catalog
RMAN configuration parameters for database with db_unique_name TEST are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP OFF; # default
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE ; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/opt/oracle/oracle/product/11.2.0/db_1/dbs/snapcf_test.f'; # default
RMAN>
RMAN> BACKUP as compressed backupset full format '/oradata/backup/test_full_%d_%T_%s.bak' database;
Starting backup at 2022-08-04 16:23:54
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=399 device type=DISK
channel ORA_DISK_1: starting compressed full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/opt/oracle/oracle/oradata/test/system01.dbf
input datafile file number=00002 name=/opt/oracle/oracle/oradata/test/sysaux01.dbf
input datafile file number=00003 name=/opt/oracle/oracle/oradata/test/undotbs01.dbf
input datafile file number=00004 name=/opt/oracle/oracle/oradata/test/users01.dbf
channel ORA_DISK_1: starting piece 1 at 2022-08-04 16:23:55
channel ORA_DISK_1: finished piece 1 at 2022-08-04 16:25:00
piece handle=/oradata/backup/test_full_TEST_20220804_20.bak tag=TAG20220804T162355 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:05
channel ORA_DISK_1: starting compressed full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 2022-08-04 16:25:01
channel ORA_DISK_1: finished piece 1 at 2022-08-04 16:25:02
piece handle=/oradata/backup/test_full_TEST_20220804_21.bak tag=TAG20220804T162355 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 2022-08-04 16:25:02
RMAN>
RMAN> backup datafile 1;
Starting backup at 2022-08-04 16:26:04
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/opt/oracle/oracle/oradata/test/system01.dbf
channel ORA_DISK_1: starting piece 1 at 2022-08-04 16:26:05
channel ORA_DISK_1: finished piece 1 at 2022-08-04 16:26:20
piece handle=/opt/oracle/oracle/product/11.2.0/db_1/dbs/0m14b38t_1_1 tag=TAG20220804T162604 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 2022-08-04 16:26:21
channel ORA_DISK_1: finished piece 1 at 2022-08-04 16:26:22
piece handle=/opt/oracle/oracle/product/11.2.0/db_1/dbs/0n14b39c_1_1 tag=TAG20220804T162604 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 2022-08-04 16:26:22
RMAN>
RMAN> backup datafile 2;
Starting backup at 2022-08-04 16:26:36
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00002 name=/opt/oracle/oracle/oradata/test/sysaux01.dbf
channel ORA_DISK_1: starting piece 1 at 2022-08-04 16:26:36
channel ORA_DISK_1: finished piece 1 at 2022-08-04 16:26:43
piece handle=/opt/oracle/oracle/product/11.2.0/db_1/dbs/0o14b39s_1_1 tag=TAG20220804T162636 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:07
Finished backup at 2022-08-04 16:26:43
RMAN>
RMAN> backup datafile 3;
Starting backup at 2022-08-04 16:27:05
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00003 name=/opt/oracle/oracle/oradata/test/undotbs01.dbf
channel ORA_DISK_1: starting piece 1 at 2022-08-04 16:27:05
channel ORA_DISK_1: finished piece 1 at 2022-08-04 16:27:08
piece handle=/opt/oracle/oracle/product/11.2.0/db_1/dbs/0p14b3ap_1_1 tag=TAG20220804T162705 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
Finished backup at 2022-08-04 16:27:08
RMAN> backup datafile 4;
Starting backup at 2022-08-04 16:27:16
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00004 name=/opt/oracle/oracle/oradata/test/users01.dbf
channel ORA_DISK_1: starting piece 1 at 2022-08-04 16:27:16
channel ORA_DISK_1: finished piece 1 at 2022-08-04 16:27:17
piece handle=/opt/oracle/oracle/product/11.2.0/db_1/dbs/0q14b3b4_1_1 tag=TAG20220804T162716 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 2022-08-04 16:27:17
RMAN>
RMAN> backup archivelog all;
Starting backup at 2022-08-04 16:35:49
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=8 RECID=1 STAMP=1111845769
input archived log thread=1 sequence=9 RECID=2 STAMP=1111845769
input archived log thread=1 sequence=10 RECID=3 STAMP=1111852683
input archived log thread=1 sequence=11 RECID=4 STAMP=1111852684
input archived log thread=1 sequence=12 RECID=5 STAMP=1111852685
input archived log thread=1 sequence=13 RECID=6 STAMP=1111852685
channel ORA_DISK_1: starting piece 1 at 2022-08-04 16:35:50
channel ORA_DISK_1: finished piece 1 at 2022-08-04 16:35:51
piece handle=/opt/oracle/oracle/product/11.2.0/db_1/dbs/1814b3r6_1_1 tag=TAG20220804T163550 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
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=1 RECID=7 STAMP=1111854905
input archived log thread=1 sequence=2 RECID=8 STAMP=1111854950
channel ORA_DISK_1: starting piece 1 at 2022-08-04 16:35:51
channel ORA_DISK_1: finished piece 1 at 2022-08-04 16:35:52
piece handle=/opt/oracle/oracle/product/11.2.0/db_1/dbs/1914b3r7_1_1 tag=TAG20220804T163550 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 2022-08-04 16:35:52
RMAN>
.
二、控制檔案自動備份開啟
RMAN> show all;
RMAN configuration parameters for database with db_unique_name TEST are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP OFF; # default
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE ; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/opt/oracle/oracle/product/11.2.0/db_1/dbs/snapcf_test.f'; # default
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP on;
new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters are successfully stored
RMAN> show all;
RMAN configuration parameters for database with db_unique_name TEST are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE ; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/opt/oracle/oracle/product/11.2.0/db_1/dbs/snapcf_test.f'; # default
RMAN>
RMAN> BACKUP as compressed backupset full format '/oradata/backup/test_full_%d_%T_%s.bak' database;
Starting backup at 2022-08-04 16:28:01
using channel ORA_DISK_1
channel ORA_DISK_1: starting compressed full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/opt/oracle/oracle/oradata/test/system01.dbf
input datafile file number=00002 name=/opt/oracle/oracle/oradata/test/sysaux01.dbf
input datafile file number=00003 name=/opt/oracle/oracle/oradata/test/undotbs01.dbf
input datafile file number=00004 name=/opt/oracle/oracle/oradata/test/users01.dbf
channel ORA_DISK_1: starting piece 1 at 2022-08-04 16:28:01
channel ORA_DISK_1: finished piece 1 at 2022-08-04 16:29:06
piece handle=/oradata/backup/test_full_TEST_20220804_27.bak tag=TAG20220804T162801 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:05
Finished backup at 2022-08-04 16:29:06
Starting Control File and SPFILE Autobackup at 2022-08-04 16:29:06
piece handle=/opt/oracle/oracle/product/11.2.0/db_1/dbs/c-2409816349-20220804-01 comment=NONE
Finished Control File and SPFILE Autobackup at 2022-08-04 16:29:07
RMAN>
RMAN> backup datafile 1;
Starting backup at 2022-08-04 16:29:33
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/opt/oracle/oracle/oradata/test/system01.dbf
channel ORA_DISK_1: starting piece 1 at 2022-08-04 16:29:33
channel ORA_DISK_1: finished piece 1 at 2022-08-04 16:29:48
piece handle=/opt/oracle/oracle/product/11.2.0/db_1/dbs/0t14b3fd_1_1 tag=TAG20220804T162933 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15
Finished backup at 2022-08-04 16:29:48
Starting Control File and SPFILE Autobackup at 2022-08-04 16:29:48
piece handle=/opt/oracle/oracle/product/11.2.0/db_1/dbs/c-2409816349-20220804-02 comment=NONE
Finished Control File and SPFILE Autobackup at 2022-08-04 16:29:49
RMAN> backup datafile 2;
Starting backup at 2022-08-04 16:29:58
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00002 name=/opt/oracle/oracle/oradata/test/sysaux01.dbf
channel ORA_DISK_1: starting piece 1 at 2022-08-04 16:29:58
channel ORA_DISK_1: finished piece 1 at 2022-08-04 16:30:05
piece handle=/opt/oracle/oracle/product/11.2.0/db_1/dbs/0v14b3g6_1_1 tag=TAG20220804T162958 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:07
Finished backup at 2022-08-04 16:30:05
Starting Control File and SPFILE Autobackup at 2022-08-04 16:30:05
piece handle=/opt/oracle/oracle/product/11.2.0/db_1/dbs/c-2409816349-20220804-03 comment=NONE
Finished Control File and SPFILE Autobackup at 2022-08-04 16:30:06
RMAN> backup datafile 3;
Starting backup at 2022-08-04 16:30:11
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00003 name=/opt/oracle/oracle/oradata/test/undotbs01.dbf
channel ORA_DISK_1: starting piece 1 at 2022-08-04 16:30:11
channel ORA_DISK_1: finished piece 1 at 2022-08-04 16:30:14
piece handle=/opt/oracle/oracle/product/11.2.0/db_1/dbs/1114b3gj_1_1 tag=TAG20220804T163011 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
Finished backup at 2022-08-04 16:30:14
Starting Control File and SPFILE Autobackup at 2022-08-04 16:30:14
piece handle=/opt/oracle/oracle/product/11.2.0/db_1/dbs/c-2409816349-20220804-04 comment=NONE
Finished Control File and SPFILE Autobackup at 2022-08-04 16:30:15
RMAN> backup datafile 4;
Starting backup at 2022-08-04 16:30:21
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00004 name=/opt/oracle/oracle/oradata/test/users01.dbf
channel ORA_DISK_1: starting piece 1 at 2022-08-04 16:30:21
channel ORA_DISK_1: finished piece 1 at 2022-08-04 16:30:22
piece handle=/opt/oracle/oracle/product/11.2.0/db_1/dbs/1314b3gt_1_1 tag=TAG20220804T163021 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 2022-08-04 16:30:22
Starting Control File and SPFILE Autobackup at 2022-08-04 16:30:22
piece handle=/opt/oracle/oracle/product/11.2.0/db_1/dbs/c-2409816349-20220804-05 comment=NONE
Finished Control File and SPFILE Autobackup at 2022-08-04 16:30:23
RMAN>
RMAN> backup archivelog all;
Starting backup at 2022-08-04 16:35:05
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=8 RECID=1 STAMP=1111845769
input archived log thread=1 sequence=9 RECID=2 STAMP=1111845769
input archived log thread=1 sequence=10 RECID=3 STAMP=1111852683
input archived log thread=1 sequence=11 RECID=4 STAMP=1111852684
input archived log thread=1 sequence=12 RECID=5 STAMP=1111852685
input archived log thread=1 sequence=13 RECID=6 STAMP=1111852685
channel ORA_DISK_1: starting piece 1 at 2022-08-04 16:35:05
channel ORA_DISK_1: finished piece 1 at 2022-08-04 16:35:08
piece handle=/opt/oracle/oracle/product/11.2.0/db_1/dbs/1514b3pp_1_1 tag=TAG20220804T163505 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
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=1 RECID=7 STAMP=1111854905
channel ORA_DISK_1: starting piece 1 at 2022-08-04 16:35:08
channel ORA_DISK_1: finished piece 1 at 2022-08-04 16:35:09
piece handle=/opt/oracle/oracle/product/11.2.0/db_1/dbs/1614b3ps_1_1 tag=TAG20220804T163505 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 2022-08-04 16:35:09
Starting Control File and SPFILE Autobackup at 2022-08-04 16:35:09
piece handle=/opt/oracle/oracle/product/11.2.0/db_1/dbs/c-2409816349-20220804-06 comment=NONE
Finished Control File and SPFILE Autobackup at 2022-08-04 16:35:10
RMAN>
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/31397003/viewspace-2909040/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 從控制檔案自動備份還原引數檔案
- 開啟 控制檔案自動備份下,引數檔案、控制檔案全部丟失恢復
- 冷備份之一查詢引數檔案及備份引數檔案
- oracle控制檔案及引數檔案問題Oracle
- 控制檔案自動備份報錯併產生TRACE檔案
- Backup And Recovery User's Guide-RMAN備份概念-RMAN何時執行控制檔案自動備份GUIIDE
- [Rman]Oracle 11g控制檔案延遲自動備份Oracle
- oracle11g控制檔案自動備份延遲特性Oracle
- 備份控制檔案
- 備份之控制檔案備份
- 【RMAN】Oracle中如何備份控制檔案?備份控制檔案的方式有哪幾種?Oracle
- Oracle 11g 備份控制檔案Oracle
- oracle11g 新特性 - rman自動備份控制檔案延遲Oracle
- 設定路徑找到自動備份的控制檔案
- RMAN相容性、控制檔案自動備份、儲存時間、備份策略、備份指令碼(二)指令碼
- 【備份恢復】利用 備份控制檔案到指定目錄下的控制檔案 恢復控制檔案
- oracle10g_備份控制檔案_得到重建控制檔案的指令碼Oracle指令碼
- 控制檔案重建以及備份
- 11G新特性-控制檔案延遲自動備份
- 使用舊的控制檔案備份來恢復控制檔案
- Oracle 引數檔案Oracle
- Oracle引數檔案解析——引數檔案分析獲取Oracle
- RMAN備份資料檔案+控制檔案+歸檔日誌
- 2.7.9 備份伺服器引數檔案(SPFILE)伺服器
- shell 備份檔案指令碼+自動清理指令碼
- 自動備份檔案到GITHUB的方法Github
- Oracle RMAN 備份控制檔案報錯問題Oracle
- [重慶思莊每日技術分享]-控制檔案自動備份
- trace檔案備份控制檔案並執行恢復
- gitlab自動定時備份檔案,備份失敗傳送郵件Gitlab
- rman備份-(1) 利用備份級恢復資料檔案和控制檔案
- RMAN說,我能備份(4)--RMAN備份資料檔案和控制檔案
- oracle的引數檔案Oracle
- Oracle 引數檔案(轉)Oracle
- Oracle 11gR2 RMAN 配置控制檔案自動備份(control file autobackup)Oracle
- 重建控制檔案時,與資料檔案相關的Checkpoint資訊來自何處
- 不完全恢復(資料檔案備份--新建表空間--控制檔案備份--日誌歸檔檔案)
- ORACLE_備份恢復_RMAN相關內容(控制檔案在閃回區中的自動備份)Oracle