使用DBMS_SPACE的CREATE_INDEX_COST过程来估算索引的空间需求。
下面就CREATE_INDEX_COST过程的变量描述下:
参数名 描述
ddl create index 命令
used_bytes 索引数据使用的字节数
alloc_bytes 分配给索引盘区的字节数
plan_table 使用的计划表(默认为NULL)
使用该过程的条件:
只有在创建,加载和分析表之后才可以使用该过程
示例如下:
SQL> set serveroutput on
SQL> declare
2 cu number;
3 ca number;
4 begin
5 dbms_space.create_index_cost(
6 ddl => 'create index t_idx4 on t(object_name)', used_bytes => cu, alloc_bytes => ca);
7 dbms_output.put_line('Used bytes = ' || cu);
8 dbms_output.put_line('Allocated bytes = ' || ca);
9 end;
10 /
Used bytes = 855559
Allocated bytes = 2097152
PL/SQL 过程已成功完成。
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/25964700/viewspace-708144/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/25964700/viewspace-708144/