Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • Metalink Note: Note:250655.1 : ADDM Basics USING THE AUTOMATIC DATABASE DIAGNOSTIC MONITOR Oracle
  • Good notes on Oracle Events Oracle
  • Sample WW22 listener.ora Oracle
  • Looping for remote servers and find its database from oratab file. Linux/Unix
  • VIvek Encryption Package and Its Usage Oracle
  • Find Time Consuming SQL Statements in Oracle 10g Oracle
  • Nice notes on wait events Oracle
  • Jai Shree Ram Oracle
  • oracle Dba site Oracle
  • run this before doing any dbchange pvm_pre_change.sql Oracle
  • Find Multiple levels of object dependencies : depen.sql Oracle
  • exp syntax in oracle 10g Oracle
  • Is It Recommended To Apply Patch Bundles When PSU Is Available? -ID 743554.1 Oracle
  • How to collect CPU usage on Linux using Shell script Linux/Unix
  • Oracle 11g Training on 29JAN1010 Oracle

Check_recovery.sh program to run sqlplus and return its values remotely.

Posted on 21-Jul-2008 By Admin No Comments on Check_recovery.sh program to run sqlplus and return its values remotely.

#/bin/ksh -x

NOTIFY_LIST=”pmehta@1800flowers.com”

SOURCE_ARCH_DEST=/db5/archlog/800P

TARGET_SID=UOC

SOURCE_SSH=/usr/local/bin/ssh

TARGET_SSH=/usr/local/bin/ssh

SOURCE_HOST=nyuocdbprod01s

TARGET_HOST=uocdbprod21

TARGET_ORACLE_HOME=/oracle/app/oracle/product/10.1

TARGET_ENVFILE=/oracle/app/oracle/oraprocs/oracle_env_UOC

SOURCE_ORACLE_HOME=/oracle/app/oracle/product/10.1

SOURCE_ENVFILE=/export/home/oracle/oraprocs/oracle_env_10g_UOC

MY_SQL=”select max(SEQUENCE#) from v$log_history;”

MY_SQL1=”select count(1) from v$log_history where first_time >= (sysdate – (45/1440));”

TARGET_SEQ=`$TARGET_SSH $TARGET_HOST “. $TARGET_ENVFILE; $TARGET_ORACLE_HOME/bin/sqlplus -S / as sysdba <set pagesize 0 feedback off verify off heading off echo off

$MY_SQL

END”`

echo “TARGET_SEQ = $TARGET_SEQ”

SOURCE_SEQ=`$SOURCE_SSH $SOURCE_HOST “. $SOURCE_ENVFILE; $SOURCE_ORACLE_HOME/bin/sqlplus -S / as sysdba <set pagesize 0 feedback off verify off heading off echo off

$MY_SQL

END”`

echo “SOURCE_SEQ = $SOURCE_SEQ”

NO_LOGS_45MIN=`$SOURCE_SSH $SOURCE_HOST “. $SOURCE_ENVFILE; $SOURCE_ORACLE_HOME/bin/sqlplus -S / as sysdba <set pagesize 0 feedback off verify off heading off echo off

$MY_SQL1

END”`

echo “NO_LOGS_45MIN = $NO_LOGS_45MIN”

DIFFER=`expr $SOURCE_SEQ – $TARGET_SEQ`

echo “DIFFER=$DIFFER”

if [ $DIFFER -gt 0 ] && [ $NO_LOGS_45MIN -gt 0 ]

then

echo “Recovery of $TARGET_SID STBY on $TARGET_HOST is lagging by $DIFFER logs, But Log generation in last 45 minutes is $NO_

LOGS_45MIN : No Page sent” | mailx -s “$TARGET_SID – Standby Recovery Alert” $NOTIFY_LIST

exit

fi

if [ $DIFFER -gt 18 ]

then

echo “Database $TARGET_SID on $TARGET_HOST IS LAGGING BY $DIFFER LOGS `date`” |mailx $NOTIFY_LIST

fi

Linux/Unix, shell

Post navigation

Previous Post: Running select from V$ views from remote server
Next Post: Find long Running Transaction

Related Posts

  • Generate SSH without password authentication. Linux/Unix
  • Passing from Unix to PLSQL using bind variables Linux/Unix
  • scripts to take listener.log backup Linux/Unix
  • send attachment from unix-shell script Linux/Unix
  • shutdown linux Linux/Unix
  • purge_trc.sh Linux/Unix

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Categories

  • AWS (2)
  • Azure (1)
  • Linux/Unix (149)
  • Oracle (387)
  • PHP/MYSQL/Wordpress (10)
  • Power-BI (0)
  • Python/PySpark (7)
  • RAC (17)
  • rman-dataguard (26)
  • shell (149)
  • SQL scripts (336)
  • Uncategorized (0)
  • Videos (0)

Recent Posts

  • SQL Tracker by SID sqltrackerbysid.sql22-Apr-2025
  • How to connect to Oracle Database with Wallet with Python.21-Mar-2025
  • JSON/XML Types in Oracle18-Mar-2025
  • CPU Core related projections12-Mar-2025
  • Exadata Basics10-Dec-2024
  • Reading config file from other folder inside class24-Sep-2024
  • Python class import from different folders22-Sep-2024
  • Transfer SQL Profiles from One database to other database.05-Sep-2024
  • Load testing on Oracle 19C RAC with HammerDB18-Jan-2024
  • Add new columns in dataframe30-Sep-2023

Archives

  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • how to find OS block size Oracle
  • move_arch_files.ksh Linux/Unix
  • Mutating Table Error while using database trigger Oracle
  • Good links for x$ tables in oracle. Oracle
  • nfs mount command Linux/Unix
  • ORA-00064: object is too large to allocate on this O/S during startup Oracle
  • Kernel Parameter setting explaination for Processes Parameter Linux/Unix
  • Find Stale DR Physical Standby Oracle

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme