时间:2021-07-01 10:21:17 帮助过:32人阅读
今天是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>