Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • pvm_metric.sql for gathering report from vmstat tables Oracle
  • Removing Blank lines from file using grep Linux/Unix
  • Establishing trusted relationship between dbmonitor( central monitoring) and monitoring targets. Linux/Unix
  • Find all users who have DML privileges Oracle
  • Alter procedure auditing Oracle
  • database trigger failing Oracle
  • db_status.sql Oracle
  • v$backup.status information Oracle
  • Gather Stats manually using DBMS_STATS after disabling DBMS_SCHEDULER jobs as previous entry Oracle
  • How to Decide upto what level you can decrement your datafile size. ( Shrink Datafile) Oracle
  • cif crons Linux/Unix
  • arch_configUOCIOTTO.ora Oracle
  • RAC with RHEL4 and 11g Oracle
  • RAC 11g with vmware Oracle
  • 751131.1 New Article Error 2819 While Requesting a Systemstate Dump Oracle

rm_backup_arch_file.ksh

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

a=`ps -ef|grep $SCRIPT_NAME|grep -v grep|wc -l`

if [ $a -gt 2 ]

then

echo “Exiting because of more than 1 Moving archive log script is running ” >>$LOGFILE

exit

fi

cd $DESTFOLDER

b=0

buffersize=85

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

echo “This $DESTFOLDER files removal script was executed on `date`” >>$LOGFILE

while [ $currentdskspce -ge $buffersize ]

do

b=1

files2remove=`ls -latr * |head -1|awk {‘print $9’}`

echo “the files to be removed are $files2remove” >>$LOGFILE

rm $files2remove

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

echo “the current space utilization is $currentdskspce” >>$LOGFILE

done

if [ $b -gt 0 ]

then

mailx -s ” File Removed Alert from $NODENAME, $ORACLE_SID Database” $NOTIFY_LIST< Archive log files were removed from $DESTFOLDER

Currently $DESTFOLDER is at $currentdskspce %

EOF

fi

Linux/Unix, shell

Post navigation

Previous Post: purge_trc.sh
Next Post: .profile

Related Posts

  • Zip and unzip with tar Linux/Unix
  • checking connectivity between two servers Linux/Unix
  • Logic to chech # of parameters command line parameters Linux/Unix
  • to see when crontab is changed. Linux/Unix
  • How to remove blank lines using vi editor command Linux/Unix
  • proper cpu stats 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
  • fdisk -l explaination about Primary-Logical-Extended Partitions Linux/Unix
  • ORA-4031 issue and solution on 09-MAY-2008 Oracle
  • create PLAN_TABLE command. Oracle
  • Rename Oracle Instance Name Oracle
  • myfile Oracle
  • Find execution plan from dba_hist_sql_plan for a specific SQL_ID and PLAN_HASH_VALUE fplan.sql Oracle
  • OEM-Commnds Oracle
  • Pending Distributed Transations Oracle

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme