Oracle Logbook

November 1, 2011

How to have a raw idea about the table growing usage

Filed under: Uncategorized — heliodias @ 9:38 pm

This just will work for tables already populated.

You must connect as sysdba

SET SERVEROUT ON;
CREATE OR REPLACE PROCEDURE ESPACO(VOWNER IN VARCHAR2,VTABELA IN VARCHAR2,VPROJETADO IN NUMBER)
IS
SAIDA NUMBER;
BEGIN
EXECUTE IMMEDIATE ‘SELECT BYTES/(SELECT COUNT(*) FROM ‘||VOWNER||’.'||VTABELA||’)*’||VPROJETADO||’ FROM DBA_SEGMENTS WHERE SEGMENT_NAME=:1 and owner=:2′ into saida using vtabela,vowner;
dbms_output.put_line(TRUNC(saida));
END;
/

Advertisement

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Theme: Rubric. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.