实验环境
搭建平台:VMware Workstation
OS:RHEL 6.10
Grid&DB:Oracle 11.2.0.4
SQL参考
select a.column_name,
b.num_rows,
a.num_distinct cardinality,
round(a.num_distinct / b.num_rows * 100, 2) selectivity,
a.histogram,
a.num_buckets
from dba_tab_col_statistics a, dba_tables b
where a.owner = b.owner
and a.table_name = b.table_name
and a.owner = 'xxx' --用户名
and a.table_name = 'xxx'; --表名
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/69992972/viewspace-2784596/ ,如需转载,请注明出处,否则将追究法律责任。