![]() |
|
![]() | ||
|
Subject:
SQL script to report Oracle 8.1.7 tablespace usage
Category: Computers > Software Asked by: solnm-ga List Price: $10.00 |
Posted:
17 Jun 2003 13:43 PDT
Expires: 17 Jul 2003 13:43 PDT Question ID: 218487 |
I have an Oracle 8.1.7 database running on Solaris 8. I want a script that I can run under sqlplus that reports the following for each tablespace name: tablespace name, total space in KB, free space in KB, % free I'd prefer to not get numbers in scientific notation. Here's the catch: I've found a number of scripts on the Internet that claim to do this or something close to this but none of them get the right numbers! I know what the right numbers are because the information I get from DBA Studio is consistent with my experience of the system. Also, the arithmetic I do to determine maximum tablespace sizes gives me the same answer as DBA Studio. On the other hand, the values from the freebie scripts I've run are always way off! If it makes a difference, my largest tablespace is something like 50GB. Also, lots of the scripts on the net are old so there may be Oracle version problems. Please don't send me scripts unless you have a way to test them on a system similar to mine and get numbers that are consistent with those from DBA Studio. Thanks. |
![]() | ||
|
There is no answer at this time. |
![]() | ||
|
Subject:
Re: SQL script to report Oracle 8.1.7 tablespace usage
From: amgindisci-ga on 23 Jun 2003 12:34 PDT |
set linesize 120 col "TOTAL (KB)" format 9999999999999999 col "FREE (KB)" format 9999999999999999 col TSNAME format a35 col "% FREE" format a10 select a.tablespace_name TSNAME, sum(a.bytes/1024) "TOTAL (KB)", sum(b.bytes/1024) "FREE (KB)", to_char(round(((sum(b.bytes/1024)/sum(a.bytes/1024))*100),2),'FM99990D999999') ||' %' "% FREE" from dba_data_files a, dba_free_space b where a.tablespace_name = b.tablespace_name group by a.tablespace_name / |
If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you. |
Search Google Answers for |
Google Home - Answers FAQ - Terms of Service - Privacy Policy |