oracle deadlock

[复制链接]
查看11 | 回复9 | 2005-2-28 12:57:00 | 显示全部楼层 |阅读模式
因为我们现在的程序还在更改,我们的数据库经常产生死锁,大家知道我在数据库中哪里可以设置多长时间产生死锁的进程被数据库自动kill掉。
回复

使用道具 举报

千问 | 2005-2-28 12:57:00 | 显示全部楼层
up
回复

使用道具 举报

千问 | 2005-2-28 12:57:00 | 显示全部楼层
以DBA身份登陆ORACLE:
SELECT * FROM V_$_LOCK;
SELECT *FROM V$SESSION;
ALTER SYSTEM KILL SESSION '&SID,&SERIAL#';
回复

使用道具 举报

千问 | 2005-2-28 12:57:00 | 显示全部楼层
I think that Database Server will rollback one of the statements immediatelyas long as it detect deadlock. Instead, you can design transactions carefully to avoid deadlock or set transaction timeout.
回复

使用道具 举报

千问 | 2005-2-28 12:57:00 | 显示全部楼层
最初由 Calvin 发布
[B]I think that Database Server will rollback one of the statements immediatelyas long as it detect deadlock. Instead, you can set design transactions carefully to avoid deadlock or set transaction timeout. [/B]

"Instead, you can set design transactions carefully to avoid deadlock or set transaction timeout"
如何设置事务timeout时间?在前台应用程序还是后台oracle环境里面?
回复

使用道具 举报

千问 | 2005-2-28 12:57:00 | 显示全部楼层
我知道怎么kill掉进程,我想知道是否oracle 有自动kill掉的机制
回复

使用道具 举报

千问 | 2005-2-28 12:57:00 | 显示全部楼层
oracle不是"kill"进程,而是roll back产生死锁的事务。
回复

使用道具 举报

千问 | 2005-2-28 12:57:00 | 显示全部楼层
Sure, Deadlocks will be detected and be taken care automatially by Oracle Server, and it will do rollback on statement level immediately.
回复

使用道具 举报

千问 | 2005-2-28 12:57:00 | 显示全部楼层
你们是说oracle能自动解决死锁问题。
回复

使用道具 举报

千问 | 2005-2-28 12:57:00 | 显示全部楼层
Oracle can detect and resolve it. But it is your responsibility to design transaction optimally to avoid it.
回复

使用道具 举报

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

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行