显示一个物理段的具体空间使用情况(使用dbms_space包)
declarel_total_blocks number;
l_total_bytes number;
l_unused_blocks number;
l_unused_bytes number;
l_lastusedextfileidnumber;
l_lastusedextblockid number;
l_last_used_block number;
begin
dbms_space.unused_space(segment_owner => '&segment_owner',
segment_name => '&segment_name',
segment_type => 'TABLE',
total_blocks => l_total_blocks,
total_bytes => l_total_bytes,
unused_blocks => l_unused_blocks,
unused_bytes => l_unused_bytes,
last_used_extent_file_id=> l_lastusedextfileid,
last_used_extent_block_id => l_lastusedextblockid,
last_used_block => l_last_used_block);
dbms_output.put_line(rpad('Total Blocks', 40, '.') || l_total_blocks);
dbms_output.put_line(rpad('Total Bytes', 40, '.') || l_total_bytes);
dbms_output.put_line(rpad('Unused Blocks', 40, '.') || l_unused_blocks);
dbms_output.put_line(rpad('Unused Bytes', 40, '.') || l_unused_bytes);
dbms_output.put_line(rpad('Last Used Ext FileId', 40, '.') || l_lastusedextfileid);
dbms_output.put_line(rpad('Last Used Ext BlockId', 40, '.') || l_lastusedextblockid);
dbms_output.put_line(rpad('Last Used Block', 40, '.') || l_last_used_block);
end;
/
页:
[1]