There are many ways to monitor Oracle. Here I simply use oracle's automatic email sending function to help OEMs monitor the database. The details are as follows:
There are many ways to monitor Oracle. Here I simply use oracle's automatic email sending function to help OEMs monitor the database. The details are as follows:
There are many ways to monitor Oracle. Here I simply use oracle's automatic email sending function to help OEMs monitor the database. The details are as follows:
The storage process for sending emails is excerpted from the Internet and a small change has been made:
Create or replace procedure sp_send_email (P_TXT VARCHAR2,
P_SUB VARCHAR2,
P_SENDOR VARCHAR2,
P_RECEIVER VARCHAR2,
P_SERVER VARCHAR2,
P_PORT number default 25,
P_NEED_SMTP int default 1,
P_FILENAME VARCHAR2 default null,
P_ENCODE VARCHAR2 DEFAULT 'bit 7 ')
AUTHID CURRENT_USER IS
/*
Purpose: use oracle to send emails
Main functions: 1. Supports multiple recipients.
2. Support for Chinese Characters
3. CC recipients are supported.
4. Support for attachments larger than 32 KB
5. Supports multi-line text
6. Support for multiple attachments
7. Supports text attachments and binary attachments
8. HTML format supported
8. Support
Author: suk
Parameter description:
P_txt: email body
P_sub: Mail title
P_SendorAddress: the sender's email address.
P_ReceiverAddress: The Receiving address, which can be sent to multiple addresses at the same time. The addresses are separated by "," or ";".
P_EmailServer: email server address, which can be a domain name or IP address
P_Port: port of the email server
P_need_smtp: Indicates whether smtp authentication is required. 0 indicates no, and 1 indicates yes.
P_user: User Name required for smtp authentication
P_pass: Password required for smtp Verification
P_filename: The attachment name, which must contain the complete path, for example, "d: \ temp \ a.txt ".
Multiple attachments are allowed. The attachment names are separated by commas (,) or semicolons (;).
P_encode: The attachment encoding conversion format. p_encode = 'bit 7' indicates the text type attachment.
P_encode = 'base64' indicates binary type attachment
Note:
1. Text attachments cannot be sent in base64 format. Otherwise, an error occurs.
2. Multiple attachments can only be sent in the same format
*/
Rochelle CRLF VARCHAR2 (2): = UTL_TCP.CRLF;
Rochelle sendoraddress VARCHAR2 (4000 );
Rochelle splite VARCHAR2 (10): = '+ + ';
Boundary constant VARCHAR2 (256): = '----- BYSUK ';
FIRST_BOUNDARY CONSTANT VARCHAR2 (256): = '--' | BOUNDARY | L_CRLF;
LAST_BOUNDARY CONSTANT VARCHAR2 (256): = '--' | BOUNDARY | '--' |
Rochelle CRLF;
MULTIPART_MIME_TYPE CONSTANT VARCHAR2 (256): = 'multipart/mixed; boundary = "'|
BOUNDARY | '"';
/* The following are the variables used to send large binary attachments */
Rochelle fil BFILE;
Rochelle file_len NUMBER;
Rochelle modulo NUMBER;
Rochelle pieces NUMBER;
L_FILE_HANDLE UTL_FILE.FILE_TYPE;
Rochelle AMT BINARY_INTEGER: = 672*3;/* ensures proper format; 2016 */
Rochelle filepos PLS_INTEGER: = 1;/* pointer for the file */
Rochelle chunks NUMBER;
Rochelle Buf RAW (2100 );
Rochelle data RAW (2100 );
Rochelle max_line_width NUMBER: = 54;
L_DIRECTORY_BASE_NAME VARCHAR2 (100): = 'dir _ FOR_SEND_MAIL ';
Rochelle line VARCHAR2 (1000 );
Rochelle mesg VARCHAR2 (32767 );
/* The preceding variables are used to send large binary attachments */