Re: HELP: need % of tablespace free
From: Reinhard Kuhn <kuhn_at_cas-ps.com>
Date: 1996/02/16
Message-ID: <4g2g18$66n_at_fred.cas-ps.com>#1/1
Date: 1996/02/16
Message-ID: <4g2g18$66n_at_fred.cas-ps.com>#1/1
In article <2d7cc$a2c1a.1c_at_NEWS>, jul395_at_prb.mhs.compuserve.com says...
>
>
>I need to know what percentage of a tablespace is filled with data. I
>had hoped it was a simple query in SQL, like
>
I'm using the following script:
- snip ---------------------------------------- select a.tablespace_name, lpad(substr(round(a.bytes / (1024*1024)),1,10)||' M',6) as total, lpad(substr(round(b.bytes / (1024*1024)),1,10)||' M',6) as used , lpad(substr(round( 100* b.bytes / a.bytes),1,7)||' %',12) as percent_used from (select tablespace_name, sum(bytes) bytes from dba_data_files group by tablespace_name) a, (select tablespace_name, sum(bytes) bytes from dba_segments group by tablespace_name ) b where a.tablespace_name = b.tablespace_name;
- snip ---------------------------------------
hope this helps
-- _/_/_/ _/_/_/ _/ _/ // Reinhard Kuhn / It can be _/ _/ _/ _/ _/ // (kuhn_at_cas-ps.com) / done quickly, _/_/_/ _/_/_/ _/_/ // CAS GmbH / cheaply or well _/ _/ _/ _/ _/ // Lemberger Strasse 14 / - pick any two! _/ _/ _/_/_/ _/ _/ // 66955 Pirmasens, Germany /Received on Fri Feb 16 1996 - 00:00:00 CET