1: 创建虚拟索引后需要设置隐含参数"_use_nosegment_indexes"为true, oracle才会选择虚拟索引。之前实验已经验证。 2: 虚拟索引只存在数据字典中定义,没有相关的索引段。如下所示,在dba_objects能查到索引定义,但是dba_indexes中没有数据。 SQL> select index_name from dba_indexeswhere table_name='TEST'; no rows selected SQL> col OBJECT_NAME for a30 SQL> col OBJECT_TYPE for a20 SQL> select object_name, object_typefrom dba_objects where 2 object_name=upper('idx_test_virtual'); OBJECT_NAME OBJECT_TYPE -------------------------------------------------- IDX_TEST_VIRTUAL INDEX 3:虚拟索引也可以像普通索引那样分析analyze;但是没有相关统计信息生成 SQL> analyze index idx_test_virtualvalidate structure; Index analyzed. 4:虚拟索引不能重建rebuild,否则会抛出ORA-8114错误。 SQL>alter index idx_test_virtual rebuild; alterindex idx_test_virtual rebuild * ERROR atline 1: ORA-08114:can not alter a fake index 5: 不能创建与虚拟索引同名的普通索引 SQL> createindex idx_test_virtual on test(object_id); create indexidx_test_virtual on test(object_id) * ERROR at line 1: ORA-00955: nameis already used by an existing object 6: 删除虚拟索引是不会放入到回收站的 SQL> showparameter recyclebin; NAME TYPE VALUE ----------------------------------------------- ------------------------------ recyclebin string on SQL> dropindex idx_test_virtual; Index dropped. SQL> selectowner, object_name, original_name, type from dba_recyclebin 2 where original_name='IDX_TEST_VIRTUAL'; no rows selected |