当前位置:首页 » 编程语言 » sql等待

sql等待

发布时间: 2023-09-19 00:47:44

❶ Oracle的sql语句中wait的含义

nowait:立即执行,如果另有会话正在修改该记录会立即报告错误:ORA-00054: 资源正忙,要求指定 NOWAIT;如果不选择nowait选项则会一直处理等待状态。
wait [n]:等待n秒,如果另有会话正在修改该记录会报告错误:ORA-30006: 资源已被占用; 执行操作时出现 WAIT 超时
=>另外,还有一个skip locked。
skip locked:跳过已被别的会话锁定的记录

❷ SQL*Net break/reset to client 等待事件是什么原因造成的

如果运行的代码中包含某种可能的错误,且在调用中触发了的话,服务器端本地的服务进程有义务对远程客户端告知该信息,这个告知的过程中服务进程就处于SQL*Net break/reset to client等待中,直到客户端收到问题信息为止。

大的查询,表的不合理连接也会照成。
SQL> select * from v$mystat where rownum=1;

SID STATISTIC# VALUE
---------- ---------- ----------
135 0 1

SQL> insert into test05 values(1);

1 row inserted

SQL> commit;

Commit complete

SQL> alter session set events '10046 trace name context forever,level 8';

Session altered

查看trace文件

FETCH #1:c=0,e=204594,p=72,cr=129,cu=0,mis=0,r=1,dep=1,og=4,tim=6307709774
EXEC #2:c=0,e=263868,p=72,cr=130,cu=11,mis=0,r=0,dep=0,og=1,tim=6307739186
ERROR #2:err=1 tim=0
WAIT #2: nam='SQL*Net break/reset to client' ela= 3 driver id=1111838976 break?=1 p3=0 obj#=-1 tim=6307747970
WAIT #2: nam='SQL*Net break/reset to client' ela= 100 driver id=1111838976 break?=0 p3=0 obj#=-1 tim=6307748498

由于等待很短,需要查看v$session_wait_history视图来追踪,需要在别的session查看,不然可能查不到。
select event from v$session_wait_history where sid=135
SQL*Net message to client
SQL*Net break/reset to client
SQL*Net break/reset to client
SQL*Net message from client
SQL*Net message to client
SQL*Net message from client
SQL*Net message to client
SQL*Net message from client
SQL*Net message to client
SQL*Net message from client

SQL> create table test05(t int primary key);

Table created

热点内容
安卓十二系统什么时候更新 发布:2025-07-02 00:12:28 浏览:345
shell脚本需要编译链接 发布:2025-07-02 00:04:20 浏览:474
微信如何重设密码 发布:2025-07-02 00:02:27 浏览:545
java代码基础 发布:2025-07-02 00:00:46 浏览:304
烟花的代码c语言 发布:2025-07-01 23:56:04 浏览:224
安卓默认打开文件方式怎么修改 发布:2025-07-01 23:30:38 浏览:862
压缩机接线座 发布:2025-07-01 23:17:48 浏览:662
iqoo浏览器缓存路径 发布:2025-07-01 23:12:38 浏览:693
明日之后如何获得最新服务器 发布:2025-07-01 23:12:35 浏览:52
tv加密频道 发布:2025-07-01 23:10:58 浏览:625