Home » Infrastructure » Linux » how to start different database from sqlplus (oracle,10gR2,ubuntu)
how to start different database from sqlplus [message #317526] Thu, 01 May 2008 16:55 Go to next message
y2raza
Messages: 34
Registered: March 2008
Member
i am not sure abt the correct forum, but please help me on how to mount/startup 2nd database from sqlplus command line,

i have 2 databases as in DATABASE A & DATABASE B, i have the dbstart script setup which starts both DBs at the same time, but i want to start the desired DB from the sqlplus command so please advice

thanx

Re: how to start different database from sqlplus [message #317529 is a reply to message #317526] Thu, 01 May 2008 17:10 Go to previous messageGo to next message
ebrian
Messages: 2794
Registered: April 2006
Senior Member
Set the appropriate ORACLE_HOME, ORACLE_SID & PATH environment variables for each database and issue the following:

sqlplus / as sysdba
startup
Re: how to start different database from sqlplus [message #317530 is a reply to message #317526] Thu, 01 May 2008 17:33 Go to previous messageGo to next message
y2raza
Messages: 34
Registered: March 2008
Member
my bashrc file has oracle_sid=orcl which is for the DB which was setup when i installed Oracle, i created a 2nd DB with DBCA, now i want to create a Recovery catalog for DB A, which will reside on DB B, for that to happen i have to startup DB B as mount exclusive & that is where i am having a problem, the dbstart script starts both DBs at the same time, so i want to start the desired DB from sqlplus command line! so please elaborate further !

thanx in advance
Re: how to start different database from sqlplus [message #317531 is a reply to message #317529] Thu, 01 May 2008 17:55 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
ebrian wrote on Thu, 01 May 2008 15:10
Set the appropriate ORACLE_HOME, ORACLE_SID & PATH environment variables for each database and issue the following:

sqlplus / as sysdba
startup




What part of the above do you NOT understand?
Do you UNDERSTAND what the environmental variables above are used for?
If NOT, then visit http://tahiti.oracle.com & Read The Fine Concepts Manual.

[Updated on: Thu, 01 May 2008 17:55] by Moderator

Report message to a moderator

Re: how to start different database from sqlplus [message #317532 is a reply to message #317526] Thu, 01 May 2008 18:01 Go to previous messageGo to next message
y2raza
Messages: 34
Registered: March 2008
Member
i did try to set env by ORAENV but this is what it said

/bin/sh: Can't open dbhome

thanx
Re: how to start different database from sqlplus [message #317533 is a reply to message #317526] Thu, 01 May 2008 18:12 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
>i did try to set env by ORAENV but this is what it said
Who said anything about ORAENV?

Do you know how to set/change the value of an environmental variable?

Which environmental variable controls which database is to be accessed?
Re: how to start different database from sqlplus [message #317546 is a reply to message #317526] Thu, 01 May 2008 19:06 Go to previous messageGo to next message
y2raza
Messages: 34
Registered: March 2008
Member
well here is the full disclosure i am a Newbie, so u have to excuse me for not knowing lot of things? so please enlighten me??
Re: how to start different database from sqlplus [message #317547 is a reply to message #317526] Thu, 01 May 2008 19:23 Go to previous messageGo to next message
y2raza
Messages: 34
Registered: March 2008
Member
lets get it clear, i already know how to connect to different Databases from shell command line, since my dbstart script starts both databases, & i am guessing you are talking abt setting environment variables in ~/.bashrc file, !!! my problem is connecting from SQLPLUS command line when i type startup on sqlplus it fires up the default database which was created when i installed Oracle 10g ,
so please elaborate extensively !!!

you are help will be kindly appreciated!?!?
Re: how to start different database from sqlplus [message #317550 is a reply to message #317526] Thu, 01 May 2008 19:59 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
Visit http://tahiti.oracle.com & Read The Fine Concepts Manual.
Re: how to start different database from sqlplus [message #317581 is a reply to message #317547] Fri, 02 May 2008 01:44 Go to previous message
Michel Cadot
Messages: 68722
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Write 2 scripts per database, start_db1.sh, stop_db1.sh and same thing for db2.
start_db1.sh
ORACLE_HOME=<oracle home for db1>
export ORACLE_HOME
ORACLE_SID=DB1
export ORACLE_SID
PATH=$ORACLE_HOME/bin;$PATH
export PATH
sqlplus <<EOF
connect / as sysdba
startup
exit
EOF

Same thing for stop
Same thing for DB2.

Now you just have to call each script when the corresponding database you want to start/stop.

Regards
Michel
Previous Topic: Error starting Listener after applying Startup script
Next Topic: Oracle database is not starting at bootup
Goto Forum:
  


Current Time: Thu Dec 12 20:53:30 CST 2024