| synonyms [message #635068] |
Thu, 19 March 2015 13:24  |
kilimanjaro
Messages: 151 Registered: May 2009 Location: Tanzania
|
Senior Member |
|
|
Hello Buddies
Please assist
I have one user called CMX and he owns 1000+ tables.He is the main user of the system.
My question is, when I create additional user of the system I must either create table views or synonyms.
If its synonyms, is the a way of granting access to all CMX tables to additional user in a single line?
like 'create public synonyms for cmx all tables????'
Thank you in Advance.
|
|
|
|
|
|
| Re: synonyms [message #635072 is a reply to message #635071] |
Thu, 19 March 2015 13:56   |
kilimanjaro
Messages: 151 Registered: May 2009 Location: Tanzania
|
Senior Member |
|
|
Thank you Michel
In my case, Assume the main user CMX has two tables. employee and salaries
so when new user KENGE comes what do I do? log in as CMX then
create public synonym for employee ;
create public synonym for salaries ;??
Thank you.
|
|
|
|
|
|
|
|
|
|
| Re: synonyms [message #635085 is a reply to message #635076] |
Fri, 20 March 2015 01:52   |
kilimanjaro
Messages: 151 Registered: May 2009 Location: Tanzania
|
Senior Member |
|
|
Thank you all
Final piece please
Do I log in as system or the object owner?
eg CMX when granting kenge some previleges?
|
|
|
|
|
|
|
|
| Re: synonyms [message #635098 is a reply to message #635076] |
Fri, 20 March 2015 06:45   |
gazzag
Messages: 1119 Registered: November 2010 Location: Bedwas, UK
|
Senior Member |
|
|
GRANT SELECT ON cmx.employee TO cmx_access;
GRANT SELECT ON cmx.salaries TO cmx_access;
|
|
|
|
| Re: synonyms [message #635125 is a reply to message #635098] |
Sat, 21 March 2015 06:09   |
kilimanjaro
Messages: 151 Registered: May 2009 Location: Tanzania
|
Senior Member |
|
|
Hello Michel,
Thank you for you help,though it's a bit confusing due to the results I got.These are the steps I followed.
Log in as system and GRANT CREATE SYNONYM TO CMX;
log in as CMX and CREATE ROLE cmx_access;
log in as kenge and CREATE PUBLIC SYNONYM employee FOR cmx.employee;
log in as CMX and GRANT SELECT ON employee TO cmx_access;
log in as CMX and GRANT cmx_access TO kenge;
Is this what I should do?
If so? what is the use of the role here?because Kenge can still delete and update table instead of only select.
Thank you.
|
|
|
|
| Re: synonyms [message #635126 is a reply to message #635125] |
Sat, 21 March 2015 08:04   |
 |
EdStevens
Messages: 1377 Registered: September 2013
|
Senior Member |
|
|
kilimanjaro wrote on Sat, 21 March 2015 06:09Hello Michel,
Thank you for you help,though it's a bit confusing due to the results I got.These are the steps I followed.
Log in as system and GRANT CREATE SYNONYM TO CMX;
No. That is a security hole. Creating synonyms is the job of the DBA.
Quote:log in as CMX and CREATE ROLE cmx_access;
No. creating roles is the job of the dba
Quote:log in as kenge and CREATE PUBLIC SYNONYM employee FOR cmx.employee;
No. creating synonyms is the job of the dba. Besides, you didn't even grant that privlige to kenge, you granted it to CMX.
Quote:log in as CMX and GRANT SELECT ON employee TO cmx_access;
possibly, but better to be done by a DBA
Quote:log in as CMX and GRANT cmx_access TO kenge;
No, that should be done by a dba
Quote:Is this what I should do?
If so? what is the use of the role here?because Kenge can still delete and update table instead of only select.
We don't know what else you've granted to who by who.
No.
First you should have your own account, with the role DBA granted to it
- conn / as sysdba
- sql> create user estevens .....
- sql> grant dba to estevens
- conn estevens/pwd (all following actions taken by estevens, a DBA
sql> create role cmx_access;
sql> CREATE PUBLIC SYNONYM employee FOR cmx.employee;
sql> GRANT SELECT ON cmx.employee TO cmx_access;
sql> GRANT cmx_access TO kenge;
[EDITED by LF: fixed some invalid tags]
[Updated on: Sat, 21 March 2015 09:16] by Moderator Report message to a moderator
|
|
|
|
|
|
| Re: synonyms [message #635132 is a reply to message #635129] |
Sun, 22 March 2015 07:37  |
 |
EdStevens
Messages: 1377 Registered: September 2013
|
Senior Member |
|
|
kilimanjaro wrote on Sat, 21 March 2015 12:36Thank you very much EdStevens. It has worked.
Good.
Now, what did you learn from this? I'm much more interested in helping people increase their understanding of how things work and why we do what we do. I'm not interested in just handing someone code for them to just blindly execute to get past their immediate problem.
|
|
|
|