Put your tips and tricks online - Share your knowledge! Login | Register
 
 
  Search     Advanced search
 

Home | Ask Question | Add tip | Questions | My tips | Recent tips & tricks | Suggest a category | FAQ | Forums

 
 
 
 Category : Home > Databases > Oracle     

Display free, used and total space per tablespace in a database


Query to get tablespace information from Oracle database - total, used and free space, extents
etc.

select a.tablespace_name, round(c.tbytes/1024/1024, 2) as TMB,
	   round(b.ubytes/1024/1024, 2) as UMB,
	   round((c.tbytes - b.ubytes)/1024/1024, 2) as FMB, 
	   a.initial_extent, a.next_extent, a.max_extents, a.status, a.extent_management
from
	(select tablespace_name, initial_extent, next_extent, max_extents, status, extent_management
	from dba_tablespaces) a,
	(select tablespace_name, sum(bytes) as ubytes
	from dba_segments
	group by tablespace_name) b,
	(select tablespace_name, sum(bytes) as tbytes
	from dba_data_files
	group by tablespace_name) c
where b.tablespace_name (+)= a.tablespace_name
and c.tablespace_name (+)= a.tablespace_name
order by fmb asc
/


  Options
 
   del.icio.us  |  newsvine  |  digg  |  furl  |  google  |  yahoo  |  Ma.gnolia  |  vigillar  |  reddit  |  technorati  |  icerocket  |  pubsub

     (Average: 4.75 / Votes: 4)   Rate this tip:    

Start discussion or add comment to this tip

  Details
Tip reference : #27
views : 3070
Added on : 10/21/05
Submited by : h8dk97
 
Send a message Send a message Printer friendly output Printer friendly output
Display this member's tips Display this member's tips (202)
 
 
<< Previous Next >>
 Most viewed tips 
  Databases > Oracle > Security : How to unlock Oracle user account  
  Databases > Oracle > Performance Tuning : How to enable trace in Oracle  
  Operating Systems > Unix : How to kill Unix user session  
  Databases > Oracle : Kill user session  
   
  All categories
Databases | Programming | Hardware | Operating Systems | Networking | Internet | ERP / CRM | Games & Multimedia | Graphics & Design | Miscellaneous | Mobile Phones / Tablets | Office Software
 
 

Home |  FAQ |  Terms of Use |  Privacy Policy

© 2005 tiplib.com