Grant References to Role ? [message #393712] |
Tue, 24 March 2009 02:39  |
rushimails
Messages: 24 Registered: November 2008 Location: Mumbai
|
Junior Member |
|
|
Hi
Is it possible to give GRANT REFERENCES to a Role and then associate this Roles to sub Schemas.
e.g I have schemas APPS , MMS, ADMIN
I have certain/ALL tables in ADMIN Schema which have referential constraints in MMS Schema.
e.g Company Master (CompCD) in ADMIN Schema as Foreign Key in MMS schema for say Item Master.
So every time I make Table in ADMIN I have to give
GRANT REFERENCES ON << TABLE NAME>> TO MMS;
Instead can I make a Role give grant REFERENCES to this ROLE and associate this role to MMS.
So everytime I dont have to grant REFERENCES on all Objects.
Rgds
Rushi
|
|
|
|
|
|
Re: Grant References to Role ? [message #393729 is a reply to message #393723] |
Tue, 24 March 2009 03:21   |
rushimails
Messages: 24 Registered: November 2008 Location: Mumbai
|
Junior Member |
|
|
Yes I did but with following error :
SQL> CONNECT SYSTEM/xxxxx@xxx
Connected.
SQL> CREATE ROLE ROLE_ADMIN_REF2ALL;
Role created.
SQL> GRANT REFERENCES TO ROLE_ADMIN_REF2ALL;
GRANT REFERENCES TO ROLE_ADMIN_REF2ALL
*
ERROR at line 1:
ORA-01919: role 'REFERENCES' does not exist
|
|
|
|
|
|
|
Re: Grant References to Role ? [message #393761 is a reply to message #393748] |
Tue, 24 March 2009 05:19   |
 |
Michel Cadot
Messages: 68767 Registered: March 2007 Location: Saint-Maur, France, https...
|
Senior Member Account Moderator |
|
|
Oracle version?
- Never ever use SYS but for maintenance purpose (startup, shutdown, backup, recover)
- SYS is special
- SYS is Oracle proprietary (try to open a SR/TAR starting with "i did that with SYS" and you'll see the immediate answer)
- SYS does not act like any other user
- When you use SYS Oracle deactivates some code path and activates others
- Whatever you do with SYS will neither validate nor invalidate the same thing with any other user.
NEVER EVER use SYS for anything that can be done by another user.
Use SYS ONLY for something that can't be done by someone else.
Regards
Michel
[Updated on: Tue, 24 March 2009 05:21] Report message to a moderator
|
|
|
|
|
|
|
Re: Grant References to Role ? [message #393778 is a reply to message #393773] |
Tue, 24 March 2009 05:47  |
 |
Michel Cadot
Messages: 68767 Registered: March 2007 Location: Saint-Maur, France, https...
|
Senior Member Account Moderator |
|
|
Quote: | To Single Object we definately can ,
|
I disagree, see my previous example.
In addition, to show you that what seems to "work" with SYS does not:
SYS> grant references on michel.t to r;
Grant succeeded.
SYS> revoke references on michel.t from r;
revoke references on michel.t from r
*
ERROR at line 1:
ORA-01927: cannot REVOKE privileges you did not grant
SYS> select * from dba_tab_privs where table_name='T' and owner='MICHEL';
no rows selected
Refer to what I said about SYS.
Quote: | I was wondering somehting to the User/Schema itslef without Identifying individual Tables/Objects in the User/Schema.
|
No.
Regards
Michel
|
|
|