?
Solved

Email notification

Posted on 2009-04-03
2
Medium Priority
?
601 Views
Last Modified: 2013-12-18
Hi,

I have set up TNSPing on server1 which pings server2 every miniute.  Log file is generated on server1; when it connects it logs 'Yes' when can't connect logs 'No'.

Is there a way to set up some sorta process on server1 to browse through the log file and when it sees 'No' then sends an email notification.  
log file is a text file by the way.

thx
0
Comment
Question by:khanzada19
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 17

Accepted Solution

by:
k_murli_krishna earned 2000 total points
ID: 24065913
You can use UTL_FILE PL/SQL package to read/write from/to files. We wrote a procedure to spit out INSERT statements for all tables in a schema in the correct ascending relational order. So, you can do the read part of it as well. Then in the same procedure, you can use UTL_MAIL/UTL_SMTP PL/SQL packages to send the mail triggered when 'Yes'/'No' is found logged at a particular place due to tnsping from server 1 to server 2. You can pin point the 'Yes'/'No' based on row, standard text inside the row w.r.t. 'Yes'/'No' OR based on cell by (row,column) coordinates. Here are a few references which can help you out.

Oracle utl_file Package
http://www.adp-gmbh.ch/ora/plsql/utl_file.html
http://www.cs.umbc.edu/help/oracle8/server.815/a68001/utl_file.htm
http://www.dba-oracle.com/t_utl_file_package.htm
http://download.oracle.com/docs/cd/B10500_01/appdev.920/a96612/u_file.htm
http://www.databasejournal.com/features/oracle/article.php/3295321/Manipulating-Oracle-Files-with-UTLFILE.htm

Send email within Oracle 10g with the UTL_MAIL package.
http://searchoracle.techtarget.com/tip/0,289483,sid41_gci1195514,00.html
http://articles.techrepublic.com.com/5100-10878_11-6078020.html

Send email within Oracle with the UTL_SMTP package.
http://www.lv2000.com/articles/utlsmtp.htm

General
http://www.tutorialized.com/tutorial/Oracle-Procedures-Send-Email/36707
0
 
LVL 4

Expert Comment

by:hqassap
ID: 24072960
Hello,
You can do what you want by creating an external table on the log file, then every couple of minutes, for example, you can run a stored procedure (scheduled run) to check the table does contain 'NO' then send an email encluding the incident information.

You can use Oracle built in package UTL_MAIL to send emails (see attached file for more details on how to install and use this package procedures:
Oracle-Send-Mail--UTL-MAIL-.txt
0

Featured Post

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction A previously published article on Experts Exchange ("Joins in Oracle", http://www.experts-exchange.com/Database/Oracle/A_8249-Joins-in-Oracle.html) makes a statement about "Oracle proprietary" joins and mixes the join syntax with gen…
Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question