檢查點分爲三類:
1、增量檢查點
兩種引起增量檢查點:fast_start_mttr_targert ; 切換日誌組;
手動切換日誌組:alter system switch logfile;日誌組不能太小,太少,太多,一般以4-5個爲準,大小根據業務來定,避免頻繁切換,且不能不對稱,否則會導致數據塊的算法自動切換,影響系統整體性能。
2、完全檢查點
兩種引起完全檢查點:
alter system checkpoint;shutdown immediate;
做完完全檢查點時日誌組中不會有active狀態。active狀態說明該日誌中有rba指針,恢復會使用到。
3、局部檢查點,表空間級檢查點
system undo 表空間不能下線
表空間下線命令:alter table space system offline;
當表空間下線時,表結構可以建,但是不能插入數據。表結構存儲在sys表空間上。
查user表空間
select * form database_properties;
可用作媒介恢復,因此datafile會寫檢查點號。
oracle改爲歸檔模式,否則不能做熱備,熱備是oracle的重要功能。
查看是否歸檔
SQL> archive log list;
Database log mode No Archive Mode
Automatic archival Disabled
Archive destination /u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch
Oldest online log sequence 16
Current log sequence 18
進行歸檔操作:
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.
Total System Global Area 945786880 bytes
Fixed Size 1340468 bytes
Variable Size 301992908 bytes
Database Buffers 637534208 bytes
Redo Buffers 4919296 bytes
Database mounted.
SQL> alter database archivelog;
Database altered.
SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch
Oldest online log sequence 16
Next log sequence to archive 18
Current log sequence 18
SQL> alter database open;
Database altered.
必須要在數據庫掛載模式下才可切換爲歸檔模式。