Chinaunix首页 | 论坛 | 博客
  • 博客访问: 641296
  • 博文数量: 70
  • 博客积分: 145
  • 博客等级: 入伍新兵
  • 技术积分: 1150
  • 用 户 组: 普通用户
  • 注册时间: 2012-10-11 08:15
个人简介

没有简介就是最好的简介

文章分类

全部博文(70)

文章存档

2020年(1)

2018年(2)

2017年(3)

2016年(11)

2015年(12)

2014年(16)

2013年(19)

2012年(6)

我的朋友

分类: Oracle

2014-06-20 09:44:45

SQL> set autotrace traceonly statistics
SP2-0618: Cannot find the Session Identifier.  Check PLUSTRACE role is enabled
SP2-0611: Error enabling STATISTICS report
原因是因为system用户给scott做了授权,

最简单的解决办法:用sys用户重新授权一下:

SQL> @?/sqlplus/admin/plustrce

SQL>
SQL> drop role plustrace;

Role dropped.

SQL> create role plustrace;

Role created.

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

Grant succeeded.

SQL> grant select on v_$statname to plustrace;

Grant succeeded.

SQL> grant select on v_$mystat to plustrace;

Grant succeeded.

SQL> grant plustrace to dba with admin option;

Grant succeeded.

SQL>
SQL> set echo off
SQL> grant plustrace to scott;

Grant succeeded.

SQL> set autot on

重新使用scott用户登录则正常开启

SQL> set autotrace traceonly statistics

阅读(1532) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~