Oracle SQL create view privileges

Posted on

Question :

This is more of a theoritical question but I need help ASAP. Here it is:

With the appropriate use of SQL queries, grant as system
administrators the required access privileges to a database user named
STD01, so he can create a view of a table named CUSTOMER, which
belongs to another database user STD00.

Can anyone help me with this?

I know that I have to grant him with the system privilege of CREATE (ANY) VIEW and also give him all the object privileges (SELECT, INSERT, UPDATE & DELETE) on the CUSTOMER table, but I have no idea how can I do that by using SQL…

Answer :

To grant privilege to create a view:

GRANT CREATE VIEW TO STD01;

To grant the DML privileges:

GRANT SELECT,UPDATE,INSERT,DELETE ON STD00.CUSTOMER TO STD01;

But that’s not all of the object privileges. If you did:

GRANT ALL ON STD00.CUSTOMER TO STD01;

you would also give other privileges such as ALTER, INDEX, FLASHBACK, etc.

Leave a Reply

Your email address will not be published. Required fields are marked *