DBAsupport.com Forums - Powered by vBulletin
Results 1 to 5 of 5

Thread: Free space in a datafile

  1. #1
    Join Date
    Feb 2002
    Posts
    267
    Hi folks,
    How to findout the filled space and free space in
    a datafile

    Regards
    sonia

  2. #2
    Join Date
    Jan 2001
    Posts
    3,134
    Not sure, I always use OEM for this. Do you have OEM?

    MH
    I remember when this place was cool.

  3. #3
    Join Date
    Oct 2000
    Posts
    250
    Try the select tablespace_name, bytes/1024/1024 "Free Space" from dba_free_space;

  4. #4
    Join Date
    Oct 2000
    Posts
    250
    Sorry, I miss read the sentence, Normally I will use the DBA Studio or OEM.... Faster and easier.

  5. #5
    Join Date
    Sep 2001
    Location
    Düsseldorf, Germany.
    Posts
    588
    Code:
    SELECT Substr(df.tablespace_name,1,20) "Tablespace_Name", 
           Substr(df.file_name,1,40) "File_Name", 
           Round(df.bytes/1024/1024,2) "Size_(M)", 
           Round(e.used_bytes/1024/1024,2) "Used_(M)", 
           Round(f.free_bytes/1024/1024,2) "Free_(M)", 
           Rpad(' '|| Rpad ('X',Round(e.used_bytes*10/df.bytes,0), 'X'),11,'-') "%_Used" 
    FROM   DBA_DATA_FILES DF, 
           (SELECT file_id, 
                   Sum(Decode(bytes,NULL,0,bytes)) used_bytes 
            FROM dba_extents 
            GROUP by file_id) E, 
           (SELECT Max(bytes) free_bytes, 
                   file_id 
            FROM dba_free_space 
            GROUP BY file_id) f 
    WHERE  e.file_id (+) = df.file_id 
    AND    df.file_id  = f.file_id (+) 
    ORDER BY df.tablespace_name, df.file_name
    HTH

    Sameer

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width