how to run this query
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 2 of 2

Thread: how to run this query

  1. #1
    Join Date
    Jul 2007
    Location
    india
    Posts
    3

    Exclamation how to run this query

    suppose i have no access to dba_* views or tables, then how to run this query:---


    SELECT
    a.file_id,
    substr(a.tablespace_name,1,14) tablespace_name,
    trunc(decode(a.autoextensible,'YES',a.maxsize-a.bytes+b.free,'NO',b.free)/1024/1024) free_mb,
    trunc(a.bytes/1024/1024) size_mb,
    trunc(a.maxsize/1024/1024) maxsize_mb,
    a.autoextensible ae,
    trunc(decode(a.autoextensible,'YES',(a.maxsize-a.bytes+b.free)/a.maxsize*100,'NO',b.free/a.maxsize*100)) free_pct
    FROM
    (SELECT file_id,
    tablespace_name,
    autoextensible,
    bytes,
    decode(autoextensible,'YES',maxbytes,bytes) maxsize
    FROM dba_data_files
    GROUP BY file_id,
    tablespace_name,
    autoextensible,
    bytes,
    decode(autoextensible,'YES',maxbytes,bytes)) a,
    (SELECT file_id,
    tablespace_name,
    sum(bytes) free
    FROM dba_free_space
    GROUP BY file_id,
    tablespace_name) b
    WHERE a.file_id=b.file_id(+)
    AND a.tablespace_name=b.tablespace_name(+)
    ORDER BY a.tablespace_name ASC;
    Last edited by davey23uk; 07-08-2007 at 10:01 AM.

  2. #2
    Join Date
    Sep 2002
    Location
    England
    Posts
    7,331
    you dont

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