Oracle进程杀不掉怎么办

Oracle进程杀不掉怎么办,第1张

方法/步骤

1.查询哪些对象被锁:

select object_name,machine,s.sid,s.serial#

from v$locked_object l,dba_objects o ,v$session s

where l.object_id = o.object_id and l.session_id=s.sid

2.杀死进程

alter system kill session '137,233'(其中137,223分别是上面查询出的sid,serial#)

PS.以上两步,可通过Oracle的管理控制台来执行。

如果利用上面的方法杀死进程后,进程状态虽被置为"killed",但是锁定的资源很长时间没有被释放,那么可以在OS一级再杀死相应的进程(线程

1.首先获得进程(线程)号:

select spid, osuser, s.program

from v$session s,v$process p

where s.paddr=p.addr and s.sid=137 (137是上面的sid)

2.在OS上杀死这个进程(线程):

1)在unix上,用root身份执行命令:

#kill -9 12345(即上面查询出的spid)

2)在windows(unix也适用)用orakill杀死线程,腊缺例:c:>orakill orcl 12345

orakill是oracle提供的一个可执行命令,轮空辩语法为:orakill sid thread

其中:

sid:表示要杀死的进程属于亏凳的实例名

thread:是要杀掉的线程号,即上面查询出的spid。

用以下的sql可以查询出当前键芦session中正在运行的sql信息培亮茄:

select

s.module,

sql_text,

sn.osuser,

sn.machine,

s.executions

from

sys.v_$sql

s,

sys.all_users

u,

v$session

sn

where

s.parsing_user_id

=

u.user_id

and

upper(u.username)

in

('username')

and

(upper(s.module)

=

'配察app.exe')

and

sn.sql_hash_value

=

s.hash_value

and

sn.sql_address

=

s.address

order

by

s.last_load_time

从Oracle10g开始,Oracle极大的增强了OEM工具,并通过服务器端进行EM工具全面展现。

在10g中,客户端可以不必安装任何Oracle客户端工具,仅凭浏览器就可以调用强大的EM工具。

在Server端,可以通过如下命令启动EM工具控制台:

emctl start dbconsole

以下是启动过程:

[oracle@danaly ~]$ emctl start dbconsole

TZ set to PRC

Oracle Enterprise Manager 10g Database Control Release 10.2.0.1.0

Copyright (c) 1996, 2005 Oracle Corporation. All rights reserved.

Starting Oracle Enterprise Manager 10g Database Control .......................... started.

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

Logs are generated in directory /opt/oracle/product/10.2.0/.cn_danaly/sysman/log

启动之后我们游银就可以通过在浏尘肢览器端输入以派磨世下url访问:

同样停止OEM可以输入如下命令:

emctl stop dbconsole

以下是停止过程:

[oracle@danaly ~]$ emctl stop dbconsole

TZ set to PRC

Oracle Enterprise Manager 10g Database Control Release 10.2.0.1.0

Copyright (c) 1996, 2005 Oracle Corporation. All rights reserved.

Stopping Oracle Enterprise Manager 10g Database Control ...... Stopped.

也可以直接键入emctl查看emctl支持的选项:

[oracle@danaly ~]$ emctl

TZ set to PRC

Oracle Enterprise Manager 10g Database Control Release 10.2.0.1.0

Copyright (c) 1996, 2005 Oracle Corporation. All rights reserved.

Invalid arguments

Unknown command option

Usage::

Oracle Enterprise Manager 10g Database Control commands:

emctl start| stop| status| setpasswd dbconsole

emctl secure

emctl set ssl test|off|on em

emctl set ldap

emctl blackout options can be listed by typing "emctl blackout"

emctl config options can be listed by typing "emctl config"

emctl secure options can be listed by typing "emctl secure"

emctl ilint options can be listed by typing "emctl ilint"

emctl deploy options can be listed by typing "emctl deploy"


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/yw/12437114.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-25
下一篇 2023-05-25

发表评论

登录后才能评论

评论列表(0条)

保存