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: Oracle8 question #2

Re: Oracle8 question #2

From: Howard J. Rogers <howardjr_at_www.com>
Date: Tue, 7 Nov 2000 18:00:23 +1100
Message-ID: <3a07a8c8@news.iprimus.com.au>

<jkyao_at_my-deja.com> wrote in message news:8u7t8k$hmr$1_at_nnrp1.deja.com...
> If I set the ORALE_SID=MYOTHERDB, will instance MYDB stopped?
> where should change the ORACLE_SID? In inital parameter file?
> After I open to instances, how can I switch between those two??
>
> JK

In the nicest way possible, please do some research and reading about this stuff. It's fairly basic, and you are going to get yourself badly stuffed at some point if you haven't got it clear in your head.

That said, the short answer is: ORACLE_SID is an *environment* variable. It has absolutely nothing to do with the init.ora, and is set on NT by typing 'set ORACLE_SID=BLAH' in a DOS window (or, more realistically, using the Control Panel SYSTEM applet to set it on a permanent basis for all new DOS windows).

On Solaris, it's set by typing 'export ORACLE_SID=BLAH'.

And no, changing an environment variable has no effect on Instances already started when the variable was set to something else. (Consider -does changing your PATH environment variable mean that programs already running get shut down?)

And switching between two Instances is achieved simply by switching the ORACLE_SID variable. The issue is when you type 'connect', Oracle must ask itself what the hell it's supposed to connect to -and decides to use the ORACLE_SID current at the time as the name of the Instance to which it is supposed to connect. If you therefore have ORACLE_SID set to BLAH1 and type 'connect internal' followed by startup, you've just started the BLAH1 Instance (which probably manages the BLAH1 database. You can then just exit out of server manager, change ORACLE_SID to BLAH2, fire up server manager once more, and type 'connect internal' and 'startup' and you now have a BLAH2 Instance (probably managing a BLAH2 database).

There *is* a way of switching between Instances without fiddling with ORACLE_SID (which after all is only providing a default value for Oracle to use in the abscence of anything more concrete) -you simply explicitly tell it what you want it to connect to. Hence, connect internal_at_BLAH2 will work, whatever your ORACLE_SID is set to, provided only that your tnsnames.ora file is set correctly.

Regards
HJR
>
>
> In article <8tv22f$p3u$1_at_nnrp1.deja.com>,
> David Fitzjarrell <oratune_at_aol.com> wrote:
> > In our last gripping episode jkyao_at_my-deja.com wrote:
> > > so, if I have two instance for two databases. I can open two of
 them
> > > at the same time in the same server? But when I login and startup
> > > another database, it always ask me to shut down first.
> > >
> > > JK
> > >
> > > In article <8tsfdl$kcq$1_at_nnrp1.deja.com>,
> > > gmei_at_my-deja.com wrote:
> > > > If you mean two oracle instances on the same server at the same
 time,
> > > > then the answer is YES.
> > > >
> > > > In article <8ts7f9$cjl$1_at_nnrp1.deja.com>,
> > > > jkyao_at_my-deja.com wrote:
> > > > >
> > > > >
> > > > > Can more than one databases open in the same server at the same
 time?
> > > > > Can I create a database connection between two databases in the
 same
> > > > > server? When I do replication can I distribute the copies of
 data
 to
> > > > > another database in the same server?
> > > > >
> > > > > plz clarify,
> > > > > thanks a lot
> > > > >
> > > > > jkyf_at_us.sina.com
> > > > > JK
> > > > >
> > > > > Sent via Deja.com http://www.deja.com/
> > > > > Before you buy.
> > > > >
> > > >
> > > > Sent via Deja.com http://www.deja.com/
> > > > Before you buy.
> > > >
> > >
> > > Sent via Deja.com http://www.deja.com/
> > > Before you buy.
> > >
> >
> > You are being asked to shut ORACLE down because you are trying to
 start
> > the same instance that is currently running. To start a second
 instance
> > you'll need to change the ORACLE_SID to point to the second instance.
> > For example if you have MYDB and MYOTHERDB instances created and your
> > ORACLE_SID is set to MYDB you cannot start MYOTHERDB because you are
> > not "pointing" to it. Change the ORACLE_SID to MYOTHERDB (in UNIX
 this
> > would be:
> >
> > ORACLE_SID=MYOTHERDB; export ORACLE_SID
> >
> > For NT:
> >
> > set ORACLE_SID=MYOTHERDB
> > )
> >
> > and make another attempt. You should be able to get the second
> > instance started.
> >
> > --
> > David Fitzjarrell
> > Oracle Certified DBA
> >
> > Sent via Deja.com http://www.deja.com/
> > Before you buy.
> >
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Received on Tue Nov 07 2000 - 01:00:23 CST

Original text of this message

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