Oracle9i Supplied PL/SQL Packages and Types Reference Release 2 (9.2) Part Number A96612-01 |
|
DBMS_SPACE, 2 of 2
This procedure returns information about unused space in an object (table, index, or cluster).
DBMS_SPACE.UNUSED_SPACE ( segment_owner IN VARCHAR2, segment_name IN VARCHAR2, segment_type IN VARCHAR2, total_blocks OUT NUMBER, total_bytes OUT NUMBER, unused_blocks OUT NUMBER, unused_bytes OUT NUMBER, last_used_extent_file_id OUT NUMBER, last_used_extent_block_id OUT NUMBER, last_used_block OUT NUMBER, partition_name IN VARCHAR2 DEFAULT NULL);
This procedure returns information about free blocks in an object (table, index, or cluster). See "SPACE_USAGE Procedure" for returning free block information in a bitmapped segment.
DBMS_SPACE.FREE_BLOCKS ( segment_owner IN VARCHAR2, segment_name IN VARCHAR2, segment_type IN VARCHAR2, freelist_group_id IN NUMBER, free_blks OUT NUMBER, scan_limit IN NUMBER DEFAULT NULL, partition_name IN VARCHAR2 DEFAULT NULL);
pragma restrict_references(free_blocks,WNDS);
The following declares the necessary bind variables and executes.
DBMS_SPACE.UNUSED_SPACE('SCOTT', 'EMP', 'TABLE', :total_blocks, :total_bytes,:unused_blocks, :unused_bytes, :lastextf, :last_extb, :lastusedblock);
This fills the unused space information for bind variables in EMP
table in SCOTT
schema.
The following uses the CLUS
cluster in SCOTT
schema with 4 freelist groups. It returns the number of blocks in freelist group 3 in CLUS
.
DBMS_SPACE.FREE_BLOCKS('SCOTT', 'CLUS', 'CLUSTER', 3, :free_blocks);
This procedure shows the space usage of data blocks under the segment High Water Mark. The bitmap blocks, segment header, and extent map blocks are not accounted for by this procedure. This procedure can only be used on tablespaces that are created with auto segment space management.
DBMS_SPACE.SPACE_USAGE( segment_owner IN varchar2, segment_name IN varchar2, segment_type IN varchar2, unformatted_blocks OUT number, unformatted_bytes OUT number, fs1_blocks OUT number, fs1_bytes OUT number, fs2_blocks OUT number, fs2_bytes OUT number, fs3_blocks OUT number, fs3_bytes OUT number, fs4_blocks OUT number, fs4_bytes OUT number, full_blocks OUT number, full_bytes OUT number, partition_name IN varchar2 DEFAULT NULL);
variable unf number; variable unfb number; variable fs1 number; variable fs1b number; variable fs2 number; variable fs2b number; variable fs3 number; variable fs3b number; variable fs4 number; variable fs4b number; variable full number; variable fullb number; begin dbms_space.space_usage('U1','T', 'TABLE', :unf, :unfb, :fs1, :fs1b, :fs2, :fs2b, :fs3, :fs3b, :fs4, :fs4b, :full, :fullb); end; / print unf ; print unfb ; print fs4 ; print fs4b; print fs3 ; print fs3b; print fs2 ; print fs2b; print fs1 ; print fs1b; print full; print fullb;
|
Copyright © 2000, 2002 Oracle Corporation. All Rights Reserved. |
|