Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Roles and Private Synonyms

Roles and Private Synonyms

From: Stephen Walsh <stevew_at_helix.com.au>
Date: 1997/07/09
Message-ID: <33C2ED4F.6B1D@helix.com.au>#1/1

I'm having a little difficulty finding information regarding how Oracle manages roles and private synonyms. My problem is as follows:

I do not have any public synonyms defined.

In a single Oracle Instance I have 2 schemas of the same database for separate use of a single application, eg. once machine maintenance and ones property maintenance:

	machine
	property

You create roles as follows, for example:

   create role machine_general;
   grant select,update,delete,insert on machine.table1 to machine_general;

   grant select,update,delete,insert on machine.table2 to machine_general;

   create role property_general;
   grant select,update,delete,insert on property.table1 to property_general;

   grant select,update,delete,insert on property.table2 to property_general;

   And then you create private synonyms for your application access as follows:

   	create synonym table1 for machine.table1;
   	create synonym table2 for machine.table2;

   	create synonym table1 for property.table1;
   	create synonym table2 for property.table2;

Questions:

  1. If you grant the privilege to the base object in a role, eg. machine.table1, does the synonym inheirit the same privileges??
  2. If a user "user1" has been granted the following roles: grant machine_general to user1; grant property_general to user1;

   I assume that, if the user starts the application against the machine schema,

   then the synonyms defined for the machine schema are used because they are

   private to the machine schema eventhough the synonym names are the same in each

   schema. Is this correct?? My assumption is based on Oracle trying to resolve access at the schema level first, then moving up the chain.

3. In addition to question 2, if the public synonym has not been defined then an access violation should be generated. Is this correct??

TIA
regards
Stephen

-- 

===========================================
Stephen Walsh Helix Systems Pty Ltd Ph: +61 7 3846 1999 Fax: +61 7 3846 2122 Email: stevew_at_helix.com.au Web: http://www.helix.com.au/
===========================================
Received on Wed Jul 09 1997 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US