Oracle DBMS_DEBUG_JDWP
Version 12.1.0.2

General Information
Library Note Morgan's Library Page Footer
The Library is currently in the process of being upgraded from Oracle Database Version 12.1.0.1 to 12.1.0.2. Demos are being upgraded to reflect the new Container paradigm as well as EBR (Edition Based Redefinition) and may contain references to CDBs, PDBs, and other objects you may not be familiar with such as CDB_OBJECTS_AE: Welcome to 12c.

Interested in Oracle GoldenGate? Check out the IGGOUG,
Purpose Connect/disconnect debug using jdwp protocol
AUTHID CURRENT_USER
Constants
Name Data Type Value
connect_defer_suspension PLS_INTEGER 1
 connect_force_connect PLS_INTEGER 2
connect_string_environment_var PLS_INTEGER 1
connect_string_cookie PLS_INTEGER 2
Dependencies
DBMS_DEBUG_JDWP_CUSTOM DBMS_ISCHED  
Documented No
Exceptions
Error Code Reason
ORA-00022 Attempted to disconnect a session other than self
ORA-01031 User does not have the DEBUG CONNECT SESSION and DEBUG ANY PROCEDURE privileges
ORA-30677 The requested session is already being debugged
ORA-30681 Improper argument was provided for a call to CONNECT_TCP
ORA-30682 Improper value for CONNECT_TCP parameter
ORA-30683 Failed to establish a debugger connection
First Available 9iR1
Security Model Owed by SYS with EXECUTE granted to PUBLIC
Source {ORACLE_HOME}/rdbms/admin/dbmsjdwp.sql
Subprograms
 
CONNECT_TCP
Connect the specified session to the debugger waiting at host:port

This demo performs added security checks to decide if the debug connection request is granted (for example, by verifying that the debugger is running on a trusted host)

Note: In 11gR1, and thereafter, an ACL must be created for this call to succeed (see link below)
dbms_debug_jdwp.connect_tcp(
host               IN VARCHAR2,
port               IN VARCHAR2,
session_id         IN PLS_INTEGER := NULL,
session_serial     IN PLS_INTEGER := NULL,
debug_role         IN VARCHAR2    := NULL,
debug_role_pwd     IN VARCHAR2    := NULL,
option_flags       IN PLS_INTEGER := 0,
extensions_cmd_set IN PLS_INTEGER := 128);
DECLARE
 vhost VARCHAR2(40) := 'bigdog.mlib.org';
 vport VARCHAR2(10) := '1521';
BEGIN
  IF (utl_inaddr.get_host_address(vhost) != '119.168.1.119') THEN
    RAISE_APPLICATION_ERROR(-20000, 'debug connection to this host not permitted');
  ELSE
    dbms_debug_jdwp.connect_tcp(vhost, vport);
  END IF;
  dbms_debug_jdwp.disconnect;
END;
/
 
CURRENT_SESSION_ID
Returns the current session identifier dbms_debug_jdwp.current_session_id RETURN PLS_INTEGER;
SELECT dbms_debug_jdwp.current_session_id
FROM dual;
 
CURRENT_SESSION_SERIAL
Returns the current session serial number dbms_debug_jdwp.current_session_serial RETURN PLS_INTEGER;
SELECT dbms_debug_jdwp.current_session_serial
FROM dual;
 
DISCONNECT
A session cannot yet disconnect another session from a debugger; it can only connect or disconnect itself dbms_debug_jdwp.disconnect(
session_id     IN PLS_INTEGER := NULL,
session_serial IN PLS_INTEGER := NULL);
See CONNECT_TCP Demo Above
 
GET_NLS_PARAMETER
Sets the value of the specified NLS parameter affecting the format in which NUMBER, DATE, TIME (WITH TIME ZONE) and TIMESTAMP (WITH TIME ZONE) dbms_debug_jdwp.get_nls_parameter(name IN VARCHAR2) RETURN VARCHAR2;
desc nls_session_parameters

SELECT * FROM nls_session_parameters;

SELECT dbms_debug_jdwp.get_nls_parameter('NLS_TIMESTAMP_FORMAT')
FROM dual;

execdbms_debug_jdwp.set_nls_parameter('NLS_TIMESTAMP_FORMAT','DD-MON-YYYY HH.MI.SSXFF AM');

SELECT dbms_debug_jdwp.get_nls_parameter('NLS_TIMESTAMP_FORMAT')
FROM dual;
 
PROCESS_CONNECT_STRING
Allows a session to connect to a debugger through the use of either the ORA_DEBUG_JDWP operating system environment variable when running an OCI program, or a web browser "cookie" called OWA_DEBUG_<dad> set when running an application through the PL/SQL Web Gateway dbms_debug_jdwp.process_connect_string(
connect_string      IN VARCHAR2,
connect_string_type IN PLS_INTEGER);
TBD
 
SET_NLS_PARAMETER
Sets the value of the specified NLS parameter affecting the format in which NUMBER, DATE, TIME (WITH TIME ZONE) and TIMESTAMP (WITH TIME ZONE) dbms_debug_jdwp.set_nls_parameter(name IN VARCHAR2, value IN VARCHAR2);
See GET_NLS_PARAMETER Demo Above

Related Topics
DBMS_DEBUG
DBMS_DEBUG_JDWP_CUSTOM
DBMS_NETWORK_ACL_ADMIN
DBMS_NETWORK_ACL_UTILITY
Packages
SYS_CONTEXT

Morgan's Library Page Footer
This site is maintained by Dan Morgan. Last Updated: This site is protected by copyright and trademark laws under U.S. and International law. © 1998-2014 Daniel A. Morgan All Rights Reserved