Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save dotmaik1/2e097a52b8cc40ac27ab847dbbf66bae to your computer and use it in GitHub Desktop.

Select an option

Save dotmaik1/2e097a52b8cc40ac27ab847dbbf66bae to your computer and use it in GitHub Desktop.
Historical database growth script
#!/usr/bin/ksh
export ORACLE_SID=mxapps1
export ORACLE_HOME=/u001/MXDB/oracle/product/11.2.0/db
export PATH=$ORACLE_HOME/bin:$PATH
$ORACLE_HOME/bin/sqlplus -s "/as sysdba" <<EOF
SET PAGES 2000 LINES 200
SET HEAD OFF HEADING OFF FEEDBACK OFF
SET SERVEROUTPUT ON
spool /home/oracle/dbascripts/sizing/historical_db_growth.log append;
select sysdate, sum(bytes)/1024/1024 || ' MB' from dba_data_files;
spool off;
exit;
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment