![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Shell script using ssh remains connected at primary site | a1_win | Shell Programming and Scripting | 5 | 10-27-2008 03:34 PM |
| shell script not connecting to primary from standby site | a1_win | Shell Programming and Scripting | 0 | 10-23-2008 04:22 AM |
| shell script for archive purge | regnumber | Shell Programming and Scripting | 5 | 10-14-2008 02:09 PM |
| Generic Shell Script to Archive a file | mak1600 | Shell Programming and Scripting | 8 | 07-26-2008 08:51 AM |
| hacmp 5.3 primary and standby? | itik | AIX | 2 | 06-27-2008 11:19 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
shell script for primary and standby DB archive log check
Hi All,
OS:AIX 5.3 64 bits I would like the below script to send alert mail with the message - "Standby logs falling behind Primary" to xyz@yahoo.com Script ===== #!/usr/bin/ksh #----------------------------------------------------------------------------- # Use SQL*Plus to query the MAX(SEQUENCE#) from both databases V$LOG_HISTORY # view. If the STANDBY appears to be falling behind, then send alert mail... #----------------------------------------------------------------------------- _OutFile=stdby_chk.out sqlplus -s /nolog << __EOF__ > ${_OutFile} 2>&1 connect / as sysdba set verify off col logseq_on_standby new_value V_STDBY_LOGSEQ select /*+ rule */ max(h.sequence#) logseq_on_standby from v\$log_history h, v\$parameter p where h.thread# = to_number(decode(p.value,'0',1,p.value)) and p.name = 'thread'; col filecnt new_value V_STDBY_FILECNT select count(*) filecnt from v\$datafile; exit; __EOF__ ssh <username>@host.domain export ORACLE_SID=<SIDNAME> export ORACLE_HOME=<ORACLE_HOME_PATH> export PATH=$ORACLE_HOME/bin:$PATH _OutFile1=primary_chk.out $ORACLE_HOME/bin/sqlplus -s /nolog << __EOF__ > ${_OutFile1} 2>&1 connect / as sysdba col logseq_on_primary new_value V_PRIMARY_LOGSEQ select /*+ rule */ max(h.sequence#) logseq_on_primary from v\$log_history h, v\$parameter p where h.thread# = to_number(decode(p.value,'0',1,p.value)) and p.name = 'thread'; col filecnt new_value V_PRIMARY_FILECNT select count(*) filecnt from v\$datafile; exit; __EOF__ exit; could anyone please share the exeperience in fulfilling this objective!!! Thanks for your time! Regards, |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|