主要有四步:
[@more@]
1.创建表,通过utlxplan.sql脚本
SQL> @?/rdbms/admin/utlxplan.sql
2. 创建同义词为了多个用户可以共享一个plan_table 并授权给public
SQL> create public synonym plan_table for plan_table;
SQL> grant all on plan_table to public;
3.创建plustrace 角色
SQL> @?/sqlplus/admin/plustrce.sql 执行这个脚本就可以了。
4、将角色权限授予public
sql>grant plustrace to public;
完成以上几步就可以使用autotrace 功能
set timing on --显示执行时间
set autotrace on 查看执行计划和查询信息
set autotrace traceonly 只显示执行计划,但不显示查询输出
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/73920/viewspace-1002682/
,如需转载,请注明出处,否则将追究法律责任。