<legend id='Xau4h'><style id='Xau4h'><dir id='Xau4h'><q id='Xau4h'></q></dir></style></legend>

<small id='Xau4h'></small><noframes id='Xau4h'>

    <bdo id='Xau4h'></bdo><ul id='Xau4h'></ul>

  1. <tfoot id='Xau4h'></tfoot>
  2. <i id='Xau4h'><tr id='Xau4h'><dt id='Xau4h'><q id='Xau4h'><span id='Xau4h'><b id='Xau4h'><form id='Xau4h'><ins id='Xau4h'></ins><ul id='Xau4h'></ul><sub id='Xau4h'></sub></form><legend id='Xau4h'></legend><bdo id='Xau4h'><pre id='Xau4h'><center id='Xau4h'></center></pre></bdo></b><th id='Xau4h'></th></span></q></dt></tr></i><div id='Xau4h'><tfoot id='Xau4h'></tfoot><dl id='Xau4h'><fieldset id='Xau4h'></fieldset></dl></div>

      Oracle:如何查明是否有待处理的事务?

      时间:2023-09-20

            <i id='X6XHW'><tr id='X6XHW'><dt id='X6XHW'><q id='X6XHW'><span id='X6XHW'><b id='X6XHW'><form id='X6XHW'><ins id='X6XHW'></ins><ul id='X6XHW'></ul><sub id='X6XHW'></sub></form><legend id='X6XHW'></legend><bdo id='X6XHW'><pre id='X6XHW'><center id='X6XHW'></center></pre></bdo></b><th id='X6XHW'></th></span></q></dt></tr></i><div id='X6XHW'><tfoot id='X6XHW'></tfoot><dl id='X6XHW'><fieldset id='X6XHW'></fieldset></dl></div>

            <small id='X6XHW'></small><noframes id='X6XHW'>

              <tbody id='X6XHW'></tbody>

              • <bdo id='X6XHW'></bdo><ul id='X6XHW'></ul>
                <tfoot id='X6XHW'></tfoot><legend id='X6XHW'><style id='X6XHW'><dir id='X6XHW'><q id='X6XHW'></q></dir></style></legend>

                本文介绍了Oracle:如何查明是否有待处理的事务?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我正在寻找一种方法来确定当前会话中是否存在未提交的 INSERT、UPDATE 或 DELETE 语句.一种方法是用当前的 sid 检查 v$lock,但这需要对 v$lock 的读访问,如果 DBA 不想授予它,这是一个问题.任何其他方式(除了跟踪应用程序发出的所有数据库命令)?

                I'm looking for a way to find out if there are uncommited INSERT, UPDATE or DELETE statements in the current session. One way would be to check v$lock with the current sid, but that requires read access to v$lock, which is a problem if the DBA doesn't want to grant it. Any other ways (other than keeping track of all database commands issued by the application)?

                推荐答案

                您可以检查您的会话是否在 V$TRANSACTION 中有一行(显然这需要对此视图的读取权限):

                you can check if your session has a row in V$TRANSACTION (obviously that requires read privilege on this view):

                SQL> SELECT COUNT(*)
                       FROM v$transaction t, v$session s, v$mystat m
                      WHERE t.ses_addr = s.saddr
                        AND s.sid = m.sid
                        AND ROWNUM = 1;
                
                  COUNT(*)
                ----------
                         0
                
                SQL> insert into a values (1);
                
                1 row inserted
                
                SQL> SELECT COUNT(*)
                       FROM v$transaction t, v$session s, v$mystat m
                      WHERE t.ses_addr = s.saddr
                        AND s.sid = m.sid
                        AND ROWNUM = 1;
                
                  COUNT(*)
                ----------
                         1
                
                SQL> commit;
                
                Commit complete
                
                SQL> SELECT COUNT(*)
                       FROM v$transaction t, v$session s, v$mystat m
                      WHERE t.ses_addr = s.saddr
                        AND s.sid = m.sid
                        AND ROWNUM = 1;
                
                  COUNT(*)
                ----------
                         0
                

                这篇关于Oracle:如何查明是否有待处理的事务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:如何杀死正在运行的 SELECT 语句 下一篇:如何找出上次更新 Oracle 表的时间

                相关文章

              • <legend id='DW3HI'><style id='DW3HI'><dir id='DW3HI'><q id='DW3HI'></q></dir></style></legend>

                  <bdo id='DW3HI'></bdo><ul id='DW3HI'></ul>

                1. <tfoot id='DW3HI'></tfoot>

                    <small id='DW3HI'></small><noframes id='DW3HI'>

                  1. <i id='DW3HI'><tr id='DW3HI'><dt id='DW3HI'><q id='DW3HI'><span id='DW3HI'><b id='DW3HI'><form id='DW3HI'><ins id='DW3HI'></ins><ul id='DW3HI'></ul><sub id='DW3HI'></sub></form><legend id='DW3HI'></legend><bdo id='DW3HI'><pre id='DW3HI'><center id='DW3HI'></center></pre></bdo></b><th id='DW3HI'></th></span></q></dt></tr></i><div id='DW3HI'><tfoot id='DW3HI'></tfoot><dl id='DW3HI'><fieldset id='DW3HI'></fieldset></dl></div>