调试Oracle的存储过程时,需要数据库管理员给用户赋debug权限
GRANT debug any procedure, debug connect session TOUSERXXX;
但是在Oracle12c中, 如果仅有此权限, 在debug时还会报如下错误:
Connecting to the database USERXXX.
Executing PL/SQL: ALTER SESSION SET PLSQL_DEBUG=TRUE
Executing PL/SQL: CALL DBMS_DEBUG_JDWP.CONNECT_TCP( ‘192.168.10.101’, ‘61116’ )
ORA-24247: network access denied by access control list (ACL)
ORA-06512: at “SYS.DBMS_DEBUG_JDWP”, line 68
ORA-06512: at line 1
Process exited.
Disconnecting from the database USERXXX.
从Oracle 12c开始,如果通过基于JDWP(Java Debug Wire Protocol)协议的调试器(如SQL Developer, JDeveloper)调试PL/SQL存储过程, 需要给用户赋予JDWP ACL权限,允许其通过某台主机用调试工具连接数据库, 示例如下:
BEGIN
DBMS_NETWORK_ACL_ADMIN.APPEND_HOST_ACE
(
host => ‘192.168.10.101’, –指定host
lower_port => null,
upper_port => null,
ace => xs$ace_type(privilege_list => xs$name_list(‘jdwp’),
principal_name => ‘USERXXX’, –指定user
principal_type => xs_acl.ptype_db)
);
END;
登录SYS用户 执行以上语句重新连接即可。
摘自:http://www.ifanxu.com/oracle-debug-ora-24247/