Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Determine Tablespace Size

Status
Not open for further replies.

Michael42

Programmer
Oct 8, 2001
1,454
US
Hey all,

Though this may seem like the dumbest question, what is the SQL used to determine the size of a tablespace?

I am NOT looking for the amount used but the entire allocated space for the tablespace,i.e. used space plus unused space.

I have been hunting here and on the web to find this without success.

Thanks,

Michael42
 
Code:
select * from sys.user_tablespaces
where TABLESPACE_NAME = 'Your Tablespace'

Beware of false knowledge; it is more dangerous than ignorance. ~George Bernard Shaw
Consultant Developer/Analyst Oracle, Forms, Reports & PL/SQL (Windows)
Author and Sole Proprietor of: Emu Products Plus
 
>> size of a tablespace

In bytes, sorry I should have specified this. :)

Thanks,

Michael42
 
Michael,

Try this code:
Code:
col a heading "Sum In Bytes|of Tablespace|Files" format 999,999,999,999
select sum(bytes) a,tablespace_name from dba_data_files
group by tablespace_name;

    Sum In Bytes
   of Tablespace
           Files TABLESPACE_NAME
---------------- ----------------
     251,658,240 DATA1
     241,172,480 DATA2
      20,971,520 RBS
     163,577,856 SYSTEM
      10,485,760 TEMP
Let us know if this is what you wanted. (If you want my favourite script, search for "@freespace" in the Advanced Search option of Tek-Tips.)

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
[ Providing low-cost remote Database Admin services]
Click here to join Utah Oracle Users Group on Tek-Tips if you use Oracle in Utah USA.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top