欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  数据库

SP2-0611:ErrorenablingSTATISTICSreport

程序员文章站 2022-04-01 08:21:37
...

今天是2014-01-08,在开启autotrace的时候报如下错误,解决过程如下: SQL conn scott/root Connected. SQL SQL SQL set autotrace trace statistics Error ORA-942 while gathering statistics SP2-0611: Error enabling STATISTICS report SQL SQL SQL set

今天是2014-01-08,在开启autotrace的时候报如下错误,解决过程如下:

SQL> conn scott/root
Connected.
SQL>
SQL>
SQL> set autotrace trace statistics
Error ORA-942 while gathering statistics
SP2-0611: Error enabling STATISTICS report
SQL>
SQL>
SQL> set autotrace
Usage: SET AUTOT[RACE] {OFF | ON | TRACE[ONLY]} [EXP[LAIN]] [STAT[ISTICS]]
SQL> set autotrace trace
Error ORA-942 while gathering statistics
SP2-0611: Error enabling STATISTICS report
SQL> conn sys/root as sysdba
Connected.
SQL>
SQL>
SQL> !oerr ora 942
00942, 00000, "table or view does not exist"
// *Cause:
// *Action:

SQL> grant select on v_$sesstat to scott;
g
Grant succeeded.

SQL> rant select on v_$statname to scott;

Grant succeeded.

SQL> grant select on v_$mystat to scott;

Grant succeeded.

SQL>
SQL>
SQL> conn scott/root
Connected.
SQL>
SQL>
SQL> set autotrace trace
SQL>