Skip to content

Instantly share code, notes, and snippets.

@mixomat
Last active August 29, 2015 14:26
Show Gist options
  • Select an option

  • Save mixomat/6cb2b252aafef0cf012b to your computer and use it in GitHub Desktop.

Select an option

Save mixomat/6cb2b252aafef0cf012b to your computer and use it in GitHub Desktop.
oracle tablespace size
# used size
select tablespace_name, 'MB'||' '||round(sum(bytes/1024/1024)) "Used_Size" from dba_data_files group by tablespace_name;
# free size
select tablespace_name, 'MB'||' '||round(sum(bytes/1024/1024)) "Free_Size" from dba_free_space group by tablespace_name;
# extend tablespace size
alter database datafile <tablespace_name> autoextend on next 128m maxsize 8192m;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment