高手请进,重赏!!!

tangren 2003-12-22 08:38:29
为何在v$locked_table中没有查到表被锁住表记录,却在给修改某个表结构时出错:
ora-00054:resouce busy and acquire with NOWAIT specified
...全文
52 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
solidpanther 2003-12-23
  • 打赏
  • 举报
回复
查锁:
SELECT A.OWNER,
A.OBJECT_NAME,
B.XIDUSN,
B.XIDSLOT,
B.XIDSQN,
B.SESSION_ID,
B.ORACLE_USERNAME,
B.OS_USER_NAME,
B.PROCESS,
B.LOCKED_MODE,
C.MACHINE,
C.STATUS,
C.SERVER,
C.SID,
C.SERIAL#,
C.PROGRAM
FROM ALL_OBJECTS A,
V$LOCKED_OBJECT B,
SYS.GV_$SESSION C
WHERE ( A.OBJECT_ID = B.OBJECT_ID )
AND (B.PROCESS = C.PROCESS )
ORDER BY 1,2
刘颖博 2003-12-23
  • 打赏
  • 举报
回复
锁有很多种的!
RX,X,SRX等等
kerisyml 2003-12-23
  • 打赏
  • 举报
回复

select a.username, a.sid, a.serial#, b.id1, c.sql_text
   from v$session a, v$lock b, v$sqltext c
   where a.lockwait = b.kaddr
   and a.sql_address = c.address
   and a.sql_hash_value = c.hash_value;
来查询当前被锁住的用户列表,如下:
USERNAME SID SERIAL# ID1 SQL_TEXT
SCOTT 11 9 131080 update plsql_user.s_employee set salary = 5000
llm06 2003-12-23
  • 打赏
  • 举报
回复
ORA-00054 resource busy and acquire with NOWAIT specified

Cause: The NOWAIT keyword forced a return to the command prompt because a resource was unavailable for a LOCK TABLE or SELECT FOR UPDATE command.

Action: Try the command after a few minutes or enter the command without the NOWAIT keyword
是不是你的查询不正确:
To find the table name that corresponds to a particular OBJECT_ID of the
V$LOCKED_OBJECT view:
select xidusn, object_id, session_id, locked_mode from v$locked_object;
XIDUSN OBJECT_ID SESSION_ID LOCKED_MODE
--------- --------- ---------- -----------
3 2711 9 3
0 2711 7 3
select object_name from dba_objects where object_id = 2711;
OBJECT_NAME
-------------
S_EMP
是这样的吗,应该能够看到呀
llm06 2003-12-23
  • 打赏
  • 举报
回复
ORA-00054 resource busy and acquire with NOWAIT specified

Cause: The NOWAIT keyword forced a return to the command prompt because a resource was unavailable for a LOCK TABLE or SELECT FOR UPDATE command.

Action: Try the command after a few minutes or enter the command without the NOWAIT keyword
是不是你的查询不正确:
To find the table name that corresponds to a particular OBJECT_ID of the
V$LOCKED_OBJECT view:
select xidusn, object_id, session_id, locked_mode from v$locked_object;
XIDUSN OBJECT_ID SESSION_ID LOCKED_MODE
--------- --------- ---------- -----------
3 2711 9 3
0 2711 7 3
select object_name from dba_objects where object_id = 2711;
OBJECT_NAME
-------------
S_EMP
是这样的吗,应该能够看到呀
luyuen 2003-12-23
  • 打赏
  • 举报
回复
v$lock
solidpanther 2003-12-23
  • 打赏
  • 举报
回复
系统资源忙,你用的oracle8吧,重新启动吧
tangren 2003-12-23
  • 打赏
  • 举报
回复
v$locked_object视图里一条记录也没有,但我要更改某表的结构时却出现:
ora-00054:resouce busy and acquire with NOWAIT specified
tangren 2003-12-22
  • 打赏
  • 举报
回复
对不起,上面的表应是v$locked_objects

3,491

社区成员

发帖
与我相关
我的任务
社区描述
Oracle 高级技术相关讨论专区
社区管理员
  • 高级技术社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧