暂无图片
暂无图片
2
暂无图片
暂无图片
暂无图片

SQL developer debug ORA-01031 ORA-06512

原创 Aubrey 2021-10-04
3062

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;

「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论