关于kill oracle os 进程的问题

[复制链接]
查看11 | 回复9 | 2005-10-30 17:05:33 | 显示全部楼层 |阅读模式
假如有一进程,在执行大量的insert 语句,一直没有commit,一段时间后,因业务需要,需要停止,因此利用alter system kill session 干掉,这个时候,进程状态为killed,一直rollback,因此对表还会lock
,如果这个时候从os把 oracle 进程kill 掉。lock 就会被释放,由此产生一问题。。。 进程 被kill后 ,系统还回滚不?
回复

使用道具 举报

千问 | 2005-10-30 17:05:33 | 显示全部楼层
是啊.也有这个问题. 不过我insert的不敢kill.一般都是select的才敢偶尔做一下.
回复

使用道具 举报

千问 | 2005-10-30 17:05:33 | 显示全部楼层
我也碰到過類似問題,不過我可不敢KILL,呵呵,你強
回复

使用道具 举报

千问 | 2005-10-30 17:05:33 | 显示全部楼层
pmon will wrok now
the process is faulire
The process monitor (PMON) performs process recovery when a user process fails. PMON is responsible for cleaning up the database buffer cache and freeing resources that the user process was using. For example, it resets the status of the active transaction table, releases locks, and removes the process ID from the list of active processes.
PMON periodically checks the status of dispatcher and server processes, and restarts any that have stopped running (but not any that Oracle has terminated intentionally). PMON also registers information about the instance and dispatcher processes with the network listener.
Like SMON, PMON checks regularly to see whether it is needed and can be called if another process detects the need for it.
我觉得是要回滚的
大家可以做个trace
回复

使用道具 举报

千问 | 2005-10-30 17:05:33 | 显示全部楼层
这个时候不会rollback了,但是当重启实例之后,应该会发生实例恢复!猜测!
回复

使用道具 举报

千问 | 2005-10-30 17:05:33 | 显示全部楼层
Oracle的后台进程会处理这些异常进程的,当然也可以:
[php]
select s.username,s.sid,s.serial#,p.spid,s.status,s.program,s.terminal,
'alter system kill session '||''''||s.sid||','||s.serial#||''';' oracle_kill,
'kill -9 '||p.spid unix_kill,
'orakill '||i.instance_name||' '||p.spid windows_kill
from v$session s,v$process p,v$instance i
where s.paddr=p.addr
and s.type='USER'
and s.username is not null
/
--
[/php]
回复

使用道具 举报

千问 | 2005-10-30 17:05:33 | 显示全部楼层
那么当显示是killed的时候到底oracle在做什么动作?为什么会老是显示KILLED而不会消失?请教一下!^_^
回复

使用道具 举报

千问 | 2005-10-30 17:05:33 | 显示全部楼层
KILLED就是进行撤消,并由Oracle等待PMON进程来清理
回复

使用道具 举报

千问 | 2005-10-30 17:05:33 | 显示全部楼层
即時kill掉os 進程還是要回滾的,我們以前遇到過
回复

使用道具 举报

千问 | 2005-10-30 17:05:33 | 显示全部楼层
不敢kill了,曾经kill了一个process把数据库宕掉了
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行