Anytime you want to use UTL_SMTP, DBMS_LDAP, UTL_HTTP anything that is depending upon the usage of operating systems network (email, web, ldap), etc. You need to do
1. Make sure that XDB database option is installed.
2. Do the following for each schema
Create the ACL as sysdba
begin
dbms_network_acl_admin.create_acl (
acl => 'mailserver_acl.xml',
description => 'ACL for user to connect to my SMTP Server',
principal => 'MY_DB_USER',
is_grant => TRUE,
privilege => 'connect');
end;
/
commit;
Assign the ACL
begin
dbms_network_acl_admin.assign_acl (
acl => 'mailserver_acl.xml',
host => 'smtp.mycompany.com',
lower_port => 25);
end;
/
commit;
Add a privilege to grant/deny
begin
dbms_network_acl_admin.add_privilege (
acl => 'mailserver_acl.xml',
principal => 'MY_DB_USER',
is_grant => TRUE,
privilege => 'connect');
end;
/
commit;

No comments:
Post a Comment