在Oracle中启用AutoTrace查看SQL执行计划

通过以下方法可以把Autotrace的权限授予Everyone,

  如果你需要限制Autotrace权限,可以把对public的授权改为对特定user的授权。 

D:oracleora92>sqlplus /nolog
  SQL*Plus: Release 9.2.0.1.0 - Production on 星期二 6月 3 15:16:03 2003
  Copyright (c) 1982,2002,Oracle Corporation. All rights reserved.
SQL> connect sys as sysdba


  请输入口令:

  已连接。

SQL> [b]@?dbmsadminutlxplan[/b]


  表已创建。

SQL> create public synonym plan_table for plan_table;


  同义词已创建。

SQL> grant all on plan_table to public ;


  授权成功。

SQL>[b] @?sqlplusadminplustrce[/b]
  SQL>
  SQL> drop role plustrace;
  drop role plustrace
  *

  ERROR 位于第 1 行:

  ORA-01919: 角色'PLUSTRACE'不存在

SQL> create role plustrace;


  角色已创建

SQL>
SQL> grant select on v_$sesstat to plustrace;


  授权成功。

SQL> grant select on v_$statname to plustrace;

相关文章

文章浏览阅读773次,点赞6次,收藏9次。【代码】c# json字符...
文章浏览阅读8.7k次,点赞2次,收藏17次。此现象一般定位到远...
文章浏览阅读2.8k次。mysql脚本转化为oracle脚本_mysql建表语...
文章浏览阅读2.2k次。cx_Oracle报错:cx_Oracle DatabaseErr...
文章浏览阅读1.1k次,点赞38次,收藏35次。本文深入探讨了Or...
文章浏览阅读1.5k次。默认自动收集统计信息的时间为晚上10点...