Skip to content

Instantly share code, notes, and snippets.

@amitzilblog
Last active April 21, 2016 10:31
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save amitzilblog/1957e56c9e1dd8ee1f58 to your computer and use it in GitHub Desktop.
Save amitzilblog/1957e56c9e1dd8ee1f58 to your computer and use it in GitHub Desktop.
select * from
(select block_id first_block, block_id+blocks-1 last_block, bytes/1024 size_kb, 'USED' type, owner, segment_name, segment_type
from
dba_extents
where tablespace_name=upper('&&tbs_name')
union all
select block_id first_block, block_id+blocks-1 last_block, bytes/1024 size_kb, 'FREE' type, null, null, null
from
dba_free_space
where tablespace_name=upper('&&tbs_name')
)
order by first_block;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment