国内最全IT社区平台 联系我们 | 收藏本站
华晨云阿里云优惠2
您当前位置:首页 > 数据库 > Oracle > 在Oracle中启用AutoTrace查看SQL执行计划

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

来源:程序员人生   发布时间:2014-01-20 20:30:19 阅读次数:3460次
通过以下方法可以把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;

生活不易,码农辛苦
如果您觉得本网站对您的学习有所帮助,可以手机扫描二维码进行捐赠
程序员人生
------分隔线----------------------------
分享到:
------分隔线----------------------------
关闭
程序员人生