|
-
Here is an example. I have a script that looks for a certain kind of db lock. A sql script finds the locks and creates another sql script to kill them. The information is e-mailed to me. The following is the shell script:
BASE_LOC=/P0/app/oracle/admin/scripts
. $BASE_LOC/ora_env.sh
DBA='[email protected]'
/P0/app/oracle/product/8.1.5/bin/sqlplus -s xxxxx/xxxxx << EOF
@/P0/app/oracle/admin/scripts/pr_locks.sql
quit
EOF
cat /tmp/kill_sessions.sql >> /tmp/pr_locks.lst
cat /tmp/kill_sessions.lst >> /tmp/pr_locks.lst
cat /tmp/pr_locks.lst | mailx -s "PR Locks Killed" $DBA
rm /tmp/pr_locks.lst
rm /tmp/kill_sessions.sql
rm /tmp/kill_sessions.lst
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
|