æ´æ¹ORACLEå½æ¡£è·¯å¾åå½æ¡£æ¨¡å¼
å¨ORACLE10gå11gçæ¬ï¼ORACLEé»è®¤çæ¥å¿å½æ¡£è·¯å¾ä¸ºéªåæ¢å¤åºï¼$ORACLE_BASE/flash_recovery_areaï¼ã对äºè¿ä¸ªè·¯å¾ï¼ORACLEæä¸ä¸ªéå¶ï¼å°±æ¯é»è®¤åªæ2Gç空é´ï¼èä¸ä¸åªæ¯å½æ¡£æ¥å¿çé»è®¤è·¯å¾ï¼ä¹æ¯å¤ä»½æ件åéªåæ¥å¿çé»è®¤å°åï¼è¿æ ·çè¯å½æ¡£æ¥å¿é使ç¨ç空é´å°±è¾¾ä¸å°2Gï¼å¨æ²¡æ设置好è¿ä¸ªè·¯å¾å¤§å°çæ
åµä¸ï¼å¾å¤ç³»ç»é½éå°è¿å½æ¡£æ¥å¿æ»¡èæ æ³å½æ¡£å¯¼è´æ°æ®åºå¤¯ä½çé®é¢ï¼å¯ä»¥ä½¿ç¨ä¸é¢çSQLè¯å¥å»æ¥çå½æ¡£ä¿¡æ¯ã
SQL> archive log list
æ°æ®åºæ¥å¿æ¨¡å¼ éå档模å¼
èªå¨åæ¡£ ç¦ç¨
åæ¡£ç»ç¹ USE_DB_RECOVERY_FILE_DEST
ææ©çèæºæ¥å¿åºå 321
å½åæ¥å¿åºå 326ã
ä¸é¢çåæ¡£ç»ç¹USE_DB_RECOVERY_FILE_DESTé»è®¤å°±æ¯éªåæ¢å¤åºï¼$ORACLE_BASE/flash_recovery_areaï¼ï¼å¯ä»¥éè¿ä¸é¢çSQLæ¥çéªåæ¢å¤åºçä¿¡æ¯ã
www.2cto.com SQL> show parameter db_recover
NAME TYPE VALUE
-------------------------- ----------- ----------------------------
db_recovery_file_dest string D:\oracle\flash_recovery_area
db_recovery_file_dest_size big integer 2G
éè¿ä¸é¢çSQLç»æå¯ä»¥çå°ï¼éªåæ¢å¤åºä¸ºD:\oracle\flash_recovery_areaï¼å¤§å°ä¸º2Gï¼ä¹å¯ä»¥éè¿æ¥è¯¢v$recovery_file_destè§å¾æ¥çéªåæ¢å¤çéå¶ä¿¡æ¯ã
SQL> select name,SPACE_LIMIT,SPACE_USED from v$recovery_file_dest;
NAME SPACE_LIMIT SPACE_USED
------------------------------ ----------- ----------
D:\oracle\flash_recovery_area 2147483648 21225472
é»è®¤æ
åµä¸ï¼å½æ¡£æ¥å¿ä¼åæ¾å°éªåæ¢å¤åºï¼D:\oracle\flash_recovery_areaï¼å
ï¼å¦æéªåæ¢å¤åºå·²ç»ä½¿ç¨å°2Gï¼å½æ¡£æ¥å¿å°±æå¯è½æ æ³ç»§ç»å½æ¡£ï¼æ°æ®åºå¤¯ä½ï¼é常ç解å³æ¹æ³æ¯å¢å¤§éªåæ¢å¤åºï¼å¯ä»¥ç¨ä»¥ä¸SQLå®ç°ã
SQL> alter system set db_recovery_file_dest_size=3G;
ç³»ç»å·²æ´æ¹ã
å³ä½¿ç¨è¿ç§æ¹æ³è§£å³çå½åççä¹æ¥ï¼è½ç¶éªåæ¢å¤åºORACLEä¼èªå¨ç®¡çï¼å¦æéªåæ¢å¤åºç©ºé´ä¸è¶³å°±ä¼æ¸
çæ没ç¨çæ°æ®ï¼ä½æ¯å¦æå¤ä»½çç¥ä¸æ¯å¾å®åï¼æ°æ®åºé常ç¹å¿çæ
åµä¸ï¼è¿æå¯è½éå°è¿ç§æ
åµï¼é常éè¦ä¿®æ¹å½æ¡£æ¥å¿çè·¯å¾ï¼å°å½æ¡£æ¥å¿æ¾å°å
¶ä»ä¸åéå¶çè·¯å¾ä¸æ¥è§£å³è¿ä¸ªé®é¢ï¼å¯éè¿ä¸é¢çSQLæ¥ä¿®æ¹å½æ¡£æ¥å¿çåæ¾è·¯å¾ã
SQL> alter system set log_archive_dest_1='location=D:\arch';
ç³»ç»å·²æ´æ¹ã
www.2cto.com ç¶åå°æ°æ®åºå¯å¨å°MOUNTç¶æï¼å°æ°æ®åºä¿®æ¹ä¸ºå½æ¡£æ¨¡å¼å建æ°æ®åºå¯å¨å°OPENç¶æã
SQL> shutdown immediate
æ°æ®åºå·²ç»å
³éã
å·²ç»å¸è½½æ°æ®åºã
ORACLE ä¾ç¨å·²ç»å
³éã
SQL> startup mount
ORACLE ä¾ç¨å·²ç»å¯å¨ã
æ°æ®åºè£
è½½å®æ¯ã
SQL> alter database archivelog;
æ°æ®åºå·²æ´æ¹ã
SQL> alter database open;
æ°æ®åºå·²æ´æ¹ã
å次æ¥çæ°æ®åºçå½æ¡£æ
åµã
SQL> archive log list
æ°æ®åºæ¥å¿æ¨¡å¼ å档模å¼
èªå¨åæ¡£ å¯ç¨
åæ¡£ç»ç¹ D:\arch
ææ©çèæºæ¥å¿åºå 321
ä¸ä¸ä¸ªåæ¡£æ¥å¿åºå 326
å½åæ¥å¿åºå 326
å¯ä»¥éè¿åæ¢æ¥å¿ï¼æ¥çå½æ¡£è·¯å¾ä¸æ¯å¦æå½æ¡£æ¥å¿äº§çæ¥éªè¯å½æ¡£è·¯å¾è®¾ç½®æ¯å¦æ£ç¡®ï¼å¯ä»¥éè¿ä¸é¢çå½ä»¤åæ¢æ¥å¿ã
SQL> alter system switch logfile;
ç³»ç»å·²æ´æ¹ã
www.2cto.com æ¥çå½æ¡£è·¯å¾ï¼D:\archï¼ä¸æ¯å¦æå½æ¡£è·¯å¾äº§çã
D:\arch>dir/b
ARC0000000326_0764368160.0001
å¯ä»¥çå°å¨D:\archè·¯å¾ä¸å·²ç»äº§çäºå½æ¡£æ¥å¿ï¼å½æ¡£æ¥å¿çååålog_archive_formatåæ°éå¶ï¼å¯ä»¥éè¿ä¸é¢çå½ä»¤æ¥çã
SQL> show parameter log_archive_format
NAME TYPE VALUE
---------------------- ------------ ------------
log_archive_format string ARC%S_%R.%T
ä¸é¢äº§ççå½æ¡£æ件åå为ARC0000000326_0764368160.0001ï¼%Sä¹å°±æ¯0000000326æ¯æ¥å¿åæ¢å·ï¼ä¹å°±æ¯ä¸æarchive log listä¸çå½åæ¥å¿åºåï¼%Ræ¯åºæ¯å·ï¼%Tæ¯çº¿ç¨å·ï¼å¯ä»¥ç解ææ¯èç¹å·ï¼å¦æä¸æ¯RACç¯å¢ï¼%Té½æ¯1ï¼è¿å¯ä»¥å¨log_archive_formatåæ°å¼ä¸å ä¸%Dï¼%Dæ¯16è¿å¶æ è¯çDBIDï¼å¦ä¸æ¼ç¤ºï¼
SQL> alter system set log_archive_format='ARC%S_%R.%T_%D.log' scope=spfile;
ç³»ç»å·²æ´æ¹ã
www.2cto.com SQL> shutdown immediate
æ°æ®åºå·²ç»å
³éã
å·²ç»å¸è½½æ°æ®åºã
ORACLE ä¾ç¨å·²ç»å
³éã
SQL> startup
ORACLE ä¾ç¨å·²ç»å¯å¨ã
æ°æ®åºè£
è½½å®æ¯ã
æ°æ®åºå·²ç»æå¼ã
SQL> alter system switch logfile;
ç³»ç»å·²æ´æ¹ã
æ¥çå½æ¡£æ¥å¿çååï¼5AA14A62å°±æ¯16è¿å¶çDBIDã
D:\arch>dir/b
ARC0000000326_0764368160.0001
ARC0000000327_0764368160.0001_5AA14A62.LOG