Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

switching between different instances 2

Status
Not open for further replies.

SimonPeh

MIS
Sep 11, 2002
96
SG
Greetings,

Need help from Oracle Guru.

I have 3 instances in the database and I wish to change the instance through unix prompt so that I could run some SQL command to extract some data.
How do I go about doing that?

Usually I run the following command to go into SQL>

su - oracle
svrmgrl
connect internal
SQL>

How do I change to another instance so I can extract data from that instances.

Thank you.
 
Simon,

On your Unix system, you should have a file named "oratab" that resides in /var/opt/oracle (on Solaris) or /etc (on AIX and HP-UX). That file contains three values for each Oracle instance on that server: 1) Oracle SID, 2) ORACLE_HOME, and 3) Y/N that indicates whether that instance should startup on re-boot.

As Ken Cunningham mentions, you can use the ". oraenv" command which displays the current instance name and allows you to either accept the current value (with [enter]) or supply the ORACLE_SID of the instance to which you wish to switch. Based upon the value you supply, ". oraenv" changes the current value of your ORACLE_SID and ORACLE_HOME to match your choice. Based upon those to environment variables, "svrmgrl" or "sqlplus /nolog" points to your choice of Oracle instance.

Let us know if this explains the solution to your need.

[santa]Mufasa
(aka Dave of Sandy, Utah, USA @ 15:43 (19Jul04) UTC (aka "GMT" and "Zulu"), 08:43 (19Jul04) Mountain Time)
 
Yes. This is what I need.

Many thanks to Ken and Mufasa.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top