Re: Database name in ORACLE ?

From: R Scott Hunter <rshunter_at_delphi.com>
Date: Sat, 19 Mar 94 18:30:31 -0500
Message-ID: <hyys4jf.rshunter_at_delphi.com>


Jamwal Arun S <asj8203_at_ucs.usl.edu> writes:  

>Hi,
> How does one specify the database name in oracle? Say,
>I want to create a table called 'student' in the databases
>called 'school' and 'university'. How do I do that?
 

If you are new to Oracle, the concept of "database" might be confusing if you're used to other environments. In Oracle, the database means the whole universe of information including all objects owned by everyone as well as all the internal bookkeeping information Oracle needs to do its work. What I think you want to do is to have a number of different users with separate schemas (I hope I'm not putting words in your mouth.):  

# create the school and university Oracle user ids grant connect to school identified by firstpass; grant connect to university identified by secondpass; # create objects
sqlplus school/firstpass
SQL > create table student
(

id_no	number(10) not null constraint student_pk primary key,
lnam	varchar2(30) not null,
fnam	varchar2(15),
mnam 	varchar2(15),

...
);
sqlplus university/secondpass
SQL > create table student
...
# now there are two tables in the system, school.student and university.student
under the schemas belonging to those users. Is this the sort of thing you wanted to do?  
R. Scott Hunter		AT&T Tax Systems, Morristown,NJ
shunter_at_cfotax.attmail.com	73373,2743_at_compuserve.com  rshunter_at_delphi.com
Received on Sun Mar 20 1994 - 00:30:31 CET

Original text of this message