Run a sql script on multiple $Oracle_SID at once and send an alert if reaches the threshold


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Run a sql script on multiple $Oracle_SID at once and send an alert if reaches the threshold
# 1  
Old 02-03-2015
Run a sql script on multiple $Oracle_SID at once and send an alert if reaches the threshold

I am trying to accomplish following tasks in my KSH script:
  1. Run a sql script on multiple $ORACLE_SID at once
  2. Sends an alert only if the threshold > 2 for any of the $ORACLE_SID


Please advice as to how I can approach this!!

Thanks in advance!

Last edited by rbatte1; 02-04-2015 at 06:32 AM.. Reason: Converted to LIST=1 tags
# 2  
Old 02-04-2015
I'm afraid you will need to define what you mean by the threshold.

You can easily run against multiple SIDs by putting the jobs into the background. The fun part comes in getting the responses back when they finish.

Code:
for SID in SID_A  SIB_B  SID_C  SID_D
do
   . setsid $SID
   sqlplus .......<<whatever>>........  &
done

wait            # Pauses script until all background processes have completed.

You may need to capture the output to a set of files and then read them after the wait completes to see what happened.

If you tell us what the point of these multiple calls is, then maybe we can suggest a way to get the overall result you are looking for.




Robin
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

How to get last 15 minutes timestamp and threshold > 60 will sent alert?

Hi All, need your help , i have some files and got some below condition cat tdr12009.log | grep -i success | grep promo | awk -F'' '{print substr($1,1,16),$15}' | more 2019-10-16 00:03 delta=1 2019-10-16 00:03 delta=2 2019-10-16 00:04 delta=20 2019-10-16 00:09 delta=10 2019-10-16... (5 Replies)
Discussion started by: fajar_3t3
5 Replies

2. UNIX for Beginners Questions & Answers

Shell script to send mail alert

Hi I have below shell script to send mail alert , however I want to add more functionality in this script and that is , script should only check that file between 9 am to 5pm , and if there is no activity in this time 9 am to 5 pm for 2hours then it should give me mail alert, please help... (2 Replies)
Discussion started by: scazed
2 Replies

3. Shell Programming and Scripting

Shell script to send mail alert

HI Guys, I am writing one shell script to send the mail alert to some email id's if the file not modified in last 10 mins but its not working, I believe MTIME is null string is wrong . can you please assist me on this. script :- filename="abc.txt" echo "Filename is $filename"... (1 Reply)
Discussion started by: abhigrkist
1 Replies

4. Shell Programming and Scripting

Run different SQL on multiple DBs using SHELL script

Hi Experts, I have a list of Dbs.In that DBs i need to execute some sql scripts. each sql script is unique and it should run on particular DB only. For example. i have DBs like MDC20V,NDC20V,ODC20V and sql scripts like MD.sql,ND.sql,OD.sql.so MD.sql should run only in MDC20V and ND.sql should... (1 Reply)
Discussion started by: navsan420
1 Replies

5. Shell Programming and Scripting

Shell script to call Oracle archive backup script when file system reaches threshold value

Hello All, I need immediate help in creating shell script to call archivebkup.ksh script when archive file system capacity reaches threshold value or 60% Need to identify the unique file system that reaches threshold value. ex: capacity ... (4 Replies)
Discussion started by: sasikanthdba
4 Replies

6. Shell Programming and Scripting

Run sql script and send to mail if not empty?

Thanks again for helping me out. I was wondering if anyone else has encountered this issue. I have a SQL script that produces a list -however we are only interested in that list if the length is not zero Here is the sql file named dailyBalance.sql select * from Balance where... (1 Reply)
Discussion started by: Astrocloud
1 Replies

7. Shell Programming and Scripting

Run SQL thru shell script: how to get a new line when run sql query?

Hi, this's Pom. I'm quite a new one for shell script but I have to do sql on shell script to query some information from database. I found a concern to get a new line...When I run my script, it retrieves all data as wondering but it's shown in one line :( What should I do? I'm not sure that... (2 Replies)
Discussion started by: Kapom
2 Replies

8. Shell Programming and Scripting

Script for deleting files and directories when the file system reaches the threshold

Hi Can someone assist in writing a script. I have a filesystem named /sybase in my aix lpar. When this filesystem becomes 94% full all the files and directories under /sybase/logs should be deleted immediately. :confused: (7 Replies)
Discussion started by: newtoaixos
7 Replies

9. HP-UX

Script to send alert when process exceeds 90% cpu

I have an issue with one of the processes which is showing %cpu over 120% when i issue the top command. I am looking for a script that send me an email alert when it crosses the 90% thresholds. Appreciate your help (1 Reply)
Discussion started by: chkaiban
1 Replies

10. Shell Programming and Scripting

Script to send alert if any changes are made in crontab.

Hi i want to know how can i write a script to check if any changes are made and send an alert in crontabs . i am using .ksh file extension for writing scripts. (3 Replies)
Discussion started by: honey26
3 Replies
Login or Register to Ask a Question