Oracle sysman.mgmt_jobs導致資料庫自動重啟
Oracle sysman.mgmt_jobs 導致資料庫自動重啟
問題現象;
新接手的資料庫,檢查告警日誌,發現資料庫每天 凌晨 2 點自動重啟;
Tue Jun 12 02:00:28 2018
Shutting down instance (immediate)
Stopping background process SMCO
Shutting down instance: further logons disabled
資料庫環境 :
OS:Windws Server 2012
DB:Oracle 11.2.0.1.0
問題分析:
沒有同事設定過資料庫自動重啟的任務;
作業系統計劃任務,資料庫均沒有發現 2 點的 JOB ;
自動重啟之前,告警日誌沒有報錯;
檢視 2 點生成的所有 trace 日誌,發現每天的 trace 日誌都和 OEM 有關,部分內容如下:
*** MODULE NAME:( OEM.CacheModeWaitPool)
--------Dumping Sorted Master Trigger List --------
Trigger Owner : SYSMAN
Trigger Name : JOB_SUMM_INS_TRIGGER2
Trigger Owner : SYSMAN
Trigger Name : JOB_SUMM_INS_TRIGGER
……
檢視對應的觸發器也沒有發現異常;
問題原因:
最後分析,很有可能是同事在使用 DBCA 建立例項時,第四步,選擇了 ” 配置 Enterprise Manager” ,這個配置會有一個每日磁碟備份的選項,預設時間就是每天 2 點,正是因為這個原因導致資料庫每天 2 點自動重啟,因為資料庫是非歸檔模式, Oracle 每天 2 點透過 RMAN 自動 停庫做冷備;
透過
OEM
自動備份的檔案如下:
SELECT start_time, end_time, operation, status
FROM V$RMAN_STATUS
order by start_time desc;
---透過OEM自動的RMAN備份大多都是失敗的,因為閃回區不足了;
解決方案:
How to stop Database Autobackup Every Day At 02:00 Am which was configured during Database creation using DBCA ? ( 文件 ID 1992075.1)
-- Identify the Backup Job name
select JOB_OWNER, JOB_NAME
from SYSMAN.MGMT_JOB
where JOB_NAME like '%BACKUP%';
-- Delete the Job from DB Control Jobs repository
begin
sysman.mgmt_jobs.delete_job('BACKUP_EASORCL_000001', 'SYS');
end;
刪除時會報如下錯誤:
--- 透過下面的文件可以解決;
How to Force Stop a Stuck Job in Grid Console ( 文件 ID 430626.1)
begin
sysman.mgmt_job_engine.stop_all_executions_with_id('F01FFCEEC1DD42EB94B6D12622E25EB4',
TRUE);
end;
begin
sysman.mgmt_jobs.delete_job('BACKUP_EASORCL_000001', 'SYS');
end;
select JOB_OWNER, JOB_NAME,JOB_ID
from SYSMAN.MGMT_JOB
where JOB_NAME like '%BACKUP%';
---空
第二天檢視,資料庫已經不在自動重啟了;
歡迎關注我的微信公眾號"IT小Chen",共同學習,共同成長!!!
官方文件具體內容如下:
How to stop Database Autobackup Every Day At 02:00 Am which was configured during Database creation using DBCA ? ( 文件 ID 1992075.1)
In this Document
|
APPLIES TO:
Enterprise
Manager for Oracle Database - Version 10.2.0.1 to 11.2.0.4 [Release 10.2 to
11.2]
Oracle Database - Enterprise Edition - Version 10.2.0.1
to 11.2.0.4 [Release 10.2 to 11.2]
Information in this document applies to any
platform.
GOAL
The Database Configuration assistant (DBCA) was used to create the database.
In step 4, Management options screen, you have the option to choose "Configure the database with Enterprise Manager". If you choose this , then you have the option to use Grid control or Database control.
If you choose
"Use Database Control for Database Management" ,then there is an
option to setup automatic database daily backups. Hence the Database might
automatically shutdown daily for backup.
Is there a way to disable the automatic database shutdown for backup ?
SOLUTION
We would need to
delete the Backup job schedule from the DB Console.
If the DB console is down and unable to access, We can delete the Backup job
from the DBconsole repository.
-- Identify the Backup Job name
select JOB_OWNER, JOB_NAME from SYSMAN.MGMT_JOB where JOB_NAME like '%BACKUP%';
JOB_OWNER
JOB_NAME
---------------- --------------------------------------------------------
SYS
BACKUP_QASEPOMS.BWI40G.VZBI.CAAS_000001
-- Delete the Job from DB Control Jobs repository
begin
sysman.mgmt_jobs.delete_job('BACKUP_QASEPOMS.BWI40G.VZBI.CAAS_000001','SYS');
end;
How to Force Stop a Stuck Job in Grid Console (
文件
ID 430626.1)
In this Document
|
|
APPLIES TO:
Enterprise
Manager Base Platform - Version 10.2.0.1 to 11.1.0.1 [Release 10.2 to 11.1]
Information in this document applies to any
platform.
GOAL
Using 10.2 Grid
Console.
A scheduled Job Run is stuck in the 'Running' / 'Status Pending' status
for many days without any progress. This may occur if the target or the agent
on that target machine is down and cannot be reached.
- Trying to Suspend / Stop this job returns :
All executions of the job were stopped successfully. Currently running
steps will not be stopped.
<Job Name is displayed here>
- After
this, the particular Job Execution remains in 'Stop Pending' status.
Trying to Stop this job execution returns :
The specified job, job run or execution is still active. It must finish running, or be stopped before it can be deleted. Filter on status 'Active' to see active executions.
- Choosing the Job and clicking on 'Retry' returns :
"The specified job can not be re-submitted. It either has active executions, or it has no failed executions."
This document provides the steps to forcefully stop the executions of this job and delete it.
Note:
See the following document for assistance in troubleshooting the EM 12c job system:
Note 1546696.1 EM 12c: Troubleshooting the Enterprise Manager 12c Cloud Control Job System
SOLUTION
Follow these steps to stop the job executions from the repository and delete the job :
+ Install the
latest version of EMDIAG REPVFY (
Note 421053.1
).
Run the following command to obtain more details on the problems
with the Job system :
$
./repvfy verify jobs
$ ./repvfy verify jobs -detail
If the stuck job
is seen in the above output, please log an SR with Oracle Support to obtain
more information regarding these tests.
If the job is not shown in the above output, then follow the remaining steps in
this document.
It is important to exercise caution when running any manual commands against
the repository database, if necessary a valid backup can be taken.
+ Connect to database as SYSMAN and run:
select job_id, job_name, job_owner from mgmt_job where job_name like '%<name of job as seen in the console>%';
Make note of the JOB_ID returned by the above query.
+ Stop all the executions and the current runs of the job :
exec mgmt_diag.stopcurrentjobexec('<job ID as returned by above query>');
OR
exec mgmt_job_engine.stop_all_executions_with_id('<job ID as returned by above query>');
Check the output of :
select EXECUTION_ID,
status from MGMT_JOB_EXEC_SUMMARY
where job_id ='<job ID returned by the 1st query>' ;
If the execution has been stopped successfully, the status should have a value : 18 i.e SKIPPED.
- You can also try stopping the executions forcefully using :
exec mgmt_job_engine.stop_all_executions_with_id('<job ID as returned by above query>',TRUE);
- From EMDIAG, you can use :
exec mgmt_diag.stopjob('<job ID as returned by above query>');
- You can also
stop the job using Emcli :
Setup emcli as doumented in Installation and Setup of emcli
From the command line run :
emcli stop_job -name=<specify the name of the job>
- If EM
level auditing has been enabled, then you may face ORA-01422 from the above
commands.
To resolve these errors, refer to :
Note.401479.1 : Problem Setting Up the Auditing System for Enterprise Manager prevents job deletion
+ Check in the Grid console, that the Job Run / Execution is no
longer in Running / Stop Pending status respectively.
The Job Execution should have a 'Skipped' status.
+ Choose
this job and click on the 'Delete' button in the Grid console. The Job deletion
should go fine now.
If you still face any issue, login to the repository as the
SYSMAN user and run :
SQL> exec mgmt_job_engine.delete_job('<job ID as returned by above query>');
+ If the job still cannot be deleted :
- Shutdown the OMS and take a valid backup of the repository database. This is mandatory as the next step will perform manual operations against the repository and it is essential to have a backup, to revert back to, incase of any problems.
- In the repository database, login as the sysman user and execute :
SQL> UPDATE
mgmt_job_exec_summary SET status = 8,
end_time = (sysdate - 1) WHERE job_id
='<job ID as returned by above query>';
Then 1 row should
be updated. If no errors do a commit, else rollback.
- Once this update is successful, try to delete the jobs from the Console
and it should go through
without any errors.
If using 10.2.0.5 Grid Control, there is an option to 'Force Stop' the job.
Note 838857.1
: New
Features related to Jobs in 10.2.0.5 Enterprise Manager Grid Control
Also refer to :
Note 413005.1
: Problem:
Unable To Delete Job From Grid Control ORA-20414
Note 605071.1
: Grid
Control Job Is stuck in 'Scheduled' status and unable
to Remove / Stop the Job
Note 401479.1
: Problem:
Setting Up the Auditing System for Enterprise Manager prevents job deletion
REFERENCES
NOTE:401479.1
-
Problem: Setting Up the Auditing System for Enterprise Manager prevents job
deletion
NOTE:413005.1
-
Problem: Unable To Delete Job From Grid Control ORA-20414
NOTE:421053.1
-
EMDIAG Troubleshooting Kits Master Index
NOTE:605071.1
-
Grid Control Job Is stuck in 'Scheduled' status and unable to Remove / Stop the
Job
-
CANNOT STOP AND DELETE JOB FROM GRID CONTROL
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29785807/viewspace-2156188/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 由AIX系統故障導致系統重啟,使Oracle資料庫自動啟動例項AIOracle資料庫
- HA異常導致oracle資料庫無法啟動Oracle資料庫
- MySQL 5.6因為OOM導致資料庫重啟MySqlOOM資料庫
- ORACLE windows驅動磁碟機代號自動變更導致oracle資料庫崩潰無法啟動OracleWindows資料庫
- oracle SGA設定過大導致資料庫無法啟動Oracle資料庫
- EM自動任務導致資料庫緩慢資料庫
- 4 配置Oracle資料庫自動啟動Oracle資料庫
- oracle資料庫開機自動啟動Oracle資料庫
- 配置作業系統重啟後,Oracle資料庫和監聽自動啟動作業系統Oracle資料庫
- ORACLE自動重編譯包導致查詢被卡Oracle編譯
- 資料庫自動重連資料庫
- 歸檔問題導致的資料庫無法啟動資料庫
- 修改SQLNET.ORA導致資料庫無法啟動SQL資料庫
- Sybase資料庫日誌過大導致不能啟動(轉)資料庫
- 設定Oracle資料庫開機自啟動Oracle資料庫
- asm磁碟組依賴導致資料庫自啟動報錯ASM資料庫
- oracle 10g rac資料庫不能自動啟動Oracle 10g資料庫
- ORACLE的歸檔空間滿導致的監聽故障資料庫無法啟動Oracle資料庫
- 資料庫自動啟動關閉資料庫
- mongoDB因root啟動關閉資料庫導致mongo普通使用者無法啟動MongoDB資料庫
- undo表空間出現壞塊導致資料庫重啟問題解決資料庫
- 資料庫恢復狀態可能導致JOB無法自動執行資料庫
- SPFILE 錯誤導致資料庫無法啟動(ORA-01565)資料庫
- 3.1.5.8 隨系統啟動自動啟動資料庫資料庫
- Oracle資料庫導致效能問題的可能原因Oracle資料庫
- oracle刪除datafile導致資料庫打不開Oracle資料庫
- 自動備份Oracle資料庫Oracle資料庫
- oracle 11.2.0.2 版本產生的私網地址不通會導致第2個節點自動重啟Oracle
- [oracle]undo表空間出錯,導致資料庫例項無法開啟Oracle資料庫
- Oracle資料庫啟動步驟Oracle資料庫
- Oracle資料庫啟動過程Oracle資料庫
- RedHat(Linux) Oracle資料庫設定開機自啟動RedhatLinuxOracle資料庫
- 又一例SPFILE設定錯誤導致資料庫無法啟動資料庫
- Oracle 資料庫不一致導致異常的恢復Oracle資料庫
- 5.9 TSM的客戶端(ORACLE資料庫)排程程式不能啟動導致備份不正常客戶端Oracle資料庫
- 電源紋波偏高導致產品不斷自動重啟經驗案例分析
- AIX下自動啟動/停止Oracle資料庫AIOracle資料庫
- 伺服器意外斷電導致無法重啟資料恢復伺服器資料恢復