Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

ORACLE series script 3: life-saving JOB processing script

2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Background: the long-term execution of JOB in the database leads to excessive resource consumption. Through the following expectations, we can quickly locate JOB, quickly intervene processing, and restore database performance. Long-term operation and maintenance through the following statements? t or above database? Yes, it works every time.

Find out the JOB number that is being executed and its session number

SELECT SID,JOB FROM DBA_JOBS_RUNNING

Stop the 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)

Case analysis:

1, query the running Job, there are two through the query, and the process occupies more is consistent with the two ORACLE processes.

SQL > SELECT SID,JOB FROM DBA_JOBS_RUNNING

SID JOB

12 116 16 117

2. Query the information of the 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 queried job information to end the job.

SQL > ALTER SYSTEM KILL SESSION '127.4'

System altered.

SQL > ALTER SYSTEM KILL SESSION '16jue 1'

System altered.

4. If you don't want to run the above job, you can set job to broken.

EXEC DBMS_JOB.BROKEN (116 heroin true)

EXEC DBMS_JOB.BROKEN (117 true)

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report