Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • Temporary tablespace explaination Oracle
  • How to specify 2 arch location to avoid any kind of DB hanging. Oracle
  • Drop tempfiles from database Oracle
  • GSQ.sql Oracle
  • metalink all dynamic view reference notes. Oracle
  • TNSNAMES entries details Oracle
  • Find_table_size.sql Oracle
  • ENQ: KO – FAST OBJECT CHECKPOINT tips Oracle
  • Linux CPU info. Linux/Unix
  • Logic to chech # of parameters command line parameters Linux/Unix
  • Jai Shree Ram PHP/MYSQL/Wordpress
  • Session_info.ksh Linux/Unix
  • Generate SSH without password authentication. Linux/Unix
  • database trigger failing Oracle
  • S3 Basic info AWS

move_arch_files.ksh

Posted on 02-Aug-2005 By Admin No Comments on move_arch_files.ksh

echo “The script execution started at `date`” >> $LOG_FILE

while [ ${ARCH_SPACE} -ge ${COMFORT_SPACE} ]

do

FIRST_FILE=`ls -latr $ARCHMOUNTPOINT/*.arc|head -1|awk ‘{print $9}’`

# cp -p $FIRST_FILE /blprddb14/archlog/BLINK

cp -p $FIRST_FILE $DESTFOLDER

CURR_FILE_SZ=`ls -latr $FIRST_FILE|awk ‘{print $5}’`

CURR_FL_NAME=`echo $FIRST_FILE |cut -f3 -d’/’`

# COPIED_FILE_SZ=`ls -latr /blprddb14/archlog/BLINK/$CURR_FL_NAME |awk ‘{print $5}’`

COPIED_FILE_SZ=`ls -latr $DESTFOLDER/$CURR_FL_NAME |awk ‘{print $5}’`

if [ $CURR_FILE_SZ -eq $COPIED_FILE_SZ ]

then

echo “Compressing the $FIRST_FILE” >>$LOG_FILE

compress $DESTFOLDER/$CURR_FL_NAME

echo “compression of $FIRST_FILE is done” >>$LOG_FILE

echo “Removed ” $FIRST_FILE “at “`date` >> $LOG_FILE

rm $FIRST_FILE

fi

NO_FILES_MOVED=`expr $NO_FILES_MOVED + 1`

# ARCH_SPACE=`df -k /BLINKARCH | tail -1 | awk ‘{print $5’} | sed ‘s/%//g’`

ARCH_SPACE=`df -k $ARCHMOUNTPOINT | tail -1 | awk ‘{print $5’} | sed ‘s/%//g’`

# ARCHBAK_SPC=`df -k /blprddb14 | tail -1 | awk ‘{print $5’} | sed ‘s/%//g’`

ARCHBAK_SPC=`df -k $DESTFOLDER | tail -1 | awk ‘{print $5’} | sed ‘s/%//g’`

done

if [ $NO_FILES_MOVED -gt 0 ]

then

#echo $NO_FILES_MOVED archive log files were moved from $ARCHMOUNTPOINT to $DESTFOLDER

#echo Currently $ARCHMOUNTPOINT is at $ARCH_SPACE % and $DESTFOLDER is at $ARCHBAK_SPC %

mailx -s ” File Moved Alert from $NODENAME, $ORACLE_SID Database” $NOTIFY_LIST< $NO_FILES_MOVED archive log files were moved from $ARCHMOUNTPOINT to $DESTFOLDER

Currently $ARCHMOUNTPOINT is at $ARCH_SPACE % and $DESTFOLDER is at $ARCHBAK_SPC %

EOF

fi

Linux/Unix, shell

Post navigation

Previous Post: proc.sql
Next Post: move_arch_files.ksh /* Good One */

Related Posts

  • How to know Number of CPUs on Sun Box Linux/Unix
  • default permission on ~/.ssh/authorized_keys2 or authorized_keys Linux/Unix
  • Generate SSH without password authentication. Linux/Unix
  • adding new line after specific pattern using sed Linux/Unix
  • rm_backup_arch_file.ksh Linux/Unix
  • backspace in SQL Plus not working then..? 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 (388)
  • PHP/MYSQL/Wordpress (10)
  • Power-BI (0)
  • Python/PySpark (7)
  • RAC (17)
  • rman-dataguard (26)
  • shell (149)
  • SQL scripts (337)
  • Uncategorized (0)
  • Videos (0)

Recent Posts

  • 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
  • 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

Archives

  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • Goog notes on X$ tables Oracle
  • Implementation of key based authentications Linux/Unix
  • oracle 10g on linux Linux/Unix
  • Pending Transaction Neighbors Script Oracle
  • eplan9i.sql Oracle
  • How to choose Driver table in SQL statement Oracle
  • Very Good Oralce Internal Tuning Book Oracle
  • Find all users who have DML privileges Oracle

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme