Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • Adding or Dropping Online Redo Log Files When Physical Standby in place Oracle
  • catting.sh Linux/Unix
  • create PLAN_TABLE command. Oracle
  • fkwoind.sql fkwoindex.sql Oracle
  • Locally Managed Tablespace and Dictionary managed tablespace (LMT-DMT) Oracle
  • create database link syntax Oracle
  • How to remove blank lines using vi editor command Linux/Unix
  • Important Solaris Commands Linux/Unix
  • oracle tips… from http://www.bijoos.com/oracle/douknow.htm Oracle
  • Histogram information Oracle
  • Find_stale_dr.sql finding stale physical DR.. Oracle
  • catall.sh Linux/Unix
  • ORA-3136 Oracle
  • How do I get Oracle to automatically start when my server boots up? Oracle
  • usnsql.sql Displays information about UNDO segments with sql statements Oracle

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

  • checking redhat linux version Linux/Unix
  • Debugging Shell FIles Linux/Unix
  • adding new line after specific pattern using sed Linux/Unix
  • Adding a new disk and mount it automatically. on VMWARE LINUX Linux/Unix
  • To Find Orphan OS processes. Linux/Unix
  • Zip and unzip with tar Linux/Unix

Leave a Reply Cancel reply

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

Categories

  • Ansible (0)
  • AWS (2)
  • Azure (1)
  • Linux/Unix (149)
  • MYSQL (5)
  • Oracle (393)
  • PHP/MYSQL/Wordpress (10)
  • POSTGRESQL (0)
  • Power-BI (0)
  • Python/PySpark (7)
  • RAC (17)
  • rman-dataguard (26)
  • shell (149)
  • SQL scripts (342)
  • SQL Server (6)
  • Uncategorized (0)
  • Videos (0)

Recent Posts

  • Trace a SQL session from another session using ORADEBUG30-Sep-2025
  • SQL Server Vs Oracle Architecture difference25-Jul-2025
  • SQL Server: How to see historical transactions25-Jul-2025
  • SQL Server: How to see current transactions or requests25-Jul-2025
  • T-SQL Vs PL/SQL Syntax25-Jul-2025
  • Check SQL Server edition25-Jul-2025
  • Checking SQL Server Version25-Jul-2025
  • Oracle vs MYSQL Architecture differences (For DBAs)24-Jul-2025
  • V$INSTANCE of Oracle in MYSQL24-Jul-2025
  • Day to day MYSQL DBA operations (Compared with Oracle DBA)24-Jul-2025

Archives

  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • Good link for LIO in Oracle ( Logical IOs) Oracle
  • Formatter Explain plan Output 1 Oracle
  • how to find VIP from ifconfig Linux/Unix
  • TNSNAMES entries details Oracle
  • On solaris 10, “S” link is not part of $ORACLE_HOME/bin/oracle as default. ( For 9.2.0.8) Oracle
  • Privilege to describe the table. Oracle
  • Find all users who have DML privileges Oracle
  • Jai Shree Ram Oracle

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme