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: More Newbie questions...

Re: More Newbie questions...

From: Kelly Reagan <KAMReagan_at_aol.com>
Date: Sun, 18 Aug 2002 02:44:01 GMT
Message-ID: <RRD79.7697$Fl.565491@nnrp1.ptd.net>


The easiest way is using synonyms, as stated by the other responders.

Will you be accessing theuser's objects from other accounts? Have you granted select on the tables to the appropriate users (or to a role they all have) so they can see them?

For example, if you have theuser as the owner of the objects, and three accounts (thatuser1, thatuser2, and thatuser3), you will need to either:

grant select on table1 to thatuser1;
grant select on table1 to thatuser2;
grant select on table1 to thatuser3;

for each table, or

grant select on table1 to commonrole;

Each user will need to use:

select * from theuser.table1;

to get to the information.

If you use synonyms, thatuser1, thatuser2, and thatuser3 will EACH have to create a synonym intheir schemas as follows:

create synonym table1 for theuser.table1; [or is it table1 *on* the?]

If you use a priviledged account, you can create a single public synonym that all of the users can use:

create public synonym table1 for theuser.table1;

This synonym will exist for all users, so no other synonyms need to be created. Of course, if you have duplicate table names in multiple schemas, the concept of a public synonym doesn't work.

Matt...

abc_at_iom.com wrote:

> Can you use some setting that will cause Oracle to reference a default
> user?
>
> New to oracle here. Question:
>
> I have a number of tables associated with a user that I've created in
> the database (for this example, let's assume the user is called
> "theuser"). To do a simple select statement, I have to type:
>
> SELECT NAME, .ADDRESS,.PHONE from theuser.PHONEBOOK
>
> Is there a way where I don't have to keep typing "theuser" before
> every object I reference? In otherwords, is there a setting that will
> make Oracle assume I mean "theuser" ?
>
> In a simple select statement, it's not a big deal, but more complex
> ones make for lots of redundant typing.
Received on Sat Aug 17 2002 - 21:44:01 CDT

Original text of this message

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