Oracle 熱備份

來源:互聯網
上載者:User

--=======================

-- Oracle 熱備份

--=======================

 

    Oracle 熱備份是指資料庫處於open狀態下,對資料庫的資料檔案、控制檔案、參數檔案、密碼檔案等進行一系列備份操作。

熱備是基於使用者管理備份恢複的一種方式,也是除了RMAN備份之外較為常用的一種備份方式。

 

一、熱備的過程

    凍結塊頭-->控制SCN在備份時不發生變化

    進行物理拷貝

    解凍塊頭-->讓SCN可以變化(當對SCN解凍後,系統會自動更新SCN至最新的狀態)

 

二、基於資料庫的熱備

    alter database begin backup;

    拷貝所有的datafile到備份目錄

    alter database end backup;

 

三、基於資料表空間的熱備

    alter tablespace tablespace_name begin backup;

    拷貝tablespace_name資料表空間的資料檔案到備份目錄

    alter tablespace tablespace_name end backup;

 

    alter tablespace tablespace_name begin backup時完成的任務

        檢查點事件發生,檢查點通知DBWn將該資料表空間上所有的髒資料被寫入到磁碟

        在資料檔案頭部凍結當前檢查點事件發生時的SCN號

        所有發生變化資料區塊的完整鏡像(修改前後)被寫入到redo log中

        允許該資料表空間內資料的正常讀寫

 

    建議使用基於資料表空間的熱備,這樣將儘可能的減少對系統效能的影響   

 

四、控制檔案的熱備

    alter database backup controlfile to '<dir>';          --控制檔案的完整備份

    alter database backup controlfile to trace as '<dir>'  --用於建立控制檔案的語句,丟失了部分資訊

    控制檔案發生變化情況

        alter database [add |drop] logfile

        alter database [add |drop] logfile member

        alter database [add |drop] logfile group

        alter database [archivelog |noarchivelog]

        alter database rename file

        create tablespace

        alter tablespace [add | rename] datafile

        alter tablespace [read write | read only]

        drop tablespace

   

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.