on sqlplus
select * from dba_tab_privs where table_name = 'UTL_SMTP';
select grantee , table_name , privilege from dba_tab_privs where table_name = 'UTL_HTTP';
select acl , host , lower_port , upper_port from DBA_NETWORK_ACLS;
select acl , principal , privilege , is_grant from DBA_NETWORK_ACL_PRIVILEGES;
select name,value,description,issys_modifiable from v$parameter where name='smtp_out_server'
---SELECT * FROM TABLE(DBMS_NETWORK_ACL_UTILITY.DOMAINS('relay.jangosmtp.net'));
GRANT EXECUTE ON SYS.UTL_FILE TO GRACEWORK;
GRANT EXECUTE ON UTL_FILE TO GRACEWORK;
GRANT EXECUTE ON SYS.UTL_SMTP TO GRACEWORK;
GRANT EXECUTE ON UTL_SMTP TO GRACEWORK;
CREATE OR REPLACE PUBLIC SYNONYM utl_smtp FOR sys.utl_smtp;
ALTER SYSTEM set smtp_out_server = 'relay.jangosmtp.net:2525' SCOPE = BOTH;
--- ALTER SYSTEM set smtp_out_server = 'localhost:2525' SCOPE = BOTH;
UTL_SMTP
SQL> @?/javavm/install/initjvm.sql SQL> @?/rdbms/admin/initplsj.sql
@?/rdbms/admin/utlmail.sql
@?/rdbms/admin/prvtmail.plb
GRANT EXECUTE ON SYS.utl_mail TO GRACEWORK;
grant execute on UTL_TCP to GRACEWORK;
grant execute on utl_mail to GRACEWORK;
grant execute on utl_http to GRACEWORK;
grant execute on UTL_INADDR to GRACEWORK;
--revoke execute on utl_http from public;
grant execute on utl_mail to GRACEWORK;
grant execute on utl_http to GRACEWORK;
-------all unassign
BEGIN
DBMS_NETWORK_ACL_ADMIN.unassign_acl (
acl => 'utl_mail.xml',
host => '');
COMMIT;
END;
/
----
---Drop ACL
BEGIN
DBMS_NETWORK_ACL_ADMIN.drop_acl (
acl => 'utl_mail.xml'
);
COMMIT;
END;
/
begin
dbms_network_acl_admin.create_acl(acl => 'utl_mail.xml',
description => 'HTTP ACL Access',
principal => 'GRACEWORK',
is_grant => TRUE,
privilege => 'connect',
start_date => null,
end_date => null);
dbms_network_acl_admin.add_privilege(acl=> 'utl_mail.xml',
principal => 'GRACEWORK',
is_grant => TRUE,
privilege => 'resolve',
start_date => null,
end_date => null);
DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL (
acl => 'utl_mail.xml',
host => '127.0.0.1',
lower_port => 1,
upper_port => 10000);
DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL (
acl => 'utl_mail.xml',
host => 'localhost',
lower_port => 1,
upper_port => 10000);
DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL (
acl => 'utl_mail.xml',
host => 'relay.jangosmtp.net',
lower_port => 1,
upper_port => 10000);
commit;
end;
/
************************************************************************************
************************************************************************************
************************************************************************************
SQL> shutdown immediate
SQL> startup
****************
begin
PROCSEND_KOEMAIL_test;
end;
******************
---assign
begin
DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL (
acl => 'utl_mail.xml',
host => 'relay.jangosmtp.net',
lower_port => 1,
upper_port => 10000);
end;
--Unassign ACL
begin
dbms_network_acl_admin.unassign_acl(
acl => 'utl_http.xml',
host => '192.168.1.100',
lower_port => 25,
upper_port => 10000
);
end;
-------all unassign
BEGIN
DBMS_NETWORK_ACL_ADMIN.unassign_acl (
acl => 'grace_utl_mail.xml',
host => '');
COMMIT;
END;
--
Drop
---
begin
dbms_network_acl_admin.drop_acl(
'grace_utl_mail.xml'
);
end;
---
---Delete Privilege
begin
dbms_network_acl_admin.delete_privilege(
'utl_http.xml', 'GRACEWORK', NULL, 'connect'
);
end;
UTL_TCP
UTL_SMTP
utl_mail
UTL_HTTP
UTL_INADDR
No. | Subject |
---|---|
Notice | Certification Oracle SQL Developer |
114 | 5.6.2 Granting Connect Privileges Prior to Oracle Database 12c |
113 | lsnrctl start |
112 | Network access denied by access control list (ACL) in Oracle Database 11g |
111 | email - PL/SQL |
110 | MODIFY |
109 | CREATE |
108 | PORT CHANGE 8080 --> 8081 |
107 | About AMAZON |
106 | BUXOMCURVY |
105 | WHDR(LAYOUT) CODE |
104 | CREATE?MODIFY |
103 | SEND GRID |
102 | MAILJET |
101 | DATA BASE LINK |
100 | dbms_network_acl_admin |
99 | Samsung-NP300E5E-DDR3 |
98 | Config |
97 | APEX_MAIL.SEND |
96 | grant execute on UTL_TCP |
» | Email SMTP |