Created
October 6, 2016 16:31
-
-
Save dotmaik1/176a8d9b818c0fc5966baad9d3965a32 to your computer and use it in GitHub Desktop.
Script that gather full database statistics
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ################################################################################## | |
| # Name : GSS_FULL_DB.sh | |
| # Location : /home/oracle/scripts/mxoptix1/GSS | |
| # Created By : [ Wipro DBA Team ] | |
| # Purpose : GSS for FULL DB - MXAPPS[PROD] | |
| # | |
| ################################################################################### | |
| mail_list="[email protected],[email protected]" | |
| echo -e "\nGSS for FULL DB Process Started at `date` \n \n \n" > /home/oracle/scripts/mxapps1/GSS/FULL_DB_GSS.log | |
| export ORACLE_SID=mxapps1 | |
| export ORACLE_HOME=/u001/MXDB/oracle/product/11.2.0/db | |
| export PATH=$PATH:${ORACLE_HOME}/bin | |
| $ORACLE_HOME/bin/sqlplus "/as sysdba" <<EOF | |
| spool /home/oracle/scripts/mxapps1/GSS/GSS_FULL_DB_SQL.log; | |
| set time on | |
| set timing on | |
| select name from v\$database; | |
| exec DBMS_STATS.GATHER_DATABASE_STATS; | |
| spool off; | |
| exit; | |
| EOF | |
| cat /home/oracle/scripts/mxapps1/GSS/GSS_FULL_DB_SQL.log >> /home/oracle/scripts/mxapps1/GSS/FULL_DB_GSS.log | |
| echo -e "\n \n \nGSS for FULL DB Process Completed at `date` \n \nThanks\nWipro-DBA-Support" >> /home/oracle/scripts/mxapps1/GSS/FULL_DB_GSS.log | |
| cat /home/oracle/scripts/mxapps1/GSS/FULL_DB_GSS.log |mailx -s "FULL DB STATS - MXAPPS " ${mail_list} | |
| rm /home/oracle/scripts/mxapps1/GSS/GSS_FULL_DB_SQL.log | |
| rm /home/oracle/scripts/mxapps1/GSS/FULL_DB_GSS.log | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment