OCP-1Z0-053-V12.02-22题
2013-11-01 10:45
337 查看
22.An index called ORD_CUSTNAME_IX has been created on the CUSTNAME column in the ORDERS
table using the following command:
SQL>CREATE INDEX ord_custname_ix ON orders(custname);
The ORDERS table is frequently queried using the CUSTNAME column in the WHERE clause. You want
to check the impact on the performance of the queries if the index is not available. You do not want the
index to be dropped or rebuilt to perform this test.
Which is the most efficient method of performing this task?
A. disabling the index
B. making the index invisible
C. making the index unusable
D. using the MONITORING USAGE clause for the index
Answer: B
To create an invisible index:
Use the
The following statement creates an invisible index named
CREATE INDEX emp_ename ON emp(ename)
TABLESPACE users
STORAGE (INITIAL 20K
NEXT 20k) INVISIBLE;
隐藏索引
scott@TESTDB> create index emp_ename_i on emp(ename) invisible;
Index created.
scott@TESTDB> select index_name,VISIBILITY from user_indexes;
INDEX_NAME VISIBILIT
-------------------- ---------
PK_EMP VISIBLE
EMP_SAL_F VISIBLE
EMP_COMM_I VISIBLE
EMP_ENAME_I INVISIBLE
PK_DEPT VISIBLE
scott@TESTDB> select * from emp where ename='KING';
没有走索引
切换到系统用户,修改参数
sys@TESTDB> alter session set optimizer_use_invisible_indexes=true;
Session altered.
sys@TESTDB> select * from scott.emp where ename='KING';
隐藏索引变正常索引或反之
sys@TESTDB> alter index scott.emp_ename_i visible;
Index altered.
scott@TESTDB> select index_name,VISIBILITY from user_indexes;
INDEX_NAME VISIBILIT
------------------------------ ---------
PK_EMP VISIBLE
EMP_SAL_F VISIBLE
EMP_COMM_I VISIBLE
EMP_ENAME_I VISIBLE
PK_DEPT VISIBLE
多个索引,把慢的索引隐藏点,让他走快的索引
scott@TESTDB> alter index emp_ename_i visible;
Index altered.
scott@TESTDB> alter index emp_ename_i invisible;
Index altered.
table using the following command:
SQL>CREATE INDEX ord_custname_ix ON orders(custname);
The ORDERS table is frequently queried using the CUSTNAME column in the WHERE clause. You want
to check the impact on the performance of the queries if the index is not available. You do not want the
index to be dropped or rebuilt to perform this test.
Which is the most efficient method of performing this task?
A. disabling the index
B. making the index invisible
C. making the index unusable
D. using the MONITORING USAGE clause for the index
Answer: B
Creating an Invisible Index
An invisible index is an index that is ignored by the optimizer unless you explicitly set theOPTIMIZER_USE_INVISIBLE_INDEXESinitialization parameter to
TRUEat the session or system level.
To create an invisible index:
Use the
CREATE INDEXstatement with the
INVISIBLEkeyword.
The following statement creates an invisible index named
emp_enamefor the
enamecolumn of the
emptable:
CREATE INDEX emp_ename ON emp(ename)
TABLESPACE users
STORAGE (INITIAL 20K
NEXT 20k) INVISIBLE;
隐藏索引
scott@TESTDB> create index emp_ename_i on emp(ename) invisible;
Index created.
scott@TESTDB> select index_name,VISIBILITY from user_indexes;
INDEX_NAME VISIBILIT
-------------------- ---------
PK_EMP VISIBLE
EMP_SAL_F VISIBLE
EMP_COMM_I VISIBLE
EMP_ENAME_I INVISIBLE
PK_DEPT VISIBLE
scott@TESTDB> select * from emp where ename='KING';
没有走索引
切换到系统用户,修改参数
sys@TESTDB> alter session set optimizer_use_invisible_indexes=true;
Session altered.
sys@TESTDB> select * from scott.emp where ename='KING';
隐藏索引变正常索引或反之
sys@TESTDB> alter index scott.emp_ename_i visible;
Index altered.
scott@TESTDB> select index_name,VISIBILITY from user_indexes;
INDEX_NAME VISIBILIT
------------------------------ ---------
PK_EMP VISIBLE
EMP_SAL_F VISIBLE
EMP_COMM_I VISIBLE
EMP_ENAME_I VISIBLE
PK_DEPT VISIBLE
多个索引,把慢的索引隐藏点,让他走快的索引
scott@TESTDB> alter index emp_ename_i visible;
Index altered.
scott@TESTDB> alter index emp_ename_i invisible;
Index altered.
相关文章推荐
- OCP-1Z0-053-V12.02-508题
- OCP-1Z0-053-V12.02-548题
- OCP-1Z0-053-V12.02-147题
- OCP-1Z0-053-V12.02-598题
- OCP-1Z0-053-V12.02-47题
- OCP-1Z0-053-V12.02-392题
- OCP-1Z0-053-V12.02-205题
- OCP-1Z0-053-V12.02-524题
- OCP-1Z0-053-V12.02-113题
- OCP-1Z0-053-V12.02-188题
- OCP-1Z0-053-V12.02-608题
- OCP-1Z0-053-V12.02-356题
- OCP-1Z0-053-V12.02-677题
- OCP-1Z0-053-V12.02-555题
- OCP-1Z0-053-V12.02-405题
- OCP-1Z0-053-V12.02-53题
- OCP-1Z0-053-V12.02-73题
- OCP-1Z0-053-V12.02-177题
- OCP-1Z0-053-V12.02-236题
- OCP-1Z0-053-V12.02-114题