Executing job in Background for one sql

cat g_stats_1_test.shsqlplus / as sysdba <<EOFset head offconn / as sysdbaset serveroutput onset timing onset echo onspool dict_stats_test.log exec DBMS_STATS.gather_table_stats (ownname => ‘SCOTT’,tabname => ‘EMP’,method_opt=>’FOR COLUMNS SIZE AUTO STATUS’); spool offset timing offset serveroutput offexit; EOF chmod 777 g_stats_1_test.shnohup ./g_stats_1_test.sh &

Simple Script to Delete Archive logs

$ cat /u01/app/oracle/admin/SEPQA01/scripts/archiveclean.sh#CURRDATETIME=date ‘+%Y%m%d-%H%M%S’ORACLE_SID=ORCL1;export ORACLE_SIDORACLE_HOME=/u01/app/oracle/product/12102;export ORACLE_HOMELOGDIR=/var/opt/monitoring/oracle/logsLOGFILE=/var/opt/monitoring/oracle/logs/archiveclean.log $ORACLE_HOME/bin/rman <<EOF | tee -a /var/opt/monitoring/oracle/logs/archiveclean.logconnect targetdelete archivelog until time ‘sysdate-1’ ;exitEOF ORACLE_SID=ORCL2;export ORACLE_SID$ORACLE_HOME/bin/rman <<EOF | tee -a /var/opt/monitoring/oracle/logs/archiveclean.logconnect targetdelete archivelog until time ‘sysdate-1’ ;exitEOF ORACLE_SID=ORCL3;export ORACLE_SID$ORACLE_HOME/bin/rman <<EOF | tee -a /var/opt/monitoring/oracle/logs/archiveclean.logconnect targetdelete archivelog until time ‘sysdate-1’ ;exitEOF ###############chmod… Read More

RMAN Full Backup

/u01/app/oracle/DBA/rmanbackup.sh #!/bin/kshCURRDATETIME=date ‘+%Y%m%d-%H%M%S’aORACLE_SID=ORCL1;export ORACLE_SIDORACLE_HOME=/u01/app/oracle/product/12.1.0.2;export ORACLE_HOMELOGDIR=/var/opt/oracle/logsLOGFILE=${LOGDIR}/${ORACLE_SID}_rman_${CURRDATETIME}.log RMANBACKUPDIR=/backup/ORCL1/jul16 $ORACLE_HOME/bin/sqlplus dbsnmp/password <<EOF | tee -a $LOGFILESET LINESIZE 200COL FILE_NAME FOR A70SET FEEDBACK OFFSET PAGESIZE 100COL MEMBER FOR A60SELECT FILE_NAME,BYTES/1024/1024 MBYTES FROM DBA_DATA_FILES;SELECT FILE_NAME,BYTES/1024/1024 MBYTES FROM DBA_TEMP_FILES;SELECT GROUP#,MEMBER FROM v\$LOGFILE;SELECT NAME FROM V\$CONTROLFILE;EXITEOF $ORACLE_HOME/bin/rman <<EOF2 | tee -a $LOGFILEconnect… Read More

Load Test Monitoring