Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Connecting to non-default database in Oracle 7

Re: Connecting to non-default database in Oracle 7

From: Robert Yang <NOSPAM_ryang_at_teleport.com_NOSPAM>
Date: Tue, 21 Apr 1998 18:58:40 GMT
Message-ID: <A%5%.231$H9.153939@news2.teleport.com>


Thanks for the info !

However, I've just discovered that these synonyms are not scoped to the connection.
(at least that's what I think so far). So two users logged in using the same ID will
stomp on each other's synonyms. Am I incorrect ?

BTW This is under NT Server 4.0.
--
Rob Yang
Sr. Software Engineer
San Jose, CA, USA

rono_at_fl.envworld.com wrote in message <6hiiko$ps$1_at_nnrp1.dejanews.com>...
>To perhaps supply some more background to what Jeremy is saying: In
Oracle,
>a database is a collection of files and memory area under thecontrol of a
>set of server processes called the Instance. In order to gainaccess to any
>of the information in a database, you must log on (connect)to that
database.
> When you log on, you provide your userid/passwordand a connect string
which
>identifies the database to which you want toconnect. Once you are
>connected to a database, you look at tables in your ownschema by default.
>"Schema" in Oracle refers to a set of database objectswhich have the same
>owner. Hence, if I am logged on as RONO, myschema is RONO. Your schema
>might be ROBERTY. We can eachhave a set of tables with the same name, for
>example RONO.EMPLOYEE andROBERTY.EMPLOYEE. To reference your own schema,
>you need only refer to the table by name: EMPLOYEE. There a two methods
to
>access someone else's schema.One is the notation I used above
>(RONO.EMPLOYEE). The other option is to create a synonym. A synonym is
>just a way to tell Oracle that when Isay this, I really mean that. Hence,
>if ROBERTY had no EMPLOYEE tablehe could reference RONO.EMPLOYEE by
creating
>a synonym EMPLOYEEon RONO.EMPLOYEE. At that point, every time you say
>EMPLOYEE, you will get RONO.EMPLOYEE.So what does this mean in usage? If
>you are trying to have muliple userslook at a common set of tables,
synonyms
>is your best bet. If you are trying tohave one set of tables one time, and
>another set of tables another time(e.g. Development vs. Production)
separate
>databases is probably whatyou want.Hope this clarified more than confused
>you.-- Ronald K. Olcott, President-- Interlude EnterprisesIn article
><353c8aa5.1938429_at_news.dircon.co.uk>, jeremyr_at_techie.com wrote:> > Rob,
>you can create different "schema's" i.e. almost like user's, in> one Oracle
>database - and by using a different "connect" statement,> switch between
the
>same set of tables defined for each user. Or, you> can set up completely
>different sets of physical database files and> choose between the database
>to select by changing the Oracle SID> (System IDentifier). The first style
>sounds closer to your> description of SQL Server ... hope that helps a
>little -- on which OS> are you running Oracle?> > Jeremy Russell> >
>"Robert Yang" <NOSPAM_ryang_at_teleport.com_NOSPAM> wrote:> > >We are porting
>from MS SQL Server 6.5 to Oracle 7.3 and are quite> >confused, as you might
>expect, so please bear with me 8)> >> >There is a concept in SQL Server of
>multiple databases on a given> >server which can contain the same schema
>(tables, stored procedures, etc.).> >When connecting with DB-Lib, the
>dbuse() API can be used to set the> >desired default database, so that SQL
>commands like> >"Select Name from My_Table" can be executed.> >> >However,
>I cannot see how to do this with OCI or even Embedded SQL.> >It would seem
>that the database name must be specified for non-default> >databases, e.g.
>"Select Name from MyDatabase.MyTable".> >> >
>
>-----== Posted via Deja News, The Leader in Internet Discussion ==-----
>http://www.dejanews.com/ Now offering spam-free web-based newsreading
Received on Tue Apr 21 1998 - 13:58:40 CDT

Original text of this message

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