Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • Oracle10g – Using SQLAccess Advisor (DBMS_ADVISOR) with the Automatic Workload Repository Oracle
  • oracle 10g on linux Linux/Unix
  • Another Tuning Article for subheap of shared pool Oracle
  • Physical Standby switchover with session active Oracle
  • findx.sql /* Find Indexes on specified USER.TABLE_NAME */ Oracle
  • Mutating Table Error while using database trigger Oracle
  • How can I tell if ASO is installed ? Oracle
  • get_vmstat.ksh Linux/Unix
  • Monitor and Trace Unix processes using truss Linux/Unix
  • Important Solaris Commands Linux/Unix
  • Benefits and Usage of RMAN with Standby Databases Oracle
  • tar and untar a dolder with all its subfolder. Linux/Unix
  • Difference between SYNC and AFFIRM Oracle
  • When error comes for temporary tablespace with version <= 9i Oracle
  • cp_filesystem.sql 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

  • To find all disk io ( EMC as well as local) Linux/Unix
  • restarting network in linux Linux/Unix
  • Directory wise folder wise space usage Linux/Unix
  • copying/removing directory with all its subdirectory Linux/Unix
  • Establishing trusted relationship between dbmonitor( central monitoring) and monitoring targets. Linux/Unix
  • tar and untar a dolder with all its subfolder. 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 (392)
  • PHP/MYSQL/Wordpress (10)
  • Power-BI (0)
  • Python/PySpark (7)
  • RAC (17)
  • rman-dataguard (26)
  • shell (149)
  • SQL scripts (341)
  • Uncategorized (0)
  • Videos (0)

Recent Posts

  • load SPM baseline from cursor cache05-Jun-2025
  • Drop all SPM baselines for SQL handle05-Jun-2025
  • Load SPM baseline from AWR05-Jun-2025
  • Drop specific SQL plan baseline – spm05-Jun-2025
  • findinfo.sql (SQL for getting CPU and Active session info)27-May-2025
  • 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

Archives

  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • Test Case for Inserting Multiple (2.3 Million rows in 26 Seconds) Oracle
  • dbms_job.submit example Oracle
  • Paste command syntax Linux/Unix
  • Unix command for system configuration Linux/Unix
  • Goog notes on X$ tables Oracle
  • ext#.sql Oracle
  • tblwopk.sql tablewopk.sql Oracle
  • Locktree.sql Oracle

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme