Collect the stats at schema level :
#!/bin/bash
#------------------------------------------------------------------------------
# Author: Jaydeep
# Purpose: Collect the stats at schema level
#------------------------------------------------------------------------------
#
# Set env.
#
export ORACLE_SID=JDQA1
export ORACLE_HOME=/u01/app/oracle/product/11.1.0/db_1
export PATH=${ORACLE_HOME}/bin:$PATH
export LOG=${LOGDIR}/stats_JDQA1log.${DATE}
# Capture the number of files opened by the EM agent.
echo "------------------------------------------------------------------------------"
echo "START"
echo `date`
echo "------------------------------------------------------------------------------"
echo "ORACLE_SID=${ORACLE_SID}"
#echo "ORACLE_HOME=${ORACLE_HOME}"
#echo "PATH=${PATH}"
echo "LOG=${LOG}"
#
# login to the database
#
sqlplus /nolog << EOF
connect / as sysdba;
set echo on
exec dbms_stats.gather_schema_stats(ownname=>'JAYDEEP', GRANULARITY=>'ALL', method_opt=>'FOR ALL INDEXED COLUMNS SIZE AUTO',e
stimate_percent=>30,CASCADE=>TRUE);
EOF
#
# Finish
#
echo "------------------------------------------------------------------------------"
echo "FINISH"
echo `date`
echo "------------------------------------------------------------------------------"
#!/bin/bash
#------------------------------------------------------------------------------
# Author: Jaydeep
# Purpose: Collect the stats at schema level
#------------------------------------------------------------------------------
#
# Set env.
#
export ORACLE_SID=JDQA1
export ORACLE_HOME=/u01/app/oracle/product/11.1.0/db_1
export PATH=${ORACLE_HOME}/bin:$PATH
export LOG=${LOGDIR}/stats_JDQA1log.${DATE}
# Capture the number of files opened by the EM agent.
echo "------------------------------------------------------------------------------"
echo "START"
echo `date`
echo "------------------------------------------------------------------------------"
echo "ORACLE_SID=${ORACLE_SID}"
#echo "ORACLE_HOME=${ORACLE_HOME}"
#echo "PATH=${PATH}"
echo "LOG=${LOG}"
#
# login to the database
#
sqlplus /nolog << EOF
connect / as sysdba;
set echo on
exec dbms_stats.gather_schema_stats(ownname=>'JAYDEEP', GRANULARITY=>'ALL', method_opt=>'FOR ALL INDEXED COLUMNS SIZE AUTO',e
stimate_percent=>30,CASCADE=>TRUE);
EOF
#
# Finish
#
echo "------------------------------------------------------------------------------"
echo "FINISH"
echo `date`
echo "------------------------------------------------------------------------------"
No comments:
Post a Comment