oracle9i升級11g後無法傳送郵件
參考文章。
Oracle allows access to external network services using several PL/SQL APIs (UTL_TCP, UTL_SMTP, UTL_MAIL, UTL_HTTP and UTL_INADDR), all of which are implemented using the TCP protocol. In previous versions of the database, access to external services was effectively an on/off switch based on whether a user was granted execute permissions on a specific package or not. Oracle 11g introduces fine grained access to network services using access control lists (ACL) in the XML DB repository, allowing control over which users access which network resources, regardless of package grants.
我們的解決方案參考了前面的文章,具體步驟如下:
Check xdb status
set echo on;
Master Note
for Oracle XML Database (XDB) Install / Deinstall (文件 ID 1292089.1)
connect / as sysdba
set pagesize 1000
col comp_name format a36
col version format a12
col status format a8
col owner format a12
col object_name format a35
col name format a25
-- Check status of XDB
select comp_name, version, status
from dba_registry
where comp_id = 'XDB';
(select * from v$option)
-- Check for invalid objects
select owner, object_name, object_type, status
from dba_objects
where status = 'INVALID'
and owner in ('SYS', 'XDB');
spool off;
step1 install
xdb
select tablespace_name from dba_tablespaces;
SQL>
select tablespace_name,SEGMENT_SPACE_MANAGEMENT from dba_tablespaces;
TABLESPACE_NAME SEGMEN
------------------------------ ------
SYSTEM MANUAL
SYSAUX AUTO
UNDOTBS1 MANUAL
TEMP MANUAL
USERS AUTO
MAXIMO AUTO
RBS AUTO
RBSBIG AUTO
TOOLS AUTO
@?/rdbms/admin/catqm.sql andrew123 USERS TEMP YES
@?/rdbms/admin/utlrp.sql
step2: install the dbms_network_acl_admin package
@ ?/rdbms/admin/catnacl.sql
@ ?/rdbms/admin/dbmsnacl.sql
@ ?/rdbms/admin/prvtnacl.plb
Step3 create acl
Log db as sysdba
BEGIN
DBMS_NETWORK_ACL_ADMIN.create_acl (
acl=> 'NOR754S_SENDMAIL.xml',
description=> 'EMAIL_SEND',
principal=> 'SYS',
is_grant=> TRUE,
privilege=> 'connect',
start_date=> SYSTIMESTAMP,
end_date=> NULL);
COMMIT;
END;
/
Run the following
SQL AS sysdba:
spool
/home/ora11g/NOR754S.sql
select
'BEGIN' ||chr(10)||
' DBMS_NETWORK_ACL_ADMIN.add_privilege (
'||chr(10)||
' acl=>
'||'''NOR754S_SENDMAIL.xml'''||', '||chr(10)||
' principal=>'''||upper(username)||''','||chr(10)||
' is_grant=> TRUE, '||chr(10)||
' privilege=> '||'''connect'','||chr(10)||
' position=> NULL, '||chr(10)||
' start_date=> SYSTIMESTAMP,'||chr(10)||
' end_date=> NULL);'||chr(10)||
' END;'||chr(10)||
'/'||chr(10)
from dba_users
where account_status='OPEN'
and username
not in('SYS');
spool off
!
---then run
sqlplus /as sysdba
@/home/ora11g/NOR754S.sql
---to add other user
Only one ACL can be assigned to a specific
host and port-range combination. Assigning a new ACL to a specific host and
port-range results in the deletion of the previous assignment. You must take
care when making a new assignment that you are not opening ports that were
closed by a previous ACL assignment, or you could be opening yourself to attack.
When wildcard usage causes overlapping assignments, the most specific
assignment will take precedence, so an ACL assigned to 192.168.2.3:80 takes
precedence over once assigned to 192.168.2.* etc. Run the following sql:
BEGIN
DBMS_NETWORK_ACL_ADMIN.assign_acl (
acl=> 'NOR754S_SENDMAIL.xml',
host=> '9.xxx.xxx.19', ----郵件伺服器IP
lower_port=>24433, -----指定埠號
upper_port=> NULL);
COMMIT;
END;
/
Step4 :add other
user to acl
sqlplus -s / as sysdba < set termout off
set heading off
set pagesize 0
set verify off
set echo off
step5: assign act to network
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/21754115/viewspace-776676/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Laravel 郵件無法傳送原因的查詢Laravel
- foxmail能收郵件,但是無法傳送郵件的問題AI
- 從Oracle9i中傳送電子郵件Oracle
- 郵件傳送
- 傳送郵件
- SpringBoot整合Mail傳送郵件&傳送模板郵件Spring BootAI
- Laravel 傳送郵件Laravel
- PHP傳送郵件PHP
- Django——郵件傳送Django
- java郵件傳送Java
- Laravel傳送郵件Laravel
- gmail傳送郵件AI
- Oracle郵件傳送Oracle
- java傳送郵件Java
- Powershell郵件傳送
- thinkphp 郵件傳送PHP
- centos 傳送郵件CentOS
- phpcms傳送郵件PHP
- 郵件的傳送
- win10使用自帶郵箱傳送郵件時直接進傳送箱裡無法完成傳送怎麼解決Win10
- 搭建百萬級別郵件傳送平臺
- Java Mail 郵件傳送(二):簡單封裝的郵件傳送JavaAI封裝
- golang傳送郵件(qq郵箱)Golang
- 郵件傳送API整理API
- php windows 傳送郵件PHPWindows
- 定時傳送郵件
- thinkjs 傳送郵件JS
- 使用phpmailer傳送郵件PHPAI
- Ubuntu的郵件傳送Ubuntu
- python傳送郵件Python
- nodejs 傳送郵件NodeJS
- 傳送郵件那些事
- javamail郵件傳送例子JavaAI
- 使用JavaMail傳送郵件JavaAI
- 使用nodemailer傳送郵件AI
- javamail傳送郵件(轉)JavaAI
- Python 實現郵件傳送功能(初級)Python
- Laravel5.5 使用 Markdown 語法傳送郵件Laravel