How to remote debug PLSQL code on SQL Developer?

I am working on a Java based enterprise application and I am looking for ways to debug plsql code in sql developer when the request comes from the application.

I can remotely debug pl sql code using a test sql program written locally by calling a specific procedure in my database.

I want to be able to achieve the same debugging control when a request comes from an application.

By right-clicking on the db connection and clicking on the remote debug file, I get a "Listener for JPDA" pop-up window asking me for the port and local address. Entering the ip-address of the machine on which this application is deployed, I get an error: "The debugger cannot listen to JPDA using the specified parameters. Do you want to change the parameters?

How to do it?

+4
source share
4 answers

ip- , , . , , ip addres , , .

: NAT , , ip: . ip , IP-, .

. JDeveloper SQL Developer.

0

MDW, - , .

, , SQLDeveloper Remote Debug. . , . java, :

private void debugPlSql() throws SQLException {
    CallableStatement cstmt = null;
    try {
        cstmt = conn.prepareCall(
            "call DBMS_DEBUG_JDWP.CONNECT_TCP('...my-ip-address...', 16000 )");
        cstmt.executeUpdate();
    } finally {
        // cstmt.close() ...
    }
}

my-ip-address - IP- , 16000 - , , ( - )

(), , , 4000 . 16000, , SQLDeveloper.

debugPlSql sql.

Edit:

:

GRANT DEBUG CONNECT SESSION TO myuser;
GRANT DEBUG ANY PROCEDURE TO myuser;
0

SQL Developer ( JRE) JDK 1.8. ( SYS). ACL IP- ( SQL-).

See the blog for detailed instructions.

http://rajiv-kuriakose.blogspot.in/2016/08/how-to-enable-remote-debugging-in-sql.html

0
source

Source: https://habr.com/ru/post/1531055/


All Articles