随锐旗下互动传媒:

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

http://www.weaseek.com  2008-08-14 10:32:41  来源:中国IT实验室

通过以下方法可以把Autotrace的权限授予Everyone,如果你需要限制Autotrace权限,可以把对public的授权改为对特定user的授权。

通过以下方法可以把Autotrace的权限授予Everyone,如果你需要限制Autotrace权限,可以把对public的授权改为对特定user的授权。

D:\oracle\ora92>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]@?\rdbms\admin\utlxplan[/b]

表已创建。

SQL> create public synonym plan_table for plan_table;

同义词已创建。

SQL> grant all on plan_table to public ;

授权成功。

SQL>[b] @?\sqlplus\admin\plustrce[/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;

[责任编辑:梧桐]热门关键词: Oracle SQL