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 -> Re: Role problem: Why doesn't this work?

Re: Role problem: Why doesn't this work?

From: Doug <dcowles_at_i84.net>
Date: Fri, 08 Dec 2000 23:17:56 -0500
Message-ID: <pic33t0bora5v98btccledu7mv9e9mrghu@4ax.com>

This should work fine...Here's an actual session from personal oracle 7... comments of mine preceeded with "---"

SQL> connect demo/demo;
Connected.
SQL> select * from user_tab_privs where table_name = 'LOCATION';

no rows selected

SQL> connect system/system
Connected.
SQL> create public synonym testsynonym for demo.location;

Synonym created.

SQL> connect scott/tiger;
Connected.
SQL> select * from testsynonym;
select * from testsynonym

              *
ERROR at line 1:
ORA-00942: table or view does not exist

SQL> connect system/system;
Connected.
SQL> create role testrole;

Role created.

SQL> connect demo/demo
Connected.
SQL> grant select on location to testrole;

Grant succeeded.

SQL> connect system/system
Connected.
SQL> grant testrole to public;

Grant succeeded.

SQL> connect scott/tiger
Connected.
SQL> select * from testsynonym;

LOCATION_ID REGIONAL_GROUP

----------- --------------------
        122 NEW YORK
        124 DALLAS
        123 CHICAGO
        167 BOSTON

SQL> ---
On Fri, 08 Dec 2000 21:31:15 -0600, Douglas Scott <dsscott_at_ev1.net> wrote:

>I created some public synonyms to some tables in a particular schema. I
>created a role and granted table privileges (select, insert, update &
>delete) on those tables to the role. I then granted the role to
>PUBLIC. When I log into SQL*Plus as a different user from the schema
>with the tables I cannot execute any SQLs against any of the tables.
>Can anyone tell me why this doesn't work?
>
>Douglas Scott

"If everything feels like it's under control, you're probably not going fast enough" - Mario Andretti Received on Fri Dec 08 2000 - 22:17:56 CST

Original text of this message

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