DBA_SEGMENTS might not be populated
Matthew Thompson, April 25, 2019 - 10:38 pm UTC
I just did a similar thing and noticed 6 tables didn't get picked up during our move process.
After looking I found they were empty tables with SEGMENT_CREATED=NO in dba_tables so they didn't have an associated entry in dba_segments.
While it might not matter as they have no rows if you drop the tablespace including contents/datafiles it'll drop those tables.
Just something to watch if you're basing your check on dba_segments.
April 25, 2019 - 11:52 pm UTC
Nice input.
Thats part of our deferred segment creation stuff - no need to create a segment until someone adds the first row.
my tablespace is empty?
Gilberto de F Lins Guara, April 19, 2021 - 8:25 pm UTC
Try this query, the second column indicate that you have tablespace, but nobody use this
select tbs.tablespace_name, ext.tablespace_name from DBA_TABLESPACES tbs left join dba_extents ext on tbs.tablespace_name =ext .tablespace_name
where ext.tablespace_name is null ;