This shell take an ORACLE_SID as parameter and calculate in MB the sizes of tablespaces
nbparam=$#
case $nbparam in
0) echo "Usage = tbs_size.sh <ORACLE_SID>"
exit 1;;
*);;
esac
export ORACLE_SID=$1
sqlplus "/ as sysdba" <<FIN
SELECT TABLESPACE_NAME, BYTES / 1024 / 1024 AS "Size MB"
FROM sys.dba_data_files
GROUP BY TABLESPACE_NAME, BYTES
ORDER BY BYTES DESC;
FIN
No comments:
Post a Comment