-
I have sql script I want to schedule to run every Monday morning to monitor tablespace usage and email me the output file with cron job. Can someone tell me how to start svrmgrl or sqlplus with connect system/manager and run this script? I will like to spool the result out and have it mail to me. This is AIX, 8.1.6. Thanks
Oisaya
-
In a shell script, you can do something like
svrmgrl <<EOF
connect internal
bla.... bla...
exit
EOF
goodhealth
-
Does this help at all???
svrmgrl <<EOFarch1
connect internal
alter system switch logfile;
archive log stop;
exit
EOFarch1
Or from within sqlplus you can use the ! to execute something from the unix host.
Good luck,
Nirasha
-
hi
could u please mail me that script (c_ravichandra@hotmail.com)
Thanks
ravi
ravi
-
Can you please mail me that script? My mail id is sundaralingam@yahoo.com.
Thanks in advance.
Sundar
S. Sundar,
Technical Specialist,
Computer Software & Solutions,
Muscat,
Sultanate of Oman.
-
Thanks everybody. The error I am getting with the suggested solution is after opening and connecting to svrmgrl, the following command like bla bla bla is not executing. If you shellout with ! to call any command another error is encounted. SVRMGRL is actually waiting for commands and none of the remaining shell commands is executed. I still need some input.
Oisaya
-
please e-mail me too at:
alan_bo@hotmail.com
Thanks
-
#!/bin/ksh
exec > /tmp/log.$$
sqlplus -s system/manager@dbname << EOF
select count(*) from dba_objects
/
exit
EOF
mailx -s "db report" yourself < /tmp/log.$$
Jeff Hunter
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|