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: [Q] create second schema under a account

Re: [Q] create second schema under a account

From: Serge Rielau <srielau_at_ca.ibm.com>
Date: Thu, 30 Dec 2004 09:31:51 -0500
Message-ID: <33ihq2F3vm9q6U1@individual.net>


Howard J. Rogers wrote:
> Serge Rielau wrote:
>

>> Howard J. Rogers wrote:
>>
>>> aaa wrote:
>>>
>>>> we have ORACLE 9.2.0.6 on UNIX server.  I know ORACLE support 
>>>> multiple schemas
>>>> under a user account.
>>>
>>>
>>>
>>>
>>> You know wrongly, I am afraid. Since a user more or less *is* a 
>>> schema (and vice versa), then what you say you know to be the case 
>>> cannot possibly be true.
>>>
>>>>  Does any know how to do following and give me a sample:
>>>>
>>>>    1. create second schema under a user
>>>
>>>
>>>
>>>
>>> Impossible, taking what you ask for at face value.
>>>
>>>>    2. create table or view under second schema
>>>
>>>
>>>
>>>
>>> This is do-able. Any user, provided they have been granted an 'ANY' 
>>> privilege (for example, 'create any table') can exercise that 
>>> privilege in anybody else's schema. So for example, I could do this:
>>>
>>> connect scott/tiger
>>> create table elmer.employees (col1 char(4));
>>>
>>> ...and the EMPLOYEES table has just been created in ELMER's schema. 
>>> The table belongs to Elmer, and Elmer is forever afterwards 
>>> considered its owner. But it was actually created by someone else. Is 
>>> that what you are after?
>>>
>>> If not, then you're going to be disappointed! :-)
>>>
>>> Regards
>>> HJR
>>
>>
>> Given that user management is part of Oracle, isn't it possible 
>> (feasable) to create users which have no real life equivalent for the 
>> sole purpose of organizing objects? Say to hold all objects which 
>> belong to a certain package...

>
>
> Of course. I don't know if they have an official name, but I call them
> "application schemas": a user account that is created initially locked
> simply for the purposes of owning objects, and no-one can actually log
> on as that user. The converse, of course, also happens all the time:
> real-life users who don't actually own or create any objects of their
> own, but merely read or modify the contents of other people's objects.
> So, yes, you can have a schema that has no real human being attached,
> and real human beings that have no schema attached.
>
> But that misses the essential point as far as the OP is concerned: that
> you cannot have an Oracle user account which is not *potentially* a
> schema owner, and neither can you have an Oracle schema without first
> creating an Oracle user account.
>
> Rather than confuse the OP with talk about "real life equivalents",
> let's just get the plain message across first: a user=schema.
>
> Regards
> HJR

Actually I'm not so sure I am missing the OP's point. The OP may be trying to apply a DB2 for LUW or SQL Standard background to Oracle. What you just explained may get him/her there.

Thanks
Serge Received on Thu Dec 30 2004 - 08:31:51 CST

Original text of this message

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