Use dbms_space to show space : dbms_space « System Packages « Oracle PL / SQL

Oracle PL / SQL
1. Aggregate Functions
2. Analytical Functions
3. Char Functions
4. Constraints
5. Conversion Functions
6. Cursor
7. Data Type
8. Date Timezone
9. Hierarchical Query
10. Index
11. Insert Delete Update
12. Large Objects
13. Numeric Math Functions
14. Object Oriented Database
15. PL SQL
16. Regular Expressions
17. Report Column Page
18. Result Set
19. Select Query
20. Sequence
21. SQL Plus
22. Stored Procedure Function
23. Subquery
24. System Packages
25. System Tables Views
26. Table
27. Table Joins
28. Trigger
29. User Previliege
30. View
31. XML
Java
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Oracle PL / SQL » System Packages » dbms_space 
Use dbms_space to show space
 
SQL> --show space
SQL>
SQL>
SQL> create or replace procedure show_space(
  2    p_segname in varchar2,
  3    p_owner   in varchar2 default user,
  4    p_type    in varchar2 default 'TABLE')
  5  as
  6    l_free_blks                 number;
  7
  8    l_total_blocks              number;
  9    l_total_bytes               number;
 10    l_unused_blocks             number;
 11    l_unused_bytes              number;
 12    l_lastusedextfileid         number;
 13    l_lastusedextblockid        number;
 14    l_last_used_block           number;
 15
 16  begin
 17    dbms_space.free_blocks(
 18      segment_owner     => p_owner,
 19      segment_name      => p_segname,
 20      segment_type      => p_type,
 21      freelist_group_id => 0,
 22      free_blks         => l_free_blks );
 23
 24    dbms_space.unused_space(
 25      segment_owner     => p_owner,
 26      segment_name      => p_segname,
 27      segment_type      => p_type,
 28      total_blocks      => l_total_blocks,
 29      total_bytes       => l_total_bytes,
 30      unused_blocks     => l_unused_blocks,
 31      unused_bytes      => l_unused_bytes,
 32      last_used_extent_file_id => l_lastusedextfileid,
 33      last_used_extent_block_id => l_lastusedextblockid,
 34      last_used_block => l_last_used_block );
 35
 36    dbms_output.put_line'Free Blocks');
 37    dbms_output.put_linel_free_blks );
 38    dbms_output.put_line'Total Blocks');
 39    dbms_output.put_linel_total_blocks );
 40    dbms_output.put_line'Total Bytes');
 41    dbms_output.put_linel_total_bytes );
 42    dbms_output.put_line'Unused Blocks');
 43    dbms_output.put_linel_unused_blocks );
 44    dbms_output.put_line'Unused Bytes');
 45    dbms_output.put_linel_unused_bytes );
 46    dbms_output.put_line'Last Used Ext FileId');
 47    dbms_output.put_linel_lastusedextfileid );
 48    dbms_output.put_line'Last Used Ext BlockId');
 49    dbms_output.put_linel_lastusedextblockid );
 50    dbms_output.put_line'Last Used Block');
 51    dbms_output.put_linel_last_used_block );
 52  end;
 53  /

Procedure created.

SQL>
SQL> --

 
Related examples in the same category
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.