在最近的一次優化過程中發現了oracle
10g中一個作業emd_maintenance.execute_em_dbms_job_procs執行相當頻繁,其實以前也看到過,隻是沒有做過多
的了解和關注。這個任務在某些版本或某些情況會引起一些性能問題。其實
emd_maintenance.execute_em_dbms_job_procs這個作業是為database
control收集相關資料的一個作業,如果沒有使用database control,完全可以删除。下面是官方介紹資料
the
emd_maintenance.execute_em_dbms_job_procs job performs all the
necessary maintenance tasks for the database control repository. these
tasks include :
+ agent ping verification (em_ping.mark_node_status)
+ job purge (mgmt_job_engine.apply_purge_policies)
+ metric rollup (emd_loader.rollup)
+ purge policies (em_purge.apply_purge_policies)
+ repository metric severity calculation (em_severity_repos.execute_repos_severity_eval)
+ repository side collections (emd_collection.run_collections)
+ send notifications
this job should be running every minute for performing all the above operations.
如下所示,它執行的頻繁相當頻繁,一分鐘執行一次
<b>移除emd_maintenance.execute_em_dbms_job_procs</b>
如何移除這個任務呢,一般情況下使用要用sysman使用者登入操作,具體步驟如下所示:
1:首先檢查用sysman賬号是否鎖定了,如果鎖定了需要解鎖,如果沒有的話,直接跳過這一步
2:檢視并設定參數job_queue_processes為0(當設定該值為0的時候則任意方式建立的job都不會運作)
3. 以sysman登入執行下面腳本,移除該作業
當然也可以執行下面腳本來移除任務
sql> @<oracle_home>\sysman\admin\emdrep\sql\core\latest\admin\admin_remove_dbms_jobs.sql;
4:查詢dba_jobs視圖,确認任務是否移除,重設參數job_queue_processes值
if the em jobs were submitted as sys (or another sysdba account), the removal must be done as sys (or that specific) account.
注意:如果em的作業是以sys或者其他sysdba
送出的,則必須使用sys賬号登入才能移除,上面以sysman登入執行的腳本并不能移除該任務。具體可以在查詢作業的時候留意log_user字段
(log_user的值為sysman的才是sysman送出的,否則為其它sysdba)。切記切記。
![](https://img.laitimes.com/img/__Qf2AjLwojIjJCLyojI0JCLicmbw5yN2ADO2gzNwkTMtkTNxcDM3UTOwYDMzAjNxAjMtIDN1MzNvw1MwYTMwIzLcJDN1MzNvw1ZvxmYvwVbvNmLzd2bsJmbj5SNxAjMzV2Zh1Wavw1LcpDc0RHaiojIsJye.png)
重建emd_maintenance.execute_em_dbms_job_procs
1:以sysman使用者登入,确認參數job_queue_processes不為0
2:執行下面腳本
3:重編譯無效對象