move_arch_files.ksh
ORACLE_SID=UAS LOG_FILE=/oracle/scripts/log/MOVE_UAS01.log ARCHMOUNTPOINT=/UASARCH DESTFOLDER=/uocdb7/archlog/UAS
ORACLE_SID=UAS LOG_FILE=/oracle/scripts/log/MOVE_UAS01.log ARCHMOUNTPOINT=/UASARCH DESTFOLDER=/uocdb7/archlog/UAS
COMFORT_SPACE=75 NO_FILES_MOVED=0 NOTIFY_LIST=’dbaoracle@1800flowers.com’ cp /dev/null $LOG_FILE
#ARCH_SPACE=`df -k /UASARCH | tail -1 | awk ‘{print $5’} | sed ‘s/%//g’` ARCH_SPACE=`df -k $ARCHMOUNTPOINT | tail -1 | awk ‘{print $5’} | sed ‘s/%//g’`
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…
ORACLE_SID=CADEV;export ORACLE_SID ORACLE_HOME=/oracle/app/oracle/product/10.1;export ORACLE_HOME ORACLE_BASE=/oracle/app/oracle;export ORACLE_BASE LD_LIBRARY_PATH=/oracle/app/oracle/product/10.1/lib;export LD_LIBRARY_PATH PATH=/oracle/app/oracle/product/10.1/bin:/usr/ccs/bin:/usr/X/bin:/usr/openwin/bin:/usr/bin/X11:/usr/dt/bin:/usr/openwin/bin:/bin:/usr/bin:/usr/ucb:/usr/contrib/bin:/usr/local/bin:/usr/sbin:/usr/oracle/lib:/usr/proc/bin:/oracle/app/oracle/admin/shareplex/bin;export PATH ORA_NLS32=$ORACLE_HOME/ocommon/nls/admin/data;export ORA_NLS32 TNS_ADMIN=/oracle/app/oracle/product/10.1/network/admin;export TNS_ADMIN PFILE=/oracle/app/oracle/admin/CADEV/pfile;export PFILE UTL_DIR=/oracle/app/oracle/admin/CADEV/utl_dir;export UTL_DIR LOGS=/export/home/oracle/oraprocs/logs;export LOGS SCRIPTS=/export/home/oracle/oraprocs;export SCRIPTS ORAPROCS=/export/home/oracle/oraprocs;export ORAPROCS ORA_BDUMP=/oracle/app/oracle/admin/CADEV/bdump;export ORA_BDUMP ORA_CDUMP=/oracle/app/oracle/admin/CADEV/cdump;export ORA_CDUMP ORA_UDUMP=/oracle/app/oracle/admin/CADEV/udump;export ORA_UDUMP ORACLE_MAILING_LIST=”fdarwesh@1800flowers.com”;export ORACLE_MAILING_LIST NODENAME=`uname`;export NODENAME RPT=/export/home/oracle/projects/capacity/reports;export RPT BDUMP=/oracle/app/oracle/admin/CADEV/bdump;export BDUMP CDUMP=/oracle/app/oracle/admin/CADEV/cdump;export CDUMP UDUMP=/oracle/app/oracle/admin/CADEV/udump;export UDUMP EXPORT_BAK_DIR=/db7/export/backup;export EXPORT_BAK_DIR EXPORT_DIR=/db6/export/backup;export EXPORT_DIR
# This File Sets all the Oracle Environment Variables and is called from # Each Users’s . profile file. B=`tput smso` N=`tput rmso` echo “” echo “Enter $B 1 $N to access Oracle 10.1.0.3 – TEST ” echo “” echo “Enter $B 2 $N to access Oracle 10.1.0.3 – UOCTEST ” echo “” echo “Enter…
#! /bin/ksh -x set -o vi stty erase EDITOR=vi;export EDITOR PATH=.:$PATH;export PATH . /oracle/oraprocs/set_env_dba stty erase ^H PS1=`uname -n`’->”$ORACLE_SID”@”(”$PWD”)’; /bin/perl /oracle/title.pl `uname -n` “->” “$ORACLE_SID” DISPLAY=192.168.4.112:0.0;export DISPLAY
#!/bin/ksh
DESTFOLDER=/uocdb7/archlog/UAS LOGFILE=/oracle/scripts/log/rm_backup_arch_uas.log NOTIFY_LIST=’dbaoracle@1800flowers.com’ NODENAME=`hostname` ORACLE_SID=UAS SCRIPT_NAME=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…