在一张大表上创建索引有时候我们需要提前预估索引所占空间的大小,这时候我们就可以使用到一个存储过程来估算即将创建的索引的大小
sql>variable
used_bytes number
sql>varable alloc_bytes number
sql>dbms_space.create_index_cost('create index index_name on table_name(column_name)',:used_bytes,:alloc_bytes)
sql>print :
used_bytes

user_bytes 给出了索引估算的占用空间,alloc_bytes 给出了系统分配的空间
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/26764973/viewspace-1258044/
,如需转载,请注明出处,否则将追究法律责任。