For more information about the ACL ACLs of oracle11g, see

Source: Internet
Author: User
Error example (the following error is reported when an http request is sent using UTL_HTTP): 1. Oracle allows several plsqlapis (UTL_TCP, UTL_SMTP, UTL_MAIL, UTL_HTTP, and UTL_INADDR) access external network services. All these APIs use the TCP protocol. 2. At Oracle10g, a user is assigned to execute

Error example (the following error is reported when an http request is sent using UTL_HTTP): 1. Oracle allows several PL/SQL APIs (UTL_TCP, UTL_SMTP, UTL_MAIL, UTL_HTTP, and UTL_INADDR) access external network services. All these APIs use the TCP protocol. 2. in Oracle 10 Gb, a user is assigned to execute

Error example (the following error is returned when an http request is sent using UTL_HTTP ):

Cause:

1. Oracle allows several PL/SQL APIs (UTL_TCP, UTL_SMTP, UTL_MAIL, UTL_HTTP, and UTL_INADDR) to access external network services, all of which use the TCP protocol.

2. Oracle 10 Gb is implemented through an on/off switch based on whether the user is authorized to execute a package. Oracle 11 GB introduces fine-grained access to network services.

3. You can use the access control list (ACL) in the XML database to control which user can access which network resources, regardless of the package authorization.

Solution:

-- Query the network access control list acl

?

1

Select * From dba_network_acls

-- Query the access control permission list

?

1

Select * From dba_network_acl_privileges

-- Query users in the database. The username is case sensitive.

?

1

Select username From dba_users Where username Like '% ITS %'

Assign acl permissions and execute the following SQL statement:

?

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

Begin

Dbms_network_acl_admin.create_acl (-- create an access control file (ACL)

Acl => 'utl _ http. xml', -- file name

Description => 'HTTP access', -- description

Principal => 'its ', -- authorizes or disauthorizes an account. It is case sensitive.

Is_grant => TRUE, -- authorize or cancel authorization

Privilege => 'connect ', -- List of authorized or unauthorized Permissions

Start_date => null, -- start date

End_date => null -- end date

);

Dbms_network_acl_admin.add_privilege (-- add an access permission list item

Acl => 'utl _ http. xml', -- Name of the created acl

Principal => 'its ', -- authorizes or disauthorizes a user

Is_grant => TRUE, -- same

Privilege => 'resolve', -- permission list

Start_date => null,

End_date => null

);

Dbms_network_acl_admin.assign_acl.

Acl => 'utl _ http. xml ',

Host => '192. 1.2.1 ', -- IP address or domain name. Enter 100/hello and 9000/to indicate that the host is invalid.

-- IP addresses or domain names are recommended. If localhost is used, problems may occur when oracle is not installed on the local machine.

Lower_port => 9000, -- the starting port number for access

Upper_port => Null -- the end port number for access

);

Commit;

End;

Begin

Dbms_network_acl_admin.assign_acl (-- you can authorize multiple hosts or multiple ports of multiple hosts.

Acl => 'utl _ http. xml ',

Host => '10. 100.49.138 ',

Lower_port => 80,

Upper_port => NUll

);

Commit;

End;

Request test:

?

1

Select utl_http.request ('HTTP: // localhost: 9000/hello? Wsdl ') From dual;

If no listener is displayed, it is because localhost cannot be written when the host is authorized. The IP address or domain name should be written, for example:

Remove acl and permission Control

Unassign an acl to hostacl -- corresponds to assign

?

1

2

3

4

5

6

7

8

9

10

11

12

Begin

Dbms_network_acl_admin.unassign_acl (

Acl => 'utl _ http. xml ',

Host => '2017. 1.2.1 ',

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.