Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Oracle - grant privileges to all users

Tags:

I need to grant privileges to all users, I can do:

GRANT select on table TO user1; GRANT select on table TO user2; ... 

But there are many users. How can I grant this privilege to all users at once?

I tried:

GRANT select on table TO ALL; 

But that doesn't work.

like image 848
Richard Knop Avatar asked Oct 29 '09 13:10

Richard Knop


People also ask

How do I grant privileges to all users in SQL?

To GRANT ALL privileges to a user , allowing that user full control over a specific database , use the following syntax: mysql> GRANT ALL PRIVILEGES ON database_name.

What is grant all privileges in Oracle?

Use the ALL PRIVILEGES privilege type to grant all of the privileges to the user or role for the specified table. You can also grant one or more table privileges by specifying a privilege-list. Use the DELETE privilege type to grant permission to delete rows from the specified table.

Which SQL statement grants a privilege to all the database users?

You can use the SQL GRANT statement to grant SQL SELECT, UPDATE, INSERT, DELETE, and other privileges on tables or views. The WITH GRANT OPTION clause indicates that JONES can grant to other users any of the SQL privileges you granted for the ORDER_BACKLOG table.

Who can grant system privileges in Oracle?

In general, you grant system privileges only to administrative personnel and application developers. End users normally do not require and should not have the associated capabilities. See Also: For more information about Database Control, see Oracle Database 2 Day DBA.


2 Answers

grant select on table to public; 

But be careful when you do that -- make sure it's what you really want to do.

like image 50
Jim Hudson Avatar answered Oct 06 '22 22:10

Jim Hudson


You should use roles. Grant permission to roles. grant roles to users.

like image 31
Dani Avatar answered Oct 07 '22 00:10

Dani