使用Oracle发送邮件
CREATE OR REPLACE PROCEDURE sendemailtest
(mailmsg IN Varchar2)
IS
--using mail server to send email.
mailconn UTL_SMTP.connection;
mailhost VARCHAR2 (20);
mailfrom VARCHAR2 (30);
BEGIN
--(1) open connection to mail server.
mailhost := 'xxx.xxx.xxx.xxx';
mailfrom := 'Test@MailAddress.com';
mailconn := UTL_SMTP.open_connection(mailhost);
UTL_SMTP.helo (mailconn, mailhost);
UTL_SMTP.mail (mailconn, mailfrom);
--(2) set recipients.
UTL_SMTP.rcpt (mailconn, 'ToMail@MailAddress.com');
--(3) send content.
UTL_SMTP.open_data (mailconn);
UTL_SMTP.write_data(mailconn, 'Date: '||to_char(sysdate,'yyyy/mm/dd hh24:mi:ss')|| UTL_TCP.crlf);
UTL_SMTP.write_data(mailconn, 'from: fromWho' || UTL_TCP.crlf);
UTL_SMTP.write_data(mailconn, 'To: ToWho' || UTL_TCP.crlf);
UTL_SMTP.write_data(mailconn, 'Subject: TestSendMail' || UTL_TCP.crlf);
UTL_SMTP.write_data(mailconn, 'MIME-Version: 1.0' || UTL_TCP.crlf);
UTL_SMTP.write_data(mailconn, 'Content-Type: text/html; charset=utf-8' || UTL_TCP.crlf );
UTL_SMTP.write_data(mailconn, 'Content-Transfer-Encoding: "8Bit"' || UTL_TCP.crlf);
UTL_SMTP.write_data (mailconn, UTL_TCP.crlf || mailmsg);
UTL_SMTP.close_data (mailconn);
--(4) close connection.
UTL_SMTP.quit (mailconn);
EXCEPTION
WHEN OTHERS
THEN
DBMS_OUTPUT.put_line (SUBSTR (SQLERRM, 1, 100));
END;
相关文档:
先看Oracle 官方解释
Oracle managed file (OMF)
A file that is created automatically by the Oracle database server when it is needed and automatically deleted when it is no longer needed.
如何判断你的数据库是否为支持OMF
SQL> show parameter db_create_file_dest;
NAME & ......
一直听到的都是说尽量用exists不要用in,因为exists只判断存在而in需要对比值,所以exists比较快,但看了看网上的一些东西才发现根本不是这么回事。
下面这段是抄的
Select * from T1 where x in ( select y from T2 )
执行的过程相当于:
select *
......
1
、安装前的准备
1.1
检查硬件
物理内存:
# grep
MemTotal /proc/meminfo
交换空间:
# grep
SwapTotal /proc/meminfo
交换空间的大小是根据物理内存的大小来设置的,物理内存少于
2G
的则交换空间设为物理内存的两倍,物理内存大于
2G
的则交换空间和物理内存大小一样。如果不符合上述规定,那么就需要 ......
自从学ORACLE以来就从来没有发生过什么故障,比较幸运。其实也不能算幸运,因为这样就少了锻炼的机会了,呵呵,怎么觉得自己有点求虐的倾向……
即便是在学习backup and recovery basics的时候,也只是做做备份的实验,没做过恢复,因为身边没有人指导,也没其他同学在学ORACLE,所以怕一出问题肯定很麻烦,解 ......
一:
使用Profile对用户Session会话进行资源限制
--但是如果使用了连接池之类的东东,就会出些问题,比如前台连接不上之类的
--http://www.eygle.com/archives/2008/10/profile_session_limit.html
sqlplus "/ as sysdba"
SQL> show parameter resource
SQL> alter system set resource_limit= ......