Reputation: 1269
Let's say I have a running java web application, where I am trying to save some data, using JDBC that is calling a PL/SQL package in the database.
In the java code, the execute() function has been called, the data to be saved has been sent to the PL/SQL package in the database, which will process the data and eventually save it.
Is there a way to debug the called PL/SQL package, on the fly, with Oracle SQL Developer or PL/SQL Developer, do these IDE's support such remote debugging functionality?
Upvotes: 2
Views: 1765
Reputation: 1850
What you are looking for is a remote debug feature available in Oracle SQL Developer. There are several prerequisites to be met:
alter package SCHEMA.PACKAGE_NAME compile debug;
grant debug connect session to USER_NAME;
is for availability to connect to remote user's sessiongrant debug any procedure to USER_NAME;
is for availability to debug procedures (including those bundled in packages)dba_network_acl_privileges
to check your existing ACL privilegesgrant execute on SYS.DBMS_DEBUG_JDWP to REMOTE_USER_NAME;
to have access to its CONNECT_TCP
procedureIf these requirements are met (or you are able to meet them), you may follow e.g. this entry in Sue Harper's blog (or this article in Oracle blog of the same author, or this one) to reach your goal. In short:
exec DBMS_DEBUG_JDWP.CONNECT_TCP( 'ip-address', port )
before running the code of interest, this may be implemented on session logon trigger.There may be some more specific on this (with Oracle it is more than real), but that is how I usually deal with it.
Also I would like to mention that PL/SQL Developer unfortunately does not support the remote debugging (uses DBMS_DEBUG
package instead of DBMS_DEBUG_JDWP
), even in the latest version. Oracle SQL Developer is written in Java, PL/SQL Developer is not, I think this is the root of the problem.
Upvotes: 6