SP2-0618: Cannot find the Session Identifier. Check PLUSTRACE role is enabled

平常都用sys,system用戶使用autotrace,今天使用其他用戶執行set autotrace 的時候報錯:
SP2-0618: Cannot find the Session Identifier.  Check PLUSTRACE role is enabled
SP2-0611: Error enabling STATISTICS report

是該用戶沒有授予PLUSTRACE這個角色的權限。
SYS AS SYSDBA@oemrep>grant PLUSTRACE to test2;
grant PLUSTRACE to test2
      *
ERROR at line 1:
ORA-01919: role 'PLUSTRACE' does not exist

授權發現PLUSTRACE角色不存在,查看官方文檔後執行以下sql
SYS AS SYSDBA@oemrep>@$ORACLE_HOME/sqlplus/admin/plustrce.sql
SYS AS SYSDBA@oemrep>
SYS AS SYSDBA@oemrep>drop role plustrace;
drop role plustrace
          *
ERROR at line 1:
ORA-01919: role 'PLUSTRACE' does not exist

SYS AS SYSDBA@oemrep>create role plustrace;

Role created.
SYS AS SYSDBA@oemrep>
SYS AS SYSDBA@oemrep>grant select on v_$sesstat to plustrace;

Grant succeeded.
SYS AS SYSDBA@oemrep>grant select on v_$statname to plustrace;

Grant succeeded.
SYS AS SYSDBA@oemrep>grant select on v_$mystat to plustrace;

Grant succeeded.
SYS AS SYSDBA@oemrep>grant plustrace to dba with admin option;

Grant succeeded.
SYS AS SYSDBA@oemrep>grant PLUSTRACE to test2;

Grant succeeded.

至此,問題解決。

 

發佈了34 篇原創文章 · 獲贊 26 · 訪問量 9萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章