AUTOTRACE工具配置:
scott>connect sys/change_on_install
已连接。
scott>@utlxplan
表已创建。
scott>create public synonym plan_table for plan_table;
同义词已创建。
scott>grant all on PLAN_TABLE to public;
授权成功。
创建并授予PLUSTRACE角色
scott>@D:OracleOra81sqlplusadminplustrce.sql
scott>grant plustrace to public;
授权成功。[@more@]控制执行计划:
set autotrace off 不产生AUTOTRACE报表(默认)
set autotrace on explan 报表只会显示优化器执行路径
set autotrace on statistics 报表只显示SQL语句执行统计运算
set autotrace on 报表包括优化期和SQL语句执行统计运算
set autotrace traceonly 类似于set autotrace on 但限制用户查询输出的打印结果
解释执行计划
----------------
1、不要在MTS下运行长事务
A: 当一个共享服务器得到请求进行更新或执行一个存储过程时,这个共享服务器在完成任务前专用于此。
在更新完成或存储过程完成之前,没有用户能使用此共巷服务器。
2、使用绑定变量。
--------------
理解多版本、一致读查询和非阻塞读取的含义
SCOTTb表演示,装载;
SQL> @d:oracleora81sqlplusdemodemobld.sql
Building demonstration tables. Please wait.
Demonstration table build is complete.
从Oracle8i Enterprise Edition Release 8.1.6.0.0 - Production
With the Partitioning option
JServer Release 8.1.6.0.0 - Production中断开
C:Documents and SettingsAdministrator>sqlplus scott/tiger
SQL*Plus: Release 8.1.6.0.0 - Production on 星期四 6月 30 10:05:06 2005
(c) Copyright 1999 Oracle Corporation. All rights reserved.
连接到:
Oracle8i Enterprise Edition Release 8.1.6.0.0 - Production
With the Partitioning option
JServer Release 8.1.6.0.0 - Production
SQL> alter table emp add constraint emp_pk primary key(empno);
表已更改。
SQL> alter table dept add constraint dept_pk primary key(deptno);
表已更改。
SQL> alter table emp add constraint emp_fk_dept foreign key(deptno) references dept;
表已更改。
SQL> alter table emp add constraint emp_fk_emp foreign key(mgr) references emp;
表已更改。
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/14926/viewspace-804107/
,如需转载,请注明出处,否则将追究法律责任。