dbms_space.space_usage的輸出變數太多,使用極不方便!

warehouse發表於2008-12-19

簡單的包裝一下,使用時呼叫,放在這裡備查!

[@more@]

SQL> create or replace procedure show_space_assm(
2 segment_owner varchar2,
3 segment_name varchar2,
4 segment_type varchar2)
5 is
6 UNFORMATTED_BLOCKS NUMBER;
7 UNFORMATTED_BYTES NUMBER;
8 FS1_BLOCKS NUMBER;
9 FS1_BYTES NUMBER;
10 FS2_BLOCKS NUMBER;
11 FS2_BYTES NUMBER;
12 FS3_BLOCKS NUMBER;
13 FS3_BYTES NUMBER;
14 FS4_BLOCKS NUMBER;
15 FS4_BYTES NUMBER;
16 FULL_BLOCKS NUMBER;
17 FULL_BYTES NUMBER;
18 begin
19 dbms_space.space_usage(
20 segment_owner,
21 segment_name,
22 segment_type,
23 UNFORMATTED_BLOCKS,
24 UNFORMATTED_BYTES,
25 FS1_BLOCKS,
26 FS1_BYTES,
27 FS2_BLOCKS,
28 FS2_BYTES,
29 FS3_BLOCKS,
30 FS3_BYTES,
31 FS4_BLOCKS,
32 FS4_BYTES,
33 FULL_BLOCKS,
34 FULL_BYTES);
35 dbms_output.put_line('UNFORMATTED_BLOCKS:'||UNFORMATTED_BLOCKS);
36 dbms_output.put_line('FS1_BLOCKS:'||FS1_BLOCKS);
37 dbms_output.put_line('FS1_BYTES:'||FS1_BYTES);
38 dbms_output.put_line('FS2_BLOCKS:'||FS2_BLOCKS);
39 dbms_output.put_line('FS2_BYTES:'||FS2_BYTES);
40 dbms_output.put_line('FS3_BLOCKS:'||FS3_BLOCKS);
41 dbms_output.put_line('FS3_BYTES:'||FS3_BYTES);
42 dbms_output.put_line('FS4_BLOCKS:'||FS4_BLOCKS);
43 dbms_output.put_line('FS4_BYTES:'||FS4_BYTES);
44 dbms_output.put_line('FULL_BLOCKS:'||FULL_BLOCKS);
45 dbms_output.put_line('FULL_BYTES:'||FULL_BYTES);
46 END;
47 /

過程已建立。

SQL>

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/19602/viewspace-1015004/,如需轉載,請註明出處,否則將追究法律責任。

相關文章