Configuring mail alerts via PLSQL – Troubleshot ORA-29278
in this blog i have explained you how to resolve ORA-29278
oracle configurationintermediate
by OracleDba
13 views
in this blog i have explained you how to resolve ORA-29278
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
SQL> create user ALERT identified by xwdkjdlc13ns default tablespace USERS temporary tablespace TEMP profile DEFAULT;
SQL> grant CONNECT to ALERT;
SQL> grant execute on UTL_MAIL to ALERT;
SQL> grant MGMT_USER to ALERT;
SQL> grant SELECT_CATALOG_ROLE to ALERT;
SQL> alter system set smtp_out_server = '170.1.1.1' scope=spfile;
SQL> show parameter smtp;
NAME TYPE VALUE
------------------- ----------- ------------------------------
smtp_out_server string
SQL>
SQL> show parameter smtp;
NAME TYPE VALUE
------------------- ----------- ------------------------------
smtp_out_server string 170.1.1.1
SQL>
SQL> grant execute on UTL_MAIL to public;
SQL> grant execute on UTL_MAIL to ALERT;
SQL> ALTER SESSION SET smtp_out_server = '170.1.1.1';
SQL> exec UTL_MAIL.send(sender => 'oracle.com', recipients => '
[email protected]
', subject => 'Test Mail', message => 'Hello World', mime_type => 'text; charset=us-ascii');
SQL> exec utl_mail.send('oracle.com','
[email protected]
','test mail','Hello World',mime_type => 'text; charset=us-ascii');
ALTER SYSTEM SET SMTP_OUT_SERVER=”<IP>” scope=both;
col COMP_NAME format a40;
col VERSION format a12;
col STATUS format a12;
SELECT COMP_NAME, VERSION, STATUS FROM DBA_REGISTRY;
COMP_NAME VERSION STATUS
---------------------------------------- --------------- ---------
Oracle Enterprise Manager 11.2.0.3.0 VALID
Oracle XML Database 11.2.0.3.0 VALID
Oracle Expression Filter 11.2.0.3.0 VALID
Oracle Rules Manager 11.2.0.3.0 VALID
Oracle Workspace Manager 11.2.0.3.0 VALID
Oracle Database Catalog Views 11.2.0.3.0 VALID
Oracle Database Packages and Types 11.2.0.3.0 VALID
JServer JAVA Virtual Machine 11.2.0.3.0 VALID
Oracle XDK 11.2.0.3.0 VALID
Oracle Database Java Packages 11.2.0.3.0 VALID
10 rows selected.
SQL/> connect as sysdba
SQL> @?/rdbms/admin/utlmail.sql
SQL> @?/rdbms/admin/prvtmail.plb
SQL> GRANT EXECUTE ON SYS.UTL_MAIL TO USER;
e.g.,
SQL> GRANT EXECUTE ON SYS.UTL_MAIL TO alert;
SQL> @?/rdbms/admin/utlmail.sql
Package created.
Synonym created.
SQL> @?/rdbms/admin/prvtmail.plb
Package created.
Package body created.
Grant succeeded.
Package body created.
No errors.
SQL> GRANT EXECUTE ON SYS.UTL_MAIL TO alert;
Grant succeeded.
SQL>
BEGIN
DBMS_NETWORK_ACL_ADMIN.CREATE_ACL (
acl => 'UTL_SMTP.xml',
description => 'Granting privs to required users for UTL_SMTP.xml',
principal => 'ALERT',
is_grant => TRUE,
privilege => 'connect');
DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE (
acl => 'UTL_SMTP.xml',
principal => 'ALERT',
is_grant => TRUE,
privilege => 'resolve');
DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL (
acl => 'UTL_SMTP.xml',
host => '170.1.1.1');
END;
/
COMMIT;
SQL>
PL/SQL procedure successfully completed
Commit complete
SQL>
SQL> exec utl_mail.send('oracle.com','
[email protected]
','test mail','Hello World',mime_type => 'text; charset=us-ascii');
PL/SQL procedure successfully completed
SQL>Please to add comments
No comments yet. Be the first to comment!