Activating and using debug in SQLDeveloper

Before to use debug in SQLDeveloper we need to prepare the database to accept this request and we need to add grants to the user that activate a debug.

Preparing database environments:

create role SQLDEV_DEBUG_ROLE;

begin
 dbms_network_acl_admin.append_host_ace(host=>'*', 
                                        ace=> sys.xs$ace_type(privilege_list=>sys.XS$NAME_LIST('JDWP') , 
                                        principal_name=>'SQLDEV_DEBUG_ROLE', 
                                        principal_type=>sys.XS_ACL.PTYPE_DB) );
end;
/

grant debug connect session to SQLDEV_DEBUG_ROLE; 
grant debug any procedure to SQLDEV_DEBUG_ROLE;
grant execute on DBMS_DEBUG_JDWP to SQLDEV_DEBUG_ROLE;

grant SQLDEV_DEBUG_ROLE to scott;

--to Check
select * from dba_network_acls;
select * from dba_network_acl_privileges;
select host from dba_host_acls;

--Check firewall port from 4000 and 4199 (in both direction client/server)

Output example from SQLDeveloper:

Read moreActivating and using debug in SQLDeveloper