Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • Find Command Linux/Unix
  • When error comes for temporary tablespace with version <= 9i Oracle
  • Implementing Listener Security Oracle
  • fdisk -l explaination about Primary-Logical-Extended Partitions Linux/Unix
  • DB Console Mainenance. Oracle
  • grep multuple patterns Linux/Unix
  • UNderstand and eliminate Latch contention. Oracle
  • find_idle_cpu.sql Oracle
  • age_alert.ksh aging out alert.log Linux/Unix
  • Jai Shree Ram Linux/Unix
  • crtgr.sql /* For creating trigger from data dictionary */ Oracle
  • sess1.sql Oracle
  • configUOCIOTTO.ora Oracle
  • DETERMINING WHICH INSTANCE OWNS WHICH SHARED MEMORY & SEMAPHORE SEGMENTS Oracle
  • move_arch_files.ksh Linux/Unix

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

  • How to collect CPU usage on Linux using Shell script Linux/Unix
  • switchlogfile.sh Linux/Unix
  • Adding a new disk and mount it automatically. on VMWARE LINUX Linux/Unix
  • Passing from Unix to PLSQL using bind variables Linux/Unix
  • shutdown linux Linux/Unix
  • Which environment is used by currently running process ( Very good) 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
  • Load testing on Oracle 19C RAC with HammerDB Oracle
  • sess1.sql Oracle
  • Parallel DML Oracle
  • Establishing trusted relationship between dbmonitor( central monitoring) and monitoring targets. Linux/Unix
  • Sample WW22 listener.ora Oracle
  • exp syntax in oracle 10g Oracle
  • Pending Transaction Neighbors Script Oracle
  • Changing Instance Name ( No DB_NAME) Oracle

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme