Skip to content

How to Resolve ORA-01919: role does not exist

  • by

ORA-01919

ORA-01919 means that Oracle cannot find any privilege you specified, so it turned to search for the name in roles, but still no luck.

Let's see some error patterns.

1. Invalid Privilege

Tried to grant a privilege to an user, but it failed with ORA-01919.

SQL> grant create_table to hr;
grant create_table to hr
      *
ERROR at line 1:
ORA-01919: role 'CREATE_TABLE' does not exist

In other words, the privilege you specified in the statement is neither a valid privilege, nor a valid role.

2. PLUSTRACE

For some cases, you might think the privilege or role is valid. We take PLUSTRACE as an example.

SQL> grant plustrace to hr;
grant plustrace to hr
      *
ERROR at line 1:
ORA-01919: role 'PLUSTRACE' does not exist

Yes, PLUSTRACE is a valid role in Oracle database, but it needs to be installed!

Solution

1. Invalid Privilege

You should specify a valid privilege or valid role for the statement. In this case, we should use CREATE TABLE, not CREATE_TABLE.

SQL> grant create table to hr;

Grant succeeded.

2. PLUSTRACE

To create PLUSTRACE role, just execute $ORACLE_HOME/sqlplus/admin/plustrce.sqlby SYS.

To correctly grant privileges, we have some examples.

Leave a Reply

Your email address will not be published.