how to start different database from sqlplus [message #317526] |
Thu, 01 May 2008 16:55 |
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 #317530 is a reply to message #317526] |
Thu, 01 May 2008 17:33 |
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 #317547 is a reply to message #317526] |
Thu, 01 May 2008 19:23 |
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 #317581 is a reply to message #317547] |
Fri, 02 May 2008 01:44 |
|
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
|
|
|