-
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 <
connect internal
bla.... bla...
exit
EOF
-
Does this help at all???
svrmgrl <
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 ([email protected])
Thanks
ravi
-
Can you please mail me that script? My mail id is [email protected].
Thanks in advance.
Sundar
-
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:
[email protected]
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.$$