Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • Which environment is used by currently running process ( Very good) Linux/Unix
  • Rman Notes -1 Oracle
  • oracle Dba site Oracle
  • How to find pinned objects from shared pool. (pinned via dbms_shared_pool.keep) Oracle
  • How to find the real execution plan and binds used in that explain plan in Oracle 10g?? Oracle
  • How to find where datafile is created dbf_info.sql Oracle
  • For Perl DBI installation and testing program PHP/MYSQL/Wordpress
  • avail.sh ( find filesystem spae usage) Linux/Unix
  • Processes Parameter decision Oracle
  • How to Decide upto what level you can decrement your datafile size. ( Shrink Datafile) Oracle
  • findobj.sql Oracle
  • AWR license Oracle
  • ORA-4031 issue and solution on 09-MAY-2008 Oracle
  • ipcs -l Linux/Unix
  • AWR settings- MMON is not taking snapshot. 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

  • Logic to chech # of parameters command line parameters Linux/Unix
  • Check_recovery.sh program to run sqlplus and return its values remotely. Linux/Unix
  • note id 373303.1 Linux/Unix
  • crontab syntax Linux/Unix
  • .profile Linux/Unix
  • kill all processes from specific user in solaris. 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
  • More info about /proc folder and its relation with processes. Linux/Unix
  • Proc code Oracle
  • How to know current SID Oracle
  • restarting network in linux Linux/Unix
  • My Test Case On 21-OCT-2005 Oracle
  • Find_planinfo.sql Oracle
  • findobj.sql Oracle
  • switchover for primary database Oracle

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme