- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- How to get output of sql script in mail?
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2006 05:31 PM
01-10-2006 05:31 PM
1. I need output of my selected oracle sql scripts in my smtp mail login id.
This oracle script can be run with cron job in the unix box and output should be mailed to my smtp mail login id.
Help is required to setup this requirement.
Thanks in advance.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2006 05:34 PM
01-10-2006 05:34 PM
Solution./sqlscript | mailx -s "SQL output" mailId
it will do that.
Else redirect sql script execution results to a log file as,
$ ./sqlscript 1>/tmp/sql.log 2>&1
$ mailx -s "SQL Output" mailID < /tmp/sql.log
--
Muthu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2006 05:36 PM
01-10-2006 05:36 PM
Re: How to get output of sql script in mail?
Any output can be redirected to email:
script | mailx -s "sql stuff" your@yourmail.com
If its big, you can just do it as an attachment.
http://www.hpux.ws/mailfile2
This little gem uses sendmail to send large files as an attachment.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2006 05:38 PM
01-10-2006 05:38 PM
Re: How to get output of sql script in mail?
$ ./script > /tmp/sql.log
$ uuencode /tmp/sql.log sql.log | mailx -s "subject" mailid
--
Muthu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2006 06:02 PM
01-10-2006 06:02 PM
Re: How to get output of sql script in mail?
you can also send directly from Oracle itself using the Utl_Smtp package.
see the following link:
http://www.oracle.com/technology/sample_code/tech/pl_sql/htdocs/Utl_Smtp_Sample.html
hope this helps!
kind regards
yogeeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2006 06:10 PM
01-10-2006 06:10 PM
Re: How to get output of sql script in mail?
Thanks.
Pls clarify the following;
1 How sendmail will pick up the output from .forward file ?
Since output will be generated through a cron job to a out file.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2006 06:17 PM
01-10-2006 06:17 PM
Re: How to get output of sql script in mail?
sendmail's checks local mail via user name. If a .forward file is present, it is used to route the mail.
This is built into the standard sendmail.cf file. You can read it and search for forward or .forward
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-11-2006 03:45 PM
01-11-2006 03:45 PM
Re: How to get output of sql script in mail?
Thanks to everyone who were participated in this thread. The issue is resolved.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-11-2006 03:49 PM
01-11-2006 03:49 PM