Forrest
Forrest

Reputation: 731

GRANT Privilege In SQL

Fast :

GRANT SELECT ON SYSTEM.* TO appadmin;

I want to grant AppAdmin the rights of SELECT on all tables of the database

I'm using Oracle SQL, why does my statement not work ?

Upvotes: 0

Views: 560

Answers (2)

Mohamed El-Touny
Mohamed El-Touny

Reputation: 347

Using the ANY keyword in reference to a system privilege means that the user can perform the privilege on any objects owned by any user except for SYS. By default, if you are granted a privilege, you cannot assign your privilege to others. You cannot grant or revoke that privilege to or from anyone else.

Sometimes you want to grant privileges to users and have them be able to grant those privileges to other users. When this is the case, we include the with admin keyword in the grant command. When this keyword is used, it will allow the user granted the privilege to grant that privilege to other users.

Here is an example of the usage of the with admin option keyword.

GRANT SELECT ANY TABLE TO User;

Upvotes: 1

Tedezed
Tedezed

Reputation: 431

GRANT SELECT ANY TABLE TO YOUR_USER;

Upvotes: 0

Related Questions