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

Home -> Community -> Usenet -> c.d.o.server -> DBMS_SPACE built-in

DBMS_SPACE built-in

From: DA Morgan <damorgan_at_psoug.org>
Date: Fri, 25 Nov 2005 17:25:12 -0800
Message-ID: <1132968307.124629@yasure>


I've been taking advantage of the holiday to update many of the entries in Morgan's Library and decided to build demos of the of the functionality in the DBMS_SPACE package: Some documented, some undocumented.

Found a real gem ... object_trend_growth which is a pipelined table function where each returned row describes the space usage of the object at a specific point in time.

dbms_space.object_growth_trend (

object_owner          IN VARCHAR2,
object_name           IN VARCHAR2,
object_type           IN VARCHAR2,
partition_name        IN VARCHAR2 DEFAULT NULL,
start_time            IN TIMESTAMP DEFAULT NULL,
end_time              IN TIMESTAMP DEFAULT NULL,
interval              IN DSINTERVAL_UNCONSTRAINED DEFAULT NULL,
skip_interpolated     IN VARCHAR2 DEFAULT 'FALSE',
timeout_seconds       IN NUMBER DEFAULT NULL,
single_datapoint_flag IN VARCHAR2 DEFAULT 'TRUE') RETURN object_growth_trend_table PIPELINED;

Return Type:
TYPE object_growth_trend_row IS RECORD ( timepoint TIMESTAMP,
space_usage NUMBER,
space_alloc NUMBER,
quality VARCHAR(20));

What I like about it most is the following from the output:

TIMEPOINT                           SPACE_USAGE SPACE_ALLOC QUALITY
----------------------------------- ----------- ----------- ------------
26-NOV-05 05.18.16.383000 PM              17032      262144 PROJECTED
27-NOV-05 05.18.16.383000 PM              17032      262144 PROJECTED
28-NOV-05 05.18.16.383000 PM              17032      262144 PROJECTED
29-NOV-05 05.18.16.383000 PM              17032      262144 PROJECTED
30-NOV-05 05.18.16.383000 PM              17032      262144 PROJECTED

Yes ... it is projecting the size of a table into the future based on past usage. The output is one row per day going back 30 days.

A Thanksgiving present to any and all.
--

Daniel A. Morgan
http://www.psoug.org
damorgan_at_x.washington.edu
(replace x with u to respond) Received on Fri Nov 25 2005 - 19:25:12 CST

Original text of this message

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