Home » SQL & PL/SQL » SQL & PL/SQL » Finding out the free space in a tablespace
Finding out the free space in a tablespace [message #9881] Thu, 11 December 2003 02:42 Go to next message
Sudhakar
Messages: 34
Registered: May 2002
Member
How to find out the free space in a tablespace? Can I use the DBA_FREE_SPACE view to know that?
Re: Finding out the free space in a tablespace [message #9883 is a reply to message #9881] Thu, 11 December 2003 02:52 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
mag@mutation_mutation > get ta
  1  select
  2   total.ts tablespace,
  3   total.bytes total_mb,
  4   total.bytes - free.bytes used_mb,
  5   free.bytes free_mb,
  6   100-ROUND( (free.bytes)/(total.bytes) * 100, 2) pct_used,
  7   NVL(
  8   RPAD(LPAD('*',trunc((100-ROUND( (free.bytes)/(total.bytes) * 100, 2))/5),'*'),20,' '),
  9   '         ')
 10    GRAPH
 11  from
 12   (select tablespace_name ts, round(sum(bytes)/1024/1024,2) bytes from dba_data_files group by tablespace_name) total,
 13   (select tablespace_name ts, round(sum(bytes)/1024/1024,2) bytes from dba_free_space group by tablespace_name) free
 14  where total.ts=free.ts
 15* /
mag@mutation_mutation > @ta

TABLESPACE                       TOTAL_MB    USED_MB    FREE_MB   PCT_USED GRAPH
------------------------------ ---------- ---------- ---------- ---------- --------------------
INDX                                   25        .06      24.94        .24
SAMPLE                                 25      16.12       8.88      64.48 ************
SYSTEM                                800     183.75     616.25      22.97 ****
TOOLS                                  10        .06       9.94         .6
UNDOTBS1                              200      18.31     181.69       9.15 *
USERS                              276.25        .56     275.69         .2

6 rows selected.

Re: Finding out the free space in a tablespace [message #9886 is a reply to message #9881] Thu, 11 December 2003 05:43 Go to previous message
Eric
Messages: 78
Registered: April 1999
Member
There are some tools can help you quickly check free space. Quest, Embarcadero or tools from agileinfosoftware.com etc.

I am using a tool called DataAnalyst from www.agileinfosoftware.com to check freespace, it works great for me. If you need, here is the link:
http://www.agileinfosoftware.com/download/products.asp

eric
Previous Topic: Better way to check if a record exists in a table.
Next Topic: default sql script for sql plus
Goto Forum:
  


Current Time: Sat Apr 20 07:12:59 CDT 2024