![]() |
|
|
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 |
| Connecting to oracle database from shell script | satyakiran | Shell Programming and Scripting | 8 | 07-03-2009 04:22 PM |
| hacmp 5.3 primary and standby? | itik | AIX | 2 | 06-27-2008 12:19 PM |
| Connecting to sybase via shell script. | arvindcgi | Shell Programming and Scripting | 1 | 05-20-2008 11:30 AM |
| error connecting sql through a shell script | nehak | Shell Programming and Scripting | 1 | 04-30-2008 09:04 AM |
| Connecting DB in the Shell Script to do SQL Query | mehuldoshi | UNIX for Advanced & Expert Users | 3 | 03-29-2003 12:47 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
shell script not connecting to primary from standby site
Hi All,
I am using below shell script using SQL*Plus to query the MAX(SEQUENCE#) from both databases V$LOG_HISTORY view.If the STANDBY appears to be falling behind by - 2, then alert mail should be sent... How could I achieve it with improving the below script. #!/usr/bin/ksh v_standby=`sqlplus -s /nolog <<END connect / as sysdba 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'; EXIT; END` ssh xyz@hostname.domain v_primary=`sqlplus -s /nolog <<END connect / as sysdba 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'; exit; exit; Thanks for your time!! Regards, |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|