How to Kill a single Oracle thread in a Windows 2000 environment

Source: Internet
Author: User
Tags query thread
Oracle|window
How to Kill a single Oracle thread in a Windows 2000 environment



Source: http://metalink.oracle.com

Key word: Oracle Thread Kill

Description: This article describes the use of Orakill tools in Windows environments

Body:

Have you ever experienced anything like this? A user process that consumes resources for a long time without releasing it causes the Oracle process to consume a large amount of the system's resources, and the oralce system becomes less efficient. If you simply turn off the restart Oracle instance, it will definitely affect all users. Is there a way to just kill the problem user process without shutting down the entire Oralce instance? The answer is yes, using ORALCE to provide a tool called Orakill.

As you all know, Windows 2000 is a threaded operating system, not a process-based operating system like UNIX or Linux. The entire Oracle background process, user processes, etc., in Windows 2000 environments, are included in ORACLE.EXE, a separate system process, and can be seen by looking at ' Task Manager '-' process '. If you are not using the MTS multithreaded server model, if you kill ORACLE.EXE this process, it will cause the entire Oracle instance to close, as with the Shutdown Abort command.

Since Windows did not mention a tool designed to kill a single thread, Oracle began with Oracle7.3.3.6 by providing a tool ――orakill that is used to force the kill of a thread in a Windows environment based on a character interface.

The use of Orakill is as follows:

DOS prompt: >orakill sid thread

Description: SID number of SIDS Oracle

Thread ID number of threads Oracle

In the Sql*plus tool, you can query the Oracle thread number

Sql:>select p.spid THREADID, S.osuser, S.program

Sql:>from v$process p, v$session s

Sql:>where p.addr = s.addr

The results are as follows:

THREADID Osuser Program

--------- ----------------------- -----------------------------

169 SYSTEM ORACLE. Exe

215 SYSTEM ORACLE. Exe

280 SYSTEM ORACLE. Exe

267 SYSTEM ORACLE. Exe

287 SYSTEM ORACLE. Exe

The SYSTEM ORACLE. Exe

271 SYSTEM ORACLE. Exe

282 SYSTEM ORACLE. Exe

266

269

239 Prod_nt\djones SVRMGRL. Exe

281 ssmith-pc mith SQLPLUSW. Exe



Rows selected.

It is important to note that if you kill an Oracle core background thread (DBWR, LGWR, Smon or Pmon), it will cause the Oracle instance to shut down. The way to check Oracle's core background threads is as follows:

Sql:>select vb.name NOME, Vp.programe processname, Vp.spid THREADID, Vs,sid SID

Sql:>from v$session vs, v$process VP, v$bgprocess vb

Sql:>where vb.addr <>

SQL:&GT;VB.PADDR = Vp.addr and

SQL:&GT;VP.ADDR = vs.paddr

The results of the query are as follows:



NOME processname THREADID SID

----- ----------------------------------- --------- ------

Pmon ORACLE. EXE 169 1

DBW0 ORACLE. EXE 215 2

LGWR ORACLE. EXE 280 3

CKPT ORACLE. EXE 267 4

Smon ORACLE. EXE 287 5

Reco ORACLE. EXE 288 6

SNP0 ORACLE. EXE 271 7

SNP1 ORACLE. EXE 282 8



8 rows selected.

Welcome everyone to Exchange mailto:stevenqiu@sohu.com




Related Article

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.