WEB开发网
开发学院数据库Oracle SQL Server和Oracle中的锁和死锁 阅读

SQL Server和Oracle中的锁和死锁

 2008-09-02 12:46:27 来源:WEB开发网   
核心提示: update HR.JOBSSET JOB_title = ’S.President’where job_id = ’AD_PRES’;步骤三:重新ORACLE SQL *plus 之一窗口,执行update HR.JOBSSET JOB_t

update HR.JOBS

SET JOB_title = ’S.President’

where job_id = ’AD_PRES’;

步骤三:

重新ORACLE SQL *plus 之一窗口,执行

update HR.JOBS

SET JOB_title = ’S.President’

where job_id = ’AD_PRES’;

发现已经无法完成,因为在等待资源释放。

步骤四:

登陆ORACLE SQL *plus 之二窗口,执行:

update HR.JOBS

SET JOB_title = ’S.Finance Manager’

where job_id = ’FI_MGR’

此时出现ORA-00060错误,如下图所示:

SQL Server和Oracle中的锁和死锁

发现报出错误,系统检测到死锁,此时打开C:oracleadminORADBudump的oradb_ora_5528文件会发现已经记录了死锁deadlock日志,文字如下:

*** 2008-07-05 16:46:43.000
*** SESSION ID:(17.16) 2008-07-05 16:46:43.000
DEADLOCK DETECTED
Current SQL statement for this session:
update HR.JOBS
SET JOB_title = ’S.President’
where job_id = ’AD_PRES’
The following deadlock is not an ORACLE error. It is a
deadlock due to user error in the design of an application
or from issuing incorrect ad-hoc SQL. The following
infromation may aid in determining the deadlock:
Deadlock graph:
---------Blocker(s)-------- ---------Waiter(s)---------
Resource Name     process session holds waits process session holds waits
TX-000a0002-00001904    16   17   X       17   18      X
TX-00010010-00001917    17   18   X       16   17      X
session 17: DID 0001-0010-00000003session 18: DID 0001-0011-00000003
session 18: DID 0001-0011-00000003session 17: DID 0001-0010-00000003
Rows waited on:
Session 18: obj - rowid = 00007339 - AAAHM5AAFAAAABGAAD
(dictionary objn - 29497,file- 5, block - 70, slot - 3)
Session 17: obj - rowid = 00007339 - AAAHM5AAFAAAABGAAA
(dictionary objn - 29497, file - 5, block - 70, slot - 0)
Information on the OTHER waiting sessions:
Session 18:
pid=17 serial=20 audsid=0 user: 0/SYS
O/S info: user: WANGTMwangtm, term: WANGTM, ospid: 5200:4876, machine: WORKGROUPWANGTM
prigram: sqlplusw.exe
Current SQL Statement:
update HR.JOBS
SET JOB_title = ’S.Finance Manager’
where job_id = ’FI_MGR’
End of information on OTHER waiting sessions. 

上一页  1 2 3 4 5 6  下一页

Tags:SQL Server Oracle

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接