11g ADRCI清理trace檔案
在11g之前的版本中需要我們手動去清理trace檔案,11g可以使用工具ADRCI清理,預設情況下由MMON後臺程式進行自動清理過期的trace檔案,這裡涉及兩個引數:
LONGP_POLICY:預設保留365天的事件與警告。
SHORTP_POLICY:預設保留30的trace檔案或core dump file
[oracle@jzh5 ~]$ cd $ORACLE_BASE/diag/rdbms/jzh/jzh/trace
[oracle@jzh5 trace]$ ll
total 1956
-rw-r----- 1 oracle oinstall 134249 Sep 13 08:55 alert_jzh.log
-rw-r----- 1 oracle oinstall 928 Aug 5 02:08 jzh_arc1_3039.trc
-rw-r----- 1 oracle oinstall 58 Aug 5 02:08 jzh_arc1_3039.trm
-rw-r----- 1 oracle oinstall 942 Jul 22 14:58 jzh_arc1_3053.trc
-rw-r----- 1 oracle oinstall 58 Jul 22 14:58 jzh_arc1_3053.trm
-rw-r----- 1 oracle oinstall 928 Sep 13 08:39 jzh_arc1_3300.trc
-rw-r----- 1 oracle oinstall 58 Sep 13 08:39 jzh_arc1_3300.trm
-rw-r----- 1 oracle oinstall 929 Aug 2 07:31 jzh_arc1_3630.trc
-rw-r----- 1 oracle oinstall 58 Aug 2 07:31 jzh_arc1_3630.trm
-rw-r----- 1 oracle oinstall 942 Aug 8 16:18 jzh_arc2_3040.trc
-rw-r----- 1 oracle oinstall 58 Aug 8 16:18 jzh_arc2_3040.trm
-rw-r----- 1 oracle oinstall 942 Aug 1 14:41 jzh_arc2_3136.trc
-rw-r----- 1 oracle oinstall 58 Aug 1 14:41 jzh_arc2_3136.trm
-rw-r----- 1 oracle oinstall 986 Aug 8 15:33 jzh_cjq0_3077.trc
-rw-r----- 1 oracle oinstall 69 Aug 8 15:33 jzh_cjq0_3077.trm
-rw-r----- 1 oracle oinstall 986 Aug 1 10:31 jzh_cjq0_3195.trc
-rw-r----- 1 oracle oinstall 69 Aug 1 10:31 jzh_cjq0_3195.trm
-rw-r----- 1 oracle oinstall 986 Aug 2 07:09 jzh_cjq0_3201.trc
-rw-r----- 1 oracle oinstall 69 Aug 2 07:09 jzh_cjq0_3201.trm
-rw-r----- 1 oracle oinstall 986 Aug 2 07:31 jzh_cjq0_3674.trc
-rw-r----- 1 oracle oinstall 68 Aug 2 07:31 jzh_cjq0_3674.trm
-rw-r----- 1 oracle oinstall 986 Aug 2 07:48 jzh_cjq0_4052.trc
-rw-r----- 1 oracle oinstall 59 Aug 2 07:48 jzh_cjq0_4052.trm
-rw-r----- 1 oracle oinstall 986 Aug 2 08:47 jzh_cjq0_5134.trc
-rw-r----- 1 oracle oinstall 68 Aug 2 08:47 jzh_cjq0_5134.trm
-rw-r----- 1 oracle oinstall 1150 Aug 8 15:50 jzh_ckpt_2948.trc
-rw-r----- 1 oracle oinstall 58 Aug 8 15:50 jzh_ckpt_2948.trm
-rw-r----- 1 oracle oinstall 1026 Aug 5 02:27 jzh_ckpt_2950.trc
-rw-r----- 1 oracle oinstall 58 Aug 5 02:27 jzh_ckpt_2950.trm
-rw-r----- 1 oracle oinstall 972 Jul 28 15:52 jzh_ckpt_2951.trc
-rw-r----- 1 oracle oinstall 58 Jul 28 15:52 jzh_ckpt_2951.trm
-rw-r----- 1 oracle oinstall 1081 Aug 11 08:11 jzh_ckpt_2952.trc
-rw-r----- 1 oracle oinstall 58 Aug 11 08:11 jzh_ckpt_2952.trm
-rw-r----- 1 oracle oinstall 1464 Aug 5 09:27 jzh_ckpt_2954.trc
-rw-r----- 1 oracle oinstall 79 Aug 5 09:27 jzh_ckpt_2954.trm
-rw-r----- 1 oracle oinstall 1288 Jul 22 15:01 jzh_ckpt_2963.trc
[oracle@jzh5 trace]$ adrci
ADRCI: Release 11.2.0.3.0 - Production on Sun Sep 13 12:20:13 2015
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
ADR base = "/u01/app/oracle"
adrci> show control
ADR Home = /u01/app/oracle/diag/rdbms/jzh/jzh:
*************************************************************************
ADRID SHORTP_POLICY LONGP_POLICY LAST_MOD_TIME
LAST_AUTOPRG_TIME LAST_MANUPRG_TIME ADRDIR_VERSION
ADRSCHM_VERSION ADRSCHMV_SUMMARY ADRALERT_VERSION CREATE_TIME
-------------------- -------------------- -------------------- ----------------------------------------
---------------------------------------- ---------------------------------------- --------------------
-------------------- -------------------- -------------------- ----------------------------------------
2275908615 720 (30天) 8760(365天) 2015-03-16 01:28:49.774202 +08:00
1
2 80 1 2015-03-16 01:28:49.774202 +08:00
1 rows fetched
LONGP_POLICY:預設保留365天的事件與警告。
SHORTP_POLICY:預設保留30的trace檔案或core dump file
[oracle@jzh5 ~]$ cd $ORACLE_BASE/diag/rdbms/jzh/jzh/trace
[oracle@jzh5 trace]$ ll
total 1956
-rw-r----- 1 oracle oinstall 134249 Sep 13 08:55 alert_jzh.log
-rw-r----- 1 oracle oinstall 928 Aug 5 02:08 jzh_arc1_3039.trc
-rw-r----- 1 oracle oinstall 58 Aug 5 02:08 jzh_arc1_3039.trm
-rw-r----- 1 oracle oinstall 942 Jul 22 14:58 jzh_arc1_3053.trc
-rw-r----- 1 oracle oinstall 58 Jul 22 14:58 jzh_arc1_3053.trm
-rw-r----- 1 oracle oinstall 928 Sep 13 08:39 jzh_arc1_3300.trc
-rw-r----- 1 oracle oinstall 58 Sep 13 08:39 jzh_arc1_3300.trm
-rw-r----- 1 oracle oinstall 929 Aug 2 07:31 jzh_arc1_3630.trc
-rw-r----- 1 oracle oinstall 58 Aug 2 07:31 jzh_arc1_3630.trm
-rw-r----- 1 oracle oinstall 942 Aug 8 16:18 jzh_arc2_3040.trc
-rw-r----- 1 oracle oinstall 58 Aug 8 16:18 jzh_arc2_3040.trm
-rw-r----- 1 oracle oinstall 942 Aug 1 14:41 jzh_arc2_3136.trc
-rw-r----- 1 oracle oinstall 58 Aug 1 14:41 jzh_arc2_3136.trm
-rw-r----- 1 oracle oinstall 986 Aug 8 15:33 jzh_cjq0_3077.trc
-rw-r----- 1 oracle oinstall 69 Aug 8 15:33 jzh_cjq0_3077.trm
-rw-r----- 1 oracle oinstall 986 Aug 1 10:31 jzh_cjq0_3195.trc
-rw-r----- 1 oracle oinstall 69 Aug 1 10:31 jzh_cjq0_3195.trm
-rw-r----- 1 oracle oinstall 986 Aug 2 07:09 jzh_cjq0_3201.trc
-rw-r----- 1 oracle oinstall 69 Aug 2 07:09 jzh_cjq0_3201.trm
-rw-r----- 1 oracle oinstall 986 Aug 2 07:31 jzh_cjq0_3674.trc
-rw-r----- 1 oracle oinstall 68 Aug 2 07:31 jzh_cjq0_3674.trm
-rw-r----- 1 oracle oinstall 986 Aug 2 07:48 jzh_cjq0_4052.trc
-rw-r----- 1 oracle oinstall 59 Aug 2 07:48 jzh_cjq0_4052.trm
-rw-r----- 1 oracle oinstall 986 Aug 2 08:47 jzh_cjq0_5134.trc
-rw-r----- 1 oracle oinstall 68 Aug 2 08:47 jzh_cjq0_5134.trm
-rw-r----- 1 oracle oinstall 1150 Aug 8 15:50 jzh_ckpt_2948.trc
-rw-r----- 1 oracle oinstall 58 Aug 8 15:50 jzh_ckpt_2948.trm
-rw-r----- 1 oracle oinstall 1026 Aug 5 02:27 jzh_ckpt_2950.trc
-rw-r----- 1 oracle oinstall 58 Aug 5 02:27 jzh_ckpt_2950.trm
-rw-r----- 1 oracle oinstall 972 Jul 28 15:52 jzh_ckpt_2951.trc
-rw-r----- 1 oracle oinstall 58 Jul 28 15:52 jzh_ckpt_2951.trm
-rw-r----- 1 oracle oinstall 1081 Aug 11 08:11 jzh_ckpt_2952.trc
-rw-r----- 1 oracle oinstall 58 Aug 11 08:11 jzh_ckpt_2952.trm
-rw-r----- 1 oracle oinstall 1464 Aug 5 09:27 jzh_ckpt_2954.trc
-rw-r----- 1 oracle oinstall 79 Aug 5 09:27 jzh_ckpt_2954.trm
-rw-r----- 1 oracle oinstall 1288 Jul 22 15:01 jzh_ckpt_2963.trc
[oracle@jzh5 trace]$ adrci
ADRCI: Release 11.2.0.3.0 - Production on Sun Sep 13 12:20:13 2015
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
ADR base = "/u01/app/oracle"
adrci> show control
ADR Home = /u01/app/oracle/diag/rdbms/jzh/jzh:
*************************************************************************
ADRID SHORTP_POLICY LONGP_POLICY LAST_MOD_TIME
LAST_AUTOPRG_TIME LAST_MANUPRG_TIME ADRDIR_VERSION
ADRSCHM_VERSION ADRSCHMV_SUMMARY ADRALERT_VERSION CREATE_TIME
-------------------- -------------------- -------------------- ----------------------------------------
---------------------------------------- ---------------------------------------- --------------------
-------------------- -------------------- -------------------- ----------------------------------------
2275908615 720 (30天) 8760(365天) 2015-03-16 01:28:49.774202 +08:00
1
2 80 1 2015-03-16 01:28:49.774202 +08:00
1 rows fetched
更改SHORTP_POLICY:
adrci> set control (SHORTP_POLICY=360)
adrci> show control
ADR Home = /u01/app/oracle/diag/rdbms/jzh/jzh:
*************************************************************************
ADRID SHORTP_POLICY LONGP_POLICY LAST_MOD_TIME
LAST_AUTOPRG_TIME LAST_MANUPRG_TIME ADRDIR_VERSION
ADRSCHM_VERSION ADRSCHMV_SUMMARY ADRALERT_VERSION CREATE_TIME
-------------------- -------------------- -------------------- ----------------------------------------
--------------------------------------- ---------------------------------------- --------------------
-------------------- -------------------- -------------------- ----------------------------------------
2275908615 360 8760 2015-09-13 12:21:06.394362 +08:00
1
2 80 1 2015-03-16 01:28:49.774202 +08:00
1 rows fetched
清理trace檔案:
adrci> purge -age 8760 -type TRACE
adrci> exit
[oracle@jzh5 trace]$ ll
total 316
-rw-r----- 1 oracle oinstall 134249 Sep 13 08:55 alert_jzh.log
-rw-r----- 1 oracle oinstall 928 Sep 13 08:39 jzh_arc1_3300.trc
-rw-r----- 1 oracle oinstall 58 Sep 13 08:39 jzh_arc1_3300.trm
-rw-r----- 1 oracle oinstall 1031 Sep 13 08:40 jzh_ckpt_3189.trc
-rw-r----- 1 oracle oinstall 58 Sep 13 08:40 jzh_ckpt_3189.trm
-rw-r----- 1 oracle oinstall 1059 Sep 13 09:03 jzh_ckpt_3846.trc
-rw-r----- 1 oracle oinstall 66 Sep 13 09:03 jzh_ckpt_3846.trm
-rw-r----- 1 oracle oinstall 945 Sep 13 08:40 jzh_dbrm_3169.trc
-rw-r----- 1 oracle oinstall 67 Sep 13 08:40 jzh_dbrm_3169.trm
-rw-r----- 1 oracle oinstall 1217 Sep 13 08:50 jzh_dbrm_3826.trc
-rw-r----- 1 oracle oinstall 78 Sep 13 08:50 jzh_dbrm_3826.trm
-rw-r----- 1 oracle oinstall 961 Sep 13 08:40 jzh_j006_3403.trc
-rw-r----- 1 oracle oinstall 68 Sep 13 08:40 jzh_j006_3403.trm
-rw-r----- 1 oracle oinstall 948 Sep 13 12:10 jzh_lgwr_3842.trc
-rw-r----- 1 oracle oinstall 70 Sep 13 12:10 jzh_lgwr_3842.trm
-rw-r----- 1 oracle oinstall 845 Sep 13 08:39 jzh_mman_3177.trc
-rw-r----- 1 oracle oinstall 58 Sep 13 08:39 jzh_mman_3177.trm
-rw-r----- 1 oracle oinstall 845 Sep 13 08:40 jzh_mman_3514.trc
-rw-r----- 1 oracle oinstall 58 Sep 13 08:40 jzh_mman_3514.trm
-rw-r----- 1 oracle oinstall 845 Sep 13 08:49 jzh_mman_3834.trc
-rw-r----- 1 oracle oinstall 58 Sep 13 08:49 jzh_mman_3834.trm
-rw-r----- 1 oracle oinstall 911 Sep 13 08:40 jzh_mmon_3201.trc
-rw-r----- 1 oracle oinstall 59 Sep 13 08:40 jzh_mmon_3201.trm
-rw-r----- 1 oracle oinstall 6021 Sep 13 12:21 jzh_mmon_3858.trc
-rw-r----- 1 oracle oinstall 587 Sep 13 12:21 jzh_mmon_3858.trm
-rw-r----- 1 oracle oinstall 855 Sep 13 08:39 jzh_ora_3084.trc
-rw-r----- 1 oracle oinstall 84 Sep 13 08:39 jzh_ora_3084.trm
-rw-r----- 1 oracle oinstall 4583 Sep 13 08:40 jzh_ora_3267.trc
-rw-r----- 1 oracle oinstall 259 Sep 13 08:40 jzh_ora_3267.trm
-rw-r----- 1 oracle oinstall 826 Sep 13 08:40 jzh_ora_3422.trc
-rw-r----- 1 oracle oinstall 83 Sep 13 08:40 jzh_ora_3422.trm
-rw-r----- 1 oracle oinstall 6524 Sep 13 08:45 jzh_ora_3729.trc
-rw-r----- 1 oracle oinstall 303 Sep 13 08:45 jzh_ora_3729.trm
-rw-r----- 1 oracle oinstall 826 Sep 13 08:49 jzh_ora_3742.trc
-rw-r----- 1 oracle oinstall 83 Sep 13 08:49 jzh_ora_3742.trm
-rw-r----- 1 oracle oinstall 1930 Sep 13 08:50 jzh_ora_3925.trc
-rw-r----- 1 oracle oinstall 102 Sep 13 08:50 jzh_ora_3925.trm
-rw-r----- 1 oracle oinstall 1184 Sep 13 08:40 jzh_vktm_3155.trc
-rw-r----- 1 oracle oinstall 87 Sep 13 08:40 jzh_vktm_3155.trm
-rw-r----- 1 oracle oinstall 1186 Sep 13 08:45 jzh_vktm_3492.trc
-rw-r----- 1 oracle oinstall 86 Sep 13 08:45 jzh_vktm_3492.trm
-rw-r----- 1 oracle oinstall 1065 Sep 13 08:49 jzh_vktm_3812.trc
-rw-r----- 1 oracle oinstall 74 Sep 13 08:49 jzh_vktm_3812.trm
預設情況下當天的trace檔案是不能被清理的!
adrci> set control (SHORTP_POLICY=360)
adrci> show control
ADR Home = /u01/app/oracle/diag/rdbms/jzh/jzh:
*************************************************************************
ADRID SHORTP_POLICY LONGP_POLICY LAST_MOD_TIME
LAST_AUTOPRG_TIME LAST_MANUPRG_TIME ADRDIR_VERSION
ADRSCHM_VERSION ADRSCHMV_SUMMARY ADRALERT_VERSION CREATE_TIME
-------------------- -------------------- -------------------- ----------------------------------------
--------------------------------------- ---------------------------------------- --------------------
-------------------- -------------------- -------------------- ----------------------------------------
2275908615 360 8760 2015-09-13 12:21:06.394362 +08:00
1
2 80 1 2015-03-16 01:28:49.774202 +08:00
1 rows fetched
清理trace檔案:
adrci> purge -age 8760 -type TRACE
adrci> exit
[oracle@jzh5 trace]$ ll
total 316
-rw-r----- 1 oracle oinstall 134249 Sep 13 08:55 alert_jzh.log
-rw-r----- 1 oracle oinstall 928 Sep 13 08:39 jzh_arc1_3300.trc
-rw-r----- 1 oracle oinstall 58 Sep 13 08:39 jzh_arc1_3300.trm
-rw-r----- 1 oracle oinstall 1031 Sep 13 08:40 jzh_ckpt_3189.trc
-rw-r----- 1 oracle oinstall 58 Sep 13 08:40 jzh_ckpt_3189.trm
-rw-r----- 1 oracle oinstall 1059 Sep 13 09:03 jzh_ckpt_3846.trc
-rw-r----- 1 oracle oinstall 66 Sep 13 09:03 jzh_ckpt_3846.trm
-rw-r----- 1 oracle oinstall 945 Sep 13 08:40 jzh_dbrm_3169.trc
-rw-r----- 1 oracle oinstall 67 Sep 13 08:40 jzh_dbrm_3169.trm
-rw-r----- 1 oracle oinstall 1217 Sep 13 08:50 jzh_dbrm_3826.trc
-rw-r----- 1 oracle oinstall 78 Sep 13 08:50 jzh_dbrm_3826.trm
-rw-r----- 1 oracle oinstall 961 Sep 13 08:40 jzh_j006_3403.trc
-rw-r----- 1 oracle oinstall 68 Sep 13 08:40 jzh_j006_3403.trm
-rw-r----- 1 oracle oinstall 948 Sep 13 12:10 jzh_lgwr_3842.trc
-rw-r----- 1 oracle oinstall 70 Sep 13 12:10 jzh_lgwr_3842.trm
-rw-r----- 1 oracle oinstall 845 Sep 13 08:39 jzh_mman_3177.trc
-rw-r----- 1 oracle oinstall 58 Sep 13 08:39 jzh_mman_3177.trm
-rw-r----- 1 oracle oinstall 845 Sep 13 08:40 jzh_mman_3514.trc
-rw-r----- 1 oracle oinstall 58 Sep 13 08:40 jzh_mman_3514.trm
-rw-r----- 1 oracle oinstall 845 Sep 13 08:49 jzh_mman_3834.trc
-rw-r----- 1 oracle oinstall 58 Sep 13 08:49 jzh_mman_3834.trm
-rw-r----- 1 oracle oinstall 911 Sep 13 08:40 jzh_mmon_3201.trc
-rw-r----- 1 oracle oinstall 59 Sep 13 08:40 jzh_mmon_3201.trm
-rw-r----- 1 oracle oinstall 6021 Sep 13 12:21 jzh_mmon_3858.trc
-rw-r----- 1 oracle oinstall 587 Sep 13 12:21 jzh_mmon_3858.trm
-rw-r----- 1 oracle oinstall 855 Sep 13 08:39 jzh_ora_3084.trc
-rw-r----- 1 oracle oinstall 84 Sep 13 08:39 jzh_ora_3084.trm
-rw-r----- 1 oracle oinstall 4583 Sep 13 08:40 jzh_ora_3267.trc
-rw-r----- 1 oracle oinstall 259 Sep 13 08:40 jzh_ora_3267.trm
-rw-r----- 1 oracle oinstall 826 Sep 13 08:40 jzh_ora_3422.trc
-rw-r----- 1 oracle oinstall 83 Sep 13 08:40 jzh_ora_3422.trm
-rw-r----- 1 oracle oinstall 6524 Sep 13 08:45 jzh_ora_3729.trc
-rw-r----- 1 oracle oinstall 303 Sep 13 08:45 jzh_ora_3729.trm
-rw-r----- 1 oracle oinstall 826 Sep 13 08:49 jzh_ora_3742.trc
-rw-r----- 1 oracle oinstall 83 Sep 13 08:49 jzh_ora_3742.trm
-rw-r----- 1 oracle oinstall 1930 Sep 13 08:50 jzh_ora_3925.trc
-rw-r----- 1 oracle oinstall 102 Sep 13 08:50 jzh_ora_3925.trm
-rw-r----- 1 oracle oinstall 1184 Sep 13 08:40 jzh_vktm_3155.trc
-rw-r----- 1 oracle oinstall 87 Sep 13 08:40 jzh_vktm_3155.trm
-rw-r----- 1 oracle oinstall 1186 Sep 13 08:45 jzh_vktm_3492.trc
-rw-r----- 1 oracle oinstall 86 Sep 13 08:45 jzh_vktm_3492.trm
-rw-r----- 1 oracle oinstall 1065 Sep 13 08:49 jzh_vktm_3812.trc
-rw-r----- 1 oracle oinstall 74 Sep 13 08:49 jzh_vktm_3812.trm
預設情況下當天的trace檔案是不能被清理的!
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/10271187/viewspace-1798621/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 使用11G 的ADRCI 清除trace檔案
- Oracle清理trace、alert、aud、listener.log檔案Oracle
- oracle清理trace、alert、aud、listener等日誌檔案Oracle
- 建立定期清理listener,trace檔案的shell指令碼指令碼
- Oracle跟蹤檔案trace檔案Oracle
- oracle 11g adrci使用Oracle
- trace檔案閱讀
- oracle trace檔案解析Oracle
- Oracle 11g ADRCI工具使用Oracle
- trace檔案無法生成
- 利用trace重建控制檔案
- 通過trace檔案重新建立控制檔案
- 透過trace檔案重新建立控制檔案
- 利用tkprof檢視trace檔案
- sql_trace 原檔案解析SQL
- 跟蹤 sql 的trace檔案SQL
- Oracle EBS 如何生成trace檔案Oracle
- oracle 11g adrci 工具使用方法Oracle
- 控制檔案恢復—從trace檔案中恢復
- PeopleSoft日誌檔案清理
- 清理bdump目錄檔案
- VSCode 檔案清理VSCode
- Oracle檢視trace檔案步驟Oracle
- 跟蹤session 與 trace檔案分析Session
- 跟蹤SESSION 與 trace 檔案解析Session
- 日誌檔案的監測與檔案清理
- trace檔案備份控制檔案並執行恢復
- oracle之 利用 controlfile trace檔案重建控制檔案Oracle
- 日誌檔案過大清理
- Laravel 路由快取檔案清理Laravel路由快取
- iPhone檔案垃圾清理工具iPhone
- unix 檔案清理一例
- Oracle 11g 通過登入觸發器跟蹤會話產生trace檔案Oracle觸發器會話
- Oracle 使用者Trace 檔案路徑Oracle
- Windows下用命令列工具ADRCI跟蹤日誌檔案Windows命令列
- 控制檔案自動備份報錯併產生TRACE檔案
- 【KSDWRT】自發在ALERT檔案或TRACE檔案中留“腳印”
- 檔案上傳踩坑記及檔案清理原理探究