oracle autotrace problem

来源:互联网 发布:通达oa移植linux 编辑:程序博客网 时间:2024/05/18 17:44

问题描述:

   SP2-0618: Cannot find the Session Identifier. Check PLUSTRACE role is enabled
  SP2-0611: Error enabling STATISTICS report

 

解决方法:

  SQL> connect / as sysdba

  SQL> @$ORACLE_HOME/rdbms/admin/utlxplan.sql
  Table created.
  SQL> create public synonym plan_table for plan_table;
  Synonym created.
  SQL> grant select,update,insert,delete on plan_table to public;
  Grant succeeded.
  SQL> @$ORACLE_HOME/sqlplus/admin/plustrce.sql
  SQL>grant plustrace to public.
  SQL>SET AUTOTRACE ON
  如果是解决sysdba用户的AUTOTRACE问题,做以上工作就可以了。如果是其他用户,要做下面操作(所有操作都是在sysdba用户下完成)
  drop role plustrace;
  create role plustrace;
  grant select on v_$sesstat to plustrace;
  grant select on v_$statname to plustrace;
  grant select on v_$mystat to plustrace;
  grant select on v_$session to plustrace;
  grant plustrace to yyl with admin option;
  其中yyl代表你需要打开autotrace工具的用户

原创粉丝点击