I want to grant select privilege to a particular user in Oracle. Its possible in mysql with following query
GRANT SELECT, INSERT, DELETE ON database TO username@'localhost' IDENTIFIED
BY 'password';
Is there any way we can achieve this in Oracle ?
What MySQL calls a “database” is more similar to what Oracle calls a “schema”. Oracle does not have the ability to grant privileges on all objects in a schema to a particular user, you have to grant the privileges on each object individually. You can use a bit of dynamic SQL to simplify the initial grant
Every time you create a new object in the schema, though, you’ll need to either grant the same privileges on the new object to the user or you’ll need to re-run the PL/SQL block above. If you really want to, a DDL trigger could submit a job that would grant the privileges automatically when new objects are created but that is not particularly recommended.
From a managability perspective, you would generally create a role that would be assigned all these privileges and then assign that role to whatever set of users actually need those DML privileges. That allows you to easily assign the same role to everyone in the organization that needs the same set of privileges rather than managing privileges on
nobjects formusers.