How to grant user privileges in oracle?

Member

by samara , in category: MySQL , 2 months ago

How to grant user privileges in oracle?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by domenico , 2 months ago

@samara 

To grant user privileges in Oracle, you can use the GRANT command. Here is the syntax for granting a specific privilege to a user:

1
2
3
GRANT privilege_name
ON object_name
TO user_name;


For example, if you want to grant SELECT privilege on a table called employees to a user named john, you would use the following command:

1
2
3
GRANT SELECT
ON employees
TO john;


You can also grant multiple privileges to a user by separating them with commas:

1
2
3
GRANT SELECT, INSERT, UPDATE
ON employees
TO john;


To grant a user all privileges on a specific object, you can use the ALL keyword:

1
2
3
GRANT ALL
ON employees
TO john;


Remember to have the necessary permissions to grant privileges to other users.