When a normal user opens Autotrace report in Sql*plus, he encounters Sp2-0618:cannot find the Session Identifier. Check plustrace role is enabled error. As shown below:
Sql>
Sql> set autotrace on;
Sp2-0618:cannot find the Session Identifier. Check plustrace role is enabled
Sp2-0611:error Enabling STATISTICS Report
Sql>
At this point, you should check that the database has created the role Plustrace, using the following script to check if the role Plustrace exists.
SELECT * from Dba_roles WHERE role= ' Plustrace '
If the role does not exist, you should go to the $oracle_home/sqlplus/admin/directory and you will find the Plustrce.sql script file.
[[Email protected] ~]$ CD $ORACLE _home/sqlplus/admin/
Admin] $ ls
Glogin. SQL help Iplus libisqlplus.def libsqlplus.def Plustrce. SQL pupbld. SQL
Admin] $ more plustrce. SQL
--
--Copyright (c) Oracle Corporation 1995, 2002. All rights Reserved.
--
--NAME
--Plustrce. SQL
--
--DESCRIPTION
role with to Dynamic Performance Tables
for SQL SET STATISTICS command.
After each User to
role by
-The DBA.
--
--USAGE
as SYSDBA "@plustrce
--
--Catalog.sql must has been run before this file is run.
file while to schema.
Set on
Drop role Plustrace;
Create role Plustrace;
Grant Select on to Plustrace;
Grant Select on to Plustrace;
Grant Select on to Plustrace;
Grant to with Admin option;
Set echo off
Executing the script creates the role Plustrace, as shown below. You can then grant the role to the corresponding user.
Creating Plustrace roles in a sql*plus environment