background: The database appears to be long-term execution of the job resulting in excessive resource consumption, the following is expected to quickly locate the job, rapid intervention processing, restore database performance. Long-term operation through the following statements? T more than the database, a.
Identify the job number that is being executed and its session number
SELECT sid,job from Dba_jobs_running;
Stop execution of the job
SELECT sid,serial# from V$session WHERE sid= ' 130 ';
ALTER SYSTEM KILL SESSION ' &sid,&serial ';
EXEC Dbms_job. Broken (&job,true);
Example Analysis:
1, the query is running the job, through the query there are two, and the process is more occupied by two Oracle process compliance.
Sql> SELECT sid,job from dba_jobs_running;
SID JOB
12 116 16 117
2. Querying information for a running job
Sql> SELECT sid,serial# from v$session WHERE sid= ' 12 ';
SID serial#
12 4
Sql> SELECT sid,serial# from v$session WHERE sid= ' 16 ';
SID serial#
16 1
3, use the job information that is queried to end the job
sql> ALTER SYSTEM KILL SESSION ' 12,4 ';
System altered.
sql> ALTER SYSTEM KILL SESSION ' 16,1 ';
System altered.
4, if you do not want to run the above job, you can set the job to broken.
EXEC Dbms_job. Broken (116,true);
EXEC Dbms_job. Broken (117,true);
Oracle Series Script 3: Life-saving job processing scripts