昨天上課時聽到10g以後的Archive Log的預設位置在USE_DB_RECOVERY_FILE_DEST,保存在Flash recovery area,
但是Flash recovery area的預設大小為2G,有可能會導致Archive Log空間不足。
所以今天就拿虛擬機來測試看看,查詢目前Flash Recovery Area內Archive Log的使用量
SQL> select percent_space_used from v$flash_recovery_area_usage where file_type='ARCHIVED LOG';
PERCENT_SPACE_USED
------------------
0
將LOG_ARCHIVE_DEST_1清空。
SQL> alter system Set LOG_ARCHIVE_DEST_1='' scope=spfile;
重開DB到open階段
SQL> shutdown immedite;
SQL> startup;
查詢Archivelog狀態,可以發現Archive destination預設是USE_DB_RECOVERY_FILE_DEST
SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 396
Next log sequence to archive 398
Current log sequence 398
強制切換Redolog,產生archive log
SQL> alter system switch logfile;
再次查詢Flash Recovery Area內Archive Log的使用量
SQL> select percent_space_used from v$flash_recovery_area_usage where file_type='ARCHIVED LOG';
PERCENT_SPACE_USED
------------------
.02
但是Flash recovery area的預設大小為2G,有可能會導致Archive Log空間不足。
所以今天就拿虛擬機來測試看看,查詢目前Flash Recovery Area內Archive Log的使用量
SQL> select percent_space_used from v$flash_recovery_area_usage where file_type='ARCHIVED LOG';
PERCENT_SPACE_USED
------------------
0
將LOG_ARCHIVE_DEST_1清空。
SQL> alter system Set LOG_ARCHIVE_DEST_1='' scope=spfile;
重開DB到open階段
SQL> shutdown immedite;
SQL> startup;
查詢Archivelog狀態,可以發現Archive destination預設是USE_DB_RECOVERY_FILE_DEST
SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 396
Next log sequence to archive 398
Current log sequence 398
強制切換Redolog,產生archive log
SQL> alter system switch logfile;
再次查詢Flash Recovery Area內Archive Log的使用量
SQL> select percent_space_used from v$flash_recovery_area_usage where file_type='ARCHIVED LOG';
PERCENT_SPACE_USED
------------------
.02