SP2-0618: Cannot find the Session Identifier.Check PLUSTRACE role is enablesql
之前一直用SYS用戶使用autotrace,今天用其它用戶使用autotrace來得到執行計劃報以下錯誤數據庫
SQL> set autotrace onide
SP2-0618: Cannot find the Session Identifier.Check PLUSTRACE role is enabledspa
SP2-0611: Error enabling STATISTICS reporget
第一反應是授予用用戶plustrace角色it
SQL> conn / as sysdbaio
Connected.class
SQL>grant plustrace to oak;im
grant plustrace to oak數據
*
ERROR at line 1:
ORA-01919: role 'PLUSTRACE' does not exist
報角色不存在錯誤
plustrace角色在數據庫建立時並不會建立
這個角色可經過運行下面的sql來建立
$ORACLE_HOME/sqlplus/admin/plustrce.sql
授予用戶plustrace角色
SQL> grant plustrace to oak;
Grant succeeded.
啓用autotrace
SQL> set autotrace on
至此問題解決