Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
515 views
in Technique[技术] by (71.8m points)

oracle - Network access denied at "SYS.DBMS_DEBUG_JDWP"

When trying to save a trigger I get this error

Connecting to the database XE.
Executing PL/SQL: CALL DBMS_DEBUG_JDWP.CONNECT_TCP( '192.168.56.1', '59537' )
ORA-24247: network access denied by access control list (ACL)
ORA-06512: at "SYS.DBMS_DEBUG_JDWP", line 68
ORA-06512: at line 1
Process exited.
Disconnecting from the database XE.

I'm just a beginner in working with DB, how can I fix this?

question from:https://stackoverflow.com/questions/65541172/network-access-denied-at-sys-dbms-debug-jdwp

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

It is about the ACL (as the message says). Here's a walkthrough, see if it helps. I'm using user SCOTT; you'd use your own user.

SQL> show user
USER is "SYS"
SQL>
SQL> SELECT * FROM dba_network_acls;

no rows selected

Create ACL:

SQL> BEGIN
  2     DBMS_NETWORK_ACL_ADMIN.create_acl (
  3        acl          => 'xedba.xml',
  4        description  => 'TCP, SMTP, MAIL, HTTP Access',
  5        principal    => 'SCOTT',
  6        is_grant     => TRUE,
  7        privilege    => 'connect',
  8        start_date   => NULL,
  9        end_date     => NULL);
 10  END;
 11  /

PL/SQL procedure successfully completed.

Assign ACL:

SQL> BEGIN
  2     DBMS_NETWORK_ACL_ADMIN.assign_acl (acl         => 'xedba.xml',
  3                                        HOST        => '*',
  4                                        lower_port  => NULL,
  5                                        upper_port  => NULL);
  6  END;
  7  /

PL/SQL procedure successfully completed.

Add privilege:

SQL> BEGIN
  2     -- SCOTT
  3     DBMS_NETWORK_ACL_ADMIN.add_privilege (acl         => 'xedba.xml',
  4                                           principal   => 'SCOTT',
  5                                           is_grant    => TRUE,
  6                                           privilege   => 'connect',
  7                                           start_date  => NULL,
  8                                           end_date    => NULL);
  9
 10     DBMS_NETWORK_ACL_ADMIN.add_privilege (acl         => 'xedba.xml',
 11                                           principal   => 'SCOTT',
 12                                           is_grant    => TRUE,
 13                                           privilege   => 'resolve',
 14                                           start_date  => NULL,
 15                                           end_date    => NULL);
 16  END;
 17  /

PL/SQL procedure successfully completed.

SQL> COMMIT;

Commit complete.

Now, you should connect as user which was granted access and run your command again.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...