简单的包装一下,使用时调用,放在这里备查!
[@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/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/19602/viewspace-1015004/