| Oracle8i Supplied PL/SQL Packages Reference Release 2 (8.1.6) Part Number A76936-01  | 
  | 
DBMS_SPACE, 2 of 2
| Subprogram | Description | 
|---|---|
    
UNUSED_SPACE Procedure  | 
 Returns information about unused space in an object (table, index, or cluster).  | 
    
FREE_BLOCKS Procedure  | 
 Returns information about free blocks in an object (table, index, or cluster).  | 
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).
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);
| 
 | 
![]() Copyright © 1996-2000, Oracle Corporation. All Rights Reserved.  | 
 
  |