Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> sql difference rounds

sql difference rounds

From: Debi <dlorraine_at_ucdavis.edu>
Date: Wed, 26 Jun 2002 11:19:33 -0800
Message-ID: <F001.0048929E.20020626111933@fatcity.com>


Why is my difference rounded:

'Checking space left in data_ts:'

          TOTAL_BYTES


       18,880,659,456

           USED_BYTES


       17,796,554,752

Space
Left


        1,000,000,000

Here's my script:

set heading on verify off
col total_bytes format 999,999,999,999,999 new_value tbytes

col tbytes format 999,999,999,999,999
col used_bytes format 999,999,999,999,999 new_value ubytes
col ubytes format 999,999,999,999,999
col space_left format 999,999,999,999,999 head 'Space Left'

spool space_left
prompt
prompt 'Checking space left in &1:'
prompt
select sum(t.bytes) total_bytes
from dba_data_files t
where t.tablespace_name = upper('&&1')
/

select sum(u.bytes) used_bytes
from dba_extents u
where u.tablespace_name = upper('&&1')
/

select (&&tbytes) - (&&ubytes) space_left from dual
/

Thanks,

Debi

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Debi
  INET: dlorraine_at_ucdavis.edu

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Wed Jun 26 2002 - 14:19:33 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US