1.故障现象
Connecting to the database DEV775@dev11gdb_server231.
Executing PL/SQL:
ALTER SESSION SET PLSQL_DEBUG=TRUE
Executing PL/SQL:
CALL DBMS_DEBUG_JDWP.CONNECT_TCP( '192.168.45.1', '4000' )
ORA-01031: insufficient privileges
ORA-06512: at "SYS.DBMS_DEBUG_JDWP", line 68
ORA-06512: at line 1
This session requires DEBUG CONNECT SESSION and DEBUG ANY PROCEDURE user privileges.
Process exited.
Disconnecting from the database DEV775@dev11gdb_server231.
The debugger is unable to connect.
2.故障处理
Grant the below privileges.
grant DEBUG CONNECT SESSION to DEV775;
grant DEBUG ANY PROCEDURE to DEV775;
Now try to debug again. If there is still issue then execute below using DBA user.
BEGIN
DBMS_NETWORK_ACL_ADMIN.APPEND_HOST_ACE (
host => '10.17.275.5',
lower_port => null,
upper_port => null,
ace => xs$ace_type(
privilege_list => xs$name_list('jdwp'),
principal_name => 'DEV775',
principal_type => xs_acl.ptype_db
)
);
END;
/
Try the debug again. If you see still issue then set the allowed port numbers in the SQL DEVELOPER.
SQL Developer >> Tools >> Preferences >> Debugger >> set Debugging Port Range
3. 回收权限(ROLLBACK)
BEGIN
DBMS_NETWORK_ACL_ADMIN.remove_host_ace (
host => '192.168.45.1',
lower_port => null,
upper_port => null,
ace => xs$ace_type(
privilege_list => xs$name_list('jdwp'),
principal_name => 'HR',
principal_type => xs_acl.ptype_db
)
);
END;
/
-- 其他权限回收示例
BEGIN
DBMS_NETWORK_ACL_ADMIN.remove_host_ace (
host => '192.168.45.1',
lower_port => null,
upper_port => null,
ace => xs$ace_type(
privilege_list => xs$name_list('connect', 'resolve','HTTP','HTTP_PROXY'),
principal_name => 'HR',
principal_type => xs_acl.ptype_db
)
);
END;
/
4. 查看权限
SELECT HOST, LOWER_PORT, UPPER_PORT,
ACE_ORDER, PRINCIPAL, PRINCIPAL_TYPE,
GRANT_TYPE, INVERTED_PRINCIPAL, PRIVILEGE,
START_DATE, END_DATE
FROM (SELECT ACES.*,DBMS_NETWORK_ACL_UTILITY.CONTAINS_HOST('192.168.45.1',HOST) PRECEDENCE
FROM DBA_HOST_ACES ACES)
WHERE PRECEDENCE IS NOT NULL
ORDER BY PRECEDENCE DESC,
LOWER_PORT NULLS LAST,
UPPER_PORT NULLS LAST,
ACE_ORDER;
SELECT HOST, LOWER_PORT, UPPER_PORT, PRIVILEGE, STATUS
FROM (SELECT ACES.*,
DBMS_NETWORK_ACL_UTILITY.CONTAINS_HOST('192.168.45.1',
HOST) PRECEDENCE
FROM USER_HOST_ACES ACES)
WHERE PRECEDENCE IS NOT NULL
ORDER BY PRECEDENCE DESC,
LOWER_PORT NULLS LAST,
UPPER_PORT NULLS LAST;





