-1

How to grant read and create Views privilege to a role?

Here are the steps I've done:

  1. Grant statement to the role "CUSTOM_ROLE":

    GRANT SELECT ON MY_VIEW_1 to CUSTOM_ROLE;

  2. Assign the role to a user id:

    GRANT CUSTOM_ROLE TO USERID_123;

Error:

01924. 00000 -  "role '%s' not granted or does not exist"

*Cause:    Either the role was not granted to the user, or the role did not exist.

*Action:   Create the role or grant the role to the user and retry
           the operation.

Please kindly help. Thank you.

Jemru
  • 2,091
  • 16
  • 39
  • 52

1 Answers1

1

Create the role prior granting to it. The message says the role doesn't exist.

I would suggest You to check existence of the role using:

  select role from dba_roles where role = 'CUSTOM_ROLE';

If this query won't return any rows then use

 CREATE ROLE custom_role;

to create it.

See this:

https://www.techonthenet.com/oracle/roles.php

For details

pmi
  • 341
  • 3
  • 6