使用者管理的備份(一致性備份、非一致性備份、離線備份、聯機備份)

來源:互聯網
上載者:User

1.備份資料庫
概念:指備份資料庫的所有資料檔案和控制檔案,另外還應該備份參數檔案和口令檔案
注意:當備份資料庫時,不要備份重做日誌。
1.1一致性備份
概念:資料庫一致性備份是指關閉了資料庫後備份所有資料檔案和控制檔案的方法。當使用SHUTDOWN 命令正常關閉了資料庫之後,所有資料庫檔案的當前SCN 值完全一致,所以關閉後的Database Backup被稱為資料庫一致性備份或者冷備份。
適用:ARCHIVELOG、NOARCHIVELOG
select name from v$datafile union select name from v$controlfile;
shutdown immediate;
copy 檔案
startup;
1.2非一致性備份
概念:指在OPEN 狀態下備份資料庫所有資料檔案和控制檔案的方法。因為在OPEN 狀態下資料庫內容隨時都會改變,從而導致不同資料庫檔案的當前SCN值完全不同,所以開啟時的Database Backup被稱為資料庫非一致性備份。
適用:ARCHIVELOG模式。
select name from v$datafile;
alter database begin backup;
copy 檔案
Alter database backup controlfile to ‘';
alter database end backup;
alter system archive log current;


2.備份資料表空間
概念:指在資料庫處於OPEN狀態時備份起資料檔案的方法。
適用:ARCHIVELOG模式。
注意:可以備份資料表空間的所有資料檔案,也可以備份資料表空間的某個資料檔案。
2.1離線備份
概念:指當資料表空間處於OFFLINE狀態時,備份資料表空間所有資料檔案或單個資料檔案的過程。
適用:ARCHIVELOG模式。
優點:會產生較少的重做日誌。
缺點:會影響資料表空間的業務操作。(因為SYSTEM 和正使用的UNDO 資料表空間都不能被離線)
select file_name from dba_data_files where tablespace_name='USERS';
alter tablespace users offline;
copy 檔案
alter tablespace users online;
2.2聯機備份
概念:指當資料表空間處於ONLINE狀態時,備份資料表空間所有資料檔案或單個資料檔案的過程。
適用:ARCHIVELOG模式。
優點:不影響資料表空間上的業務操作。
缺點:會產生更多的REDO資訊和歸檔資訊。
select file_name from dba_data_files where tablespace_name='USERS';
alter tablespace users begin backup;
copy 檔案
alter tablespace users end backup;

相關文章

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.