1102CONFIGURE CONTROLFILE AUTOBACKUP ON

lfree發表於2016-11-02

[20161102]CONFIGURE CONTROLFILE AUTOBACKUP ON.txt

--正常情況下,許多dba都建議設定CONFIGURE CONTROLFILE AUTOBACKUP ON,這樣在增加刪除表空間等資料庫維護操作時,做備份時,自動建
--立控制檔案與spfile檔案的備份.

--許多人也觀察到在維護資料庫增加資料檔案時,並不會馬上做控制檔案的自動備份,實際上又一些小小延遲.受引數_controlfile_autobackup_delay
--的控制,這樣的目地在於如果增加很多資料檔案,頻繁備份並不是非常必要,適當延遲可以避免頻繁備份控制檔案.

--做一個小測試:

1.環境:
SYS@book> @ &r/ver1

PORT_STRING                    VERSION        BANNER
------------------------------ -------------- --------------------------------------------------------------------------------
x86_64/Linux 2.4.xx            11.2.0.4.0     Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

SYS@book> @ &r/hide _controlfile_autobackup_delay
NAME                          DESCRIPTION                                                    DEFAULT_VALUE SESSION_VALUE SYSTEM_VALUE
----------------------------- -------------------------------------------------------------- ------------- ------------- ------------
_controlfile_autobackup_delay time delay (in seconds) for performing controlfile autobackups TRUE          300           300


2.建立表空間看看:

CREATE TABLESPACE TEA DATAFILE
  '/mnt/ramdisk/book/tea01.dbf' SIZE 1M AUTOEXTEND ON NEXT 16M MAXSIZE UNLIMITED
LOGGING
ONLINE
EXTENT MANAGEMENT LOCAL AUTOALLOCATE
BLOCKSIZE 8K
SEGMENT SPACE MANAGEMENT AUTO
FLASHBACK ON;


3.觀察是否備份控制檔案.

RMAN> list backup of controlfile;
specification does not match any backup in the repository

--wait 300秒

RMAN> list backup;
List of Backup Sets
===================
BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
46      Full    9.52M      DISK        00:00:00     2016-11-02 08:49:21
        BP Key: 46   Status: AVAILABLE  Compressed: NO  Tag: TAG20161102T084921
        Piece Name: /u01/app/oracle/fast_recovery_area/BOOK/autobackup/2016_11_02/o1_mf_s_926844561_d1lg0k8y_.bkp
  SPFILE Included: Modification time: 2016-10-17 08:51:21
  SPFILE db_unique_name: BOOK
  Control File Included: Ckp SCN: 2450432      Ckp time: 2016-11-02 08:49:21

--看看
Wed Nov 02 08:39:23 2016
CREATE TABLESPACE TEA DATAFILE
  '/mnt/ramdisk/book/tea01.dbf' SIZE 1M AUTOEXTEND ON NEXT 16M MAXSIZE UNLIMITED
LOGGING
ONLINE
EXTENT MANAGEMENT LOCAL AUTOALLOCATE
BLOCKSIZE 8K
SEGMENT SPACE MANAGEMENT AUTO
FLASHBACK ON
Completed: CREATE TABLESPACE TEA DATAFILE
  '/mnt/ramdisk/book/tea01.dbf' SIZE 1M AUTOEXTEND ON NEXT 16M MAXSIZE UNLIMITED
LOGGING
ONLINE
EXTENT MANAGEMENT LOCAL AUTOALLOCATE
BLOCKSIZE 8K
SEGMENT SPACE MANAGEMENT AUTO
FLASHBACK ON

--可以發現時間還是存在一些差異,實際上是10分鐘後才做了備份。

--後臺派生程式MMON slave 會跟蹤控制檔案的建立資訊, 一般命令格式: SID__m000_<OS_PID>.trc

*** 2016-11-02 08:49:21.246
*** SESSION ID:(68.7) 2016-11-02 08:49:21.246
*** CLIENT ID:() 2016-11-02 08:49:21.246
*** SERVICE NAME:(SYS$BACKGROUND) 2016-11-02 08:49:21.246
*** MODULE NAME:(MMON_SLAVE) 2016-11-02 08:49:21.246
*** ACTION NAME:(Autobackup Control File) 2016-11-02 08:49:21.246

Starting control autobackup
Control autobackup written to DISK device
    handle '/u01/app/oracle/fast_recovery_area/BOOK/autobackup/2016_11_02/o1_mf_s_926844561_d1lg0k8y_.bkp'

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/267265/viewspace-2127491/,如需轉載,請註明出處,否則將追究法律責任。

相關文章