Oracle Script stops Advanced

Source: Internet
Author: User

First, Dbms_jobs

1, check the running job;


SELECT * from User_scheduler_running_jobs


2, according to Sid isolated the corresponding session;


Select sid,serial# from v$session where sid= ' session_id ';


3, kill the corresponding session;


Alter system kill session ' &sid,&serial ';


Then delete the job, then you can.

Some jobs were killed in the session, although the status has been set wiekilled, but because the resources can not be released immediately, Jobs will continue to run. At this point, if you want to end the script immediately, you can further kill the system process.

1, through the above command to kill the process, the status of the process will be set to "killed", but the locked resource is not released, then you can kill the corresponding process (thread) at the OS level, first execute the following statement to get the process (thread) Number:

Select Spid,osuser,s.program

From V$session s,v$process p

where s.paddr = p.addr and s.sid = ' Sid '

Note: Here is the first sentence to find out the SID,

Execute the above statement and get out of the SPID

2. Kill the process (thread) by clearing the cmd command on the OS

1) First, on Unix OS, execute the following command as root:

#kill-9 728 (728 1 of the statements in the query out of the SPID)

2) The second type, in Windows, kills threads with Orakill,

The syntax is: Orakill SID thread

Note: SID, here's the SID for the instance name of the database where you killed the process

Thread, which refers to the number of threads you want to kill for the process, the SPID queried for 1

Examples are as follows:

C:documents and Settingsadministrator>orakill Zghx 728

Kill of thread ID 728 in instance zghx successfully signalled.

Oracle Script stops Advanced

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.