为什么我无法在 TOAD 中设置的断点处停止 pl/sql 程序
我有一个简单的oracle存储过程proc1,如下所示:
CREATE OR REPLACE PROCEDURE SYS.proc1
IS
total NUMBER := 0;
temp INTEGER := 0;
BEGIN
FOR i IN 1 .. 5
LOOP
temp := 2 * i;
total := total + temp;
END LOOP;
DBMS_OUTPUT.put_line (total);
END;
proc1的所有者是sys。 sys 有足够的权限来调试 proc1,如以下 sql 命令所示:
SELECT *
FROM session_privs
WHERE privilege LIKE '%DEBUG%';
我将得到以下结果:
DEBUG CONNECT SESSION
DEBUG ANY PROCEDURE
我使用 oracle 11g,如以下 sql 命令所示:
SELECT * FROM v$database;
SELECT * FROM v$instance;
上面的查询给了我:
1223277241,ORCL,8/21/2009 5:28:25 PM,886308,8/21/2009 5:28:28 PM,1,10/15/2007 10:08:59 AM,NOARCHIVELOG,3510666,3399439,CURRENT,8/21/2009 5:28:26 PM,10008,3536169,11/10/2009 3:16:51 PM,NOT ALLOWED,8/21/2009 5:28:25 PM,READ WRITE,MAXIMUM PERFORMANCE,UNPROTECTED,ENABLED,1223308473,1223308473,PRIMARY,886308,DISABLED,SESSIONS ACTIVE,DISABLED,NONE,NO,NO,NO,NO,7,Microsoft Windows IA (32-bit),2,2,3536339,NO,NO,NO,orcl,0,DISABLED,,0,,,NO,,NO,
在 TOAD中
1,orcl,WD00070136,11.1.0.6.0,11/9/2009 11:04:29 AM,OPEN,NO,1,STOPPED,,ALLOWED,NO,ACTIVE,PRIMARY_INSTANCE,NORMAL,NO
,我在 proc1 设置断点,然后我单击“使用调试器执行 plsql”按钮。 TOAD 运行 proc1 并立即显示结果。它只是不会在断点处停止。我不知道为什么。有人遇到过这个问题吗?你怎么解决它?非常感谢!
PS:我用的是蟾蜍9.7.2
i have a simple oracle stored procedure proc1 as follows:
CREATE OR REPLACE PROCEDURE SYS.proc1
IS
total NUMBER := 0;
temp INTEGER := 0;
BEGIN
FOR i IN 1 .. 5
LOOP
temp := 2 * i;
total := total + temp;
END LOOP;
DBMS_OUTPUT.put_line (total);
END;
the owner of proc1 is sys. sys have enough privileges to debug proc1 as the follow sql command shows:
SELECT *
FROM session_privs
WHERE privilege LIKE '%DEBUG%';
i'll get the following result:
DEBUG CONNECT SESSION
DEBUG ANY PROCEDURE
i use oracle 11g as the following sql commands shows:
SELECT * FROM v$database;
SELECT * FROM v$instance;
the upper queries gives me:
1223277241,ORCL,8/21/2009 5:28:25 PM,886308,8/21/2009 5:28:28 PM,1,10/15/2007 10:08:59 AM,NOARCHIVELOG,3510666,3399439,CURRENT,8/21/2009 5:28:26 PM,10008,3536169,11/10/2009 3:16:51 PM,NOT ALLOWED,8/21/2009 5:28:25 PM,READ WRITE,MAXIMUM PERFORMANCE,UNPROTECTED,ENABLED,1223308473,1223308473,PRIMARY,886308,DISABLED,SESSIONS ACTIVE,DISABLED,NONE,NO,NO,NO,NO,7,Microsoft Windows IA (32-bit),2,2,3536339,NO,NO,NO,orcl,0,DISABLED,,0,,,NO,,NO,
and
1,orcl,WD00070136,11.1.0.6.0,11/9/2009 11:04:29 AM,OPEN,NO,1,STOPPED,,ALLOWED,NO,ACTIVE,PRIMARY_INSTANCE,NORMAL,NO
in TOAD, i set breakpoint at proc1, then i click the "execute the plsql with debugger" button. TOAD run proc1 and display the result immediately. It just does not stop at breakpoint. I don't know why. Does anybody ever run into this problem? how do you fix it? Great thanks!
ps: i use toad 9.7.2
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你到底把断点放在哪里?我希望您不要将其放在
CREATE PROCEDURE
行上。如果你把它放在这样的位置,它就不起作用(该语句只创建过程,而不执行它)。您必须从某个地方调用 proc1 并将断点放在调用它的行上,如下所示:
Where exactly do you put your breakpoint? I hope you don't put it on the
CREATE PROCEDURE
line.If you put it on that like, it doesn't work (that statement only creates the procedure, it doesn't execute it). You have to call proc1 from somewhere and put the breakpoint on the line where it is called, like this: