Oracle GRANT ROLE error [closed]

Posted on

Question :

I am trying to apply a role to a user and getting this error: SQL Error: ORA-00990: missing or invalid privilege. Here is where I created the role, which worked fine logged in as SYSTEM.

    CREATE ROLE LahmanDBDev;
    GRANT CREATE SESSION TO LahmanDBDev;
    GRANT CREATE TABLE TO LahmanDBDev;
    GRANT CREATE TABLESPACE TO LahmanDBDev;
    GRANT CREATE VIEW TO LahmanDBDev;
    GRANT CREATE ANY INDEX TO LahmanDBDev;
    GRANT CREATE SEQUENCE TO LahmanDBDev;
    GRANT CREATE SYNONYM TO LahmanDBDev;
    GRANT SELECT ON BASEBALL.MASTER TO LahmanDBDev;
    GRANT SELECT ON BASEBALL.BATTING TO LahmanDBDev;
    GRANT SELECT ON BASEBALL.FIELDING TO LahmanDBDev;

Then I went on to create the user and grant the role to it, the second statement here where I grant the role is where I get the error:

    CREATE USER BudSelig
    IDENTIFIED BY BudSelig;

    GRANT ROLE LahmanDBDev
    TO BudSelig;

Answer :

The correct syntax is:

   GRANT LahmanDBDev
   TO BudSelig;

Leave a Reply

Your email address will not be published.