Chinaunix首页 | 论坛 | 博客
  • 博客访问: 103632216
  • 博文数量: 19283
  • 博客积分: 9968
  • 博客等级: 上将
  • 技术积分: 196062
  • 用 户 组: 普通用户
  • 注册时间: 2007-02-07 14:28
文章分类

全部博文(19283)

文章存档

2011年(1)

2009年(125)

2008年(19094)

2007年(63)

分类: Oracle

2008-03-31 12:40:22

来源:赛迪网    作者:Alizze

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$。

阅读(338) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~