#!/bin/ksh # ================================================================================================================= # Title: soa_dehyd.ksh # Author: Richard Wilson # Date: 5th June 2014 # Description: Parallel purges the SOA instances. # ----------------------------------------------------------------------------------------------------------------- export ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1 export ORACLE_SID=`echo ${1} | tr [:lower:] [:upper:]` export USERNAME=`echo ${ORACLE_SID} | tr [:upper:] [:lower:]` if [ ${#} -eq 1 ]; then ${ORACLE_HOME}/bin/sqlplus -s ${USERNAME}_soainfra/newr00t@${ORACLE_SID} <<-EOF set serveroutput on; DECLARE l_min_creation_date TIMESTAMP := systimestamp - INTERVAL '10' YEAR; l_max_creation_date TIMESTAMP := systimestamp - INTERVAL '1' HOUR; l_retention_period TIMESTAMP := systimestamp - INTERVAL '1' HOUR; l_batch_size integer := 25000; l_max_runtime integer := 5; BEGIN ${USERNAME}_soainfra.soa.delete_instances(min_creation_date => l_min_creation_date, max_creation_date => l_max_creation_date, batch_size => l_batch_size, max_runtime => l_max_runtime, retention_period => l_retention_period, purge_partitioned_component => false); commit; END; / EOF else echo "Usage: soa_dehyd_v1.ksh ORACLE_SID." fi # End of File # =================================================================================================================