Home » RDBMS Server » Server Administration » Grant Select rights (Oracle 12c Win 2008)
Grant Select rights [message #684304] Wed, 05 May 2021 09:08 Go to next message
Linou14
Messages: 1
Registered: May 2021
Junior Member
Hello,

We need to grant Select rights to schema2 all objects belongs to schema1 also the future objects.

there is possible please ?

Thank you

Best Regards,
Re: Grant Select rights [message #684305 is a reply to message #684304] Wed, 05 May 2021 11:12 Go to previous messageGo to next message
Michel Cadot
Messages: 67988
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

https://www.dba-village.com/village/dvp_forum.OpenThread?ThreadIdA=69083
https://www.dba-village.com/village/dvp_scripts.ScriptDetails?ScriptIdA=5888

Cross-ref:
https://www.dba-village.com/village/dvp_forum.OpenThread?ThreadIdA=96126&SkipA=0

Re: Grant Select rights [message #684306 is a reply to message #684304] Wed, 05 May 2021 15:20 Go to previous message
EdStevens
Messages: 1344
Registered: September 2013
Senior Member
As detailed in the links provided by Michael, you cannot grant a privilege on an object that does not exist. The proper approach is to create a ROLE, grant the privs to the ROLE, then grant the role to the users. When a new table is created, grant privs on the table to the role as part of the rollout process for the new table.

create role business_user_role;
grant select on app_schema.table_a to business_user_role;
grant select on app_schema.table_b to business_user_role;
--
grant business_user_role to bob;
grant business_user_role to carol;
grant business_user_role to ted;
grant business_user_role to alice;
then later:
create table app_schema.table_c
   (col_a varchar2(10)
    );
grant select on table app_schema.table_c to business_user_role;
Previous Topic: ORA-01918: user 'HR' does not exist
Next Topic: VARCHAR2 Stored in DB in Terms of Bytes
Goto Forum:
  


Current Time: Sat Oct 16 00:49:57 CDT 2021