Re: Changing ORACLE_SID

From: David Crowson <zdxc0d_at_amoco.com>
Date: Thu, 7 Apr 1994 05:15:00 CDT
Message-ID: <1994Apr7.051500.8512_at_amoco.com>


In article h88_at_tisdec.tis.tandy.com, bpearc1_at_tisdec.tis.tandy.com (Byron Pearce) writes:
-->Good afternoon Internet!
-->
-->I am posing this question to the masses, because, quite frankly, I am stumped
-->for a solution and was hoping that someone could shed some light on this
-->subject for me.
-->
-->We are currently running a single instance of an Oracle V6 database, but, on
-->our test system, we have recently begun to dabble in using 2 separate
-->instances. I know that this requires changing the ORACLE_SID, but I have not
-->figured out an easy way to do this to allow toggling back and forth.
-->
-->I know that I can use a setenv (we are on an Ultrix DEC5500) from the csh, but
-->that is a bit of a pain when you want to flip back and forth quickly.
-->
-->Any hints? If someone could help me solve this dilemna I would really
-->appreciate it. I have tried a script, but all that does is changed the
-->environment for the current execution so it doesn't help much. I need to
-->change the ORACLE_SID until I tell it to change back.

Have a file called (for example) testdb1 in a directory (like ~oracle/bin)

testdb contains
#!/bin/csh -f
# set Oracle environment for TESTDB1
setenv ORACLE_SID TESTDB1
echo $ORACLE_SID

then have an an alias to the file such as

alias testdb1 'source ~oracle/bin/testdb1'

(you should put this alias statement in your .cshrc)

then when you wanna change SID just type % tesdb1
TESTDB1 (this is the echo of the instance_SID..kind of a verification)

You can have as many of these as you have instances.

(We have 8 and it does make life a _lot_ eaier)

hope this helps

---
------------------------------------------------------------------------------
David Crowson   =%^)   |"For my part, I travel not to go anywhere, but to go. 
Oracle DBA(Ver.4,5,6,7)| I travel for travel's sake. The great affair is to
Amoco Exploration      | move, to get down off this featherbed of civilisation
Ealing, London, UK.    | and to find the globe granite underneath and strewn
"My views not Amoex's" | with cutting flints" : Robert Louis Stevenson
Received on Thu Apr 07 1994 - 12:15:00 CEST

Original text of this message