Taken from Oracle article:
Doc ID: Note:1055431.6
Subject: ORA-01919 Using AUTOTRACE in SQL*Plus
Type: PROBLEM
Status: PUBLISHED
Content Type: TEXT/PLAIN
Creation Date: 22-JUL-1998
Last Revision Date: 08-FEB-2002
Problem Description:
====================
You were trying to use the AUTOTRACE feature of SQL*Plus and you received the following error message: ORA-01919: role 'PLUSTRACE' does not exist
Solution Description:
=====================
AUTOTRACE configuration is required. Perform the following steps to configure the user for AUTOTRACE:
1. connect sys/change_on_install @$ORACLE_HOME/sqlplus/admin/plustrce.sql
grant plustrace to username;
2. connect username/password @$ORACLE_HOME/rdbms/admin/utlxplan.sql
set autotrace (run sql statement)
Refer to [NOTE:43214.1] for AUTOTRACE options.
To use the AUTOTRACE feature of SQL*Plus, the user must have a PLAN_TABLE in the schema and have PLUSTRACE role granted.
1. Both the PLAN_TABLE table and PLUSTRACE role is missing. SQL> set autotrace on
Unable to verify PLAN_TABLE format or existence
Error enabling EXPLAIN report
Cannot find the Session Identifier.
Check PLUSTRACE role is enabled
Error enabling STATISTICS report
SQL> select count(*) from user_tables where table_name = 'PLAN_TABLE'; COUNT(*) -------- 0
> Conclusion: PLAN_TABLE does not exist in user's schema.
> Action: Create PLAN_TABLE.
2. Build the PLAN_TABLE (PLUSTRACE role still not granted)
SQL> @$ORACLE_HOME/rdbms/admin/utlxplan.sql
Table created.
SQL> set autotrace on
Cannot find the Session Identifier.
Check PLUSTRACE role is enabled
Error enabling STATISTICS report
SQL> select granted_role from user_role_privs; GRANTED_ROLE
------------
CONNECT
RESOURCE
> Conclusion: PLUSTRACE role not granted to user.
> Action: Grant role to user.
3. Attempt to grant PLUSTRACE role to user
SQL> connect sys/change_on_install
Connected.
SQL> grant PLUSTRACE to cagray;
grant PLUSTRACE to cagray
* ERROR at line 1: ORA-01919: role 'PLUSTRACE' does not exist
>Conclusion: PLUSTRACE role has not been created.
>Action: Run plustrce.sql as sys, then grant role to user.
4. Create the PLUSTRACE role and grant to user.
SQL> @$ORACLE_HOME/sqlplus/admin/plustrce.sql
SQL> grant plustrace to cagray;
Grant succeeded.
Solution
SQL> connect cagray/cagray
SQL> select granted_role from user_role_privs; GRANTED_ROLE
------------
CONNECT
PLUSTRACE
RESOURCE
SQL> set autotrace on explain;
SQL> select count(*) from plan_table;
COUNT(*)
--------
0
Execution Plan
-----------------------------------------------
0
SELECT STATEMENT Optimizer=CHOOSE 1 0 SORT (AGGREGATE) 2 1 TABLE ACCESS (FULL) OF 'PLAN_TABLE'
>Conclusion: AUTOTRACE now working
Explanation:
============
If the user is not correctly configured to use the AUTOTRACE, one of the following situations will occur:
SQL> set autotrace on
Unable to verify PLAN_TABLE format or existence
Error enabling EXPLAIN report
Cannot find the Session Identifier.
Check PLUSTRACE role is enabled
Error enabling STATISTICS report
SQL> set autotrace on
Cannot find the Session Identifier.
Check PLUSTRACE role is enabled
Error enabling STATISTICS report
A PLAN_TABLE table must exist in schema and PLUSTRACE role granted before AUTOTRACE usage.
--------------------------------------------------------------------------------
Copyright (c) 1995,2000 Oracle Corporation. All Rights Reserved. Legal Notices and Terms of Use.