Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Freespace report
Hi Charles,
Good on you. It's always nice to come up with your own scripts to do stuff like this because I believe it all helps in the learning process and understanding what is going on and how Oracle works.
Note that there are events in OEM that provides similar functionality.
Cheers
Richard
"Charles J. Fisher" <cfisher_at_rhadmin.org> wrote in message
news:Pine.LNX.4.44.0207251108010.30545-100000_at_galt.rhadmin.org...
> I've seen several queries floating around to report space used in Oracle
> tablespaces and datafiles, but I decided to write my own recently,
> because:
>
> 1. I don't care when a datafile is (nearly) full when the tablespace is
> not (nearly) full.
> 2. I'm tired of seeing 2gig datafiles being reported when Oracle has
> datafiles on a system that does not support large files.
> 3. When the tablespace *is* full, I'd like to see *all* the associated
> datafiles.
> 4. I've also seen inline views summing dba_extents to be faster than
> queries not using inline views (but I'm too lazy to explain the plan).
>
> So the query below reports all datafiles for tablespaces over 90% full.
> The query does stomp on the datafile name a bit (what sql needs is unix
> "basename"). It's a shame that sqlplus "compute" doesn't work over
> multiple columns. It seems to run pretty fast, though.
>
> Just thought I'd share, and see if anyone has something better.
>
> ----------------------------------------------------------------------