服务热线:13616026886

技术文档 欢迎使用技术文档,我们为你提供从新手到专业开发者的所有资源,你也可以通过它日益精进

位置:首页 > 技术文档 > 数据库技术 > Oracle技术 > Oracle开发 > 查看文档

oracle 9i与10g中plan_table的不同

oracle 9i与10g中plan_table的不同:

oracle 9i中查看plan_table:

sys@dg1> select * from v$version;

banner
--------------------------------------------------------
oracle9i enterprise edition release 9.2.0.4.0 - production
pl/sql release 9.2.0.4.0 - production
core 9.2.0.3.0 production
tns for linux: version 9.2.0.4.0 - production
nlsrtl version 9.2.0.4.0 - production

sys@dg1> set autotrace on explain;
sys@dg1> select * from plan_table;

no rows selected


execution plan
----------------------------------------------------------
0 select statement optimizer=choose
1 0 table access (full) of 'plan_table'

oracle 10g中查看plan_table:

sql> select * from v$version;

banner
----------------------------------------------------------------
oracle database 10g enterprise edition release 10.2.0.2.0 - prod
pl/sql release 10.2.0.2.0 - production
core 10.2.0.2.0 production
tns for solaris: version 10.2.0.2.0 - production
nlsrtl version 10.2.0.2.0 - production

sql> set autotrace on explain
sql> select * from plan_table;

no rows selected


execution plan
----------------------------------------------------------
plan hash value: 103984305

----------------------------------------------------------
-

| id | operation | name | rows | bytes | cost (%cpu)| time
|

----------------------------------------------------------
-

| 0 | select statement | | 1 | 11081 | 2 (0)| 00:00:01
|

| 1 | table access full| plan_table$ | 1 | 11081 | 2 (0)| 00:00:01
|

-----------------------------------------------------------
-


note
-----
- dynamic sampling used for this statement

结论:

oracle 10g中不再需要创建plan_table表,因为它会自动创建一个数据字典表plan_table$。

扫描关注微信公众号