Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Users vs. Schemas
Mark D Powell wrote:
> For explaining the differences between a USER and a SCHEMA to a
> developer looking at the CREATE USER and CREATE SCHEMA command results
> is a good idea.
>
> But is there a consensus of how best to describe PUBLIC?
If one takes a step back, or a couple, things come into focus:
Conceptually schemas and users are unrelated beyond the generic concept
of object ownership, which is a property to most objects
(such as tables).
A schema is best described as a "directory" in a file system
A user is, well, a user.
When you log onto a Unix file system your home directory typically has
the name as your login name.
That doesn't mean that you can't own other directories.
It doesn't mean that all directories must be owned by a regular user.
E.g. they could be owned by root/...
You can also "CD" to another directory which is not your own and make
that your default directory without changing users.
Thus the relationship between users and schemas in SQL is n-m.
Now you can bring it back to a specific implementation. In this case Oracle where the mapping between user and schema is 1-0..1. Hence the confusion. It's like the relationship between mass (gram) and force (N).
Cheers
Serge
-- Serge Rielau DB2 Solutions Development IBM Toronto LabReceived on Thu Jun 28 2007 - 09:31:30 CDT