AllExperts > Experts 
Search      
Oracle
Volunteer
Answers to thousands of questions
 Home · More Questions · Answer Library  · Encyclopedia ·
More Oracle Answers
Question Library

Ask a question about Oracle
Volunteer
Experts of the Month
Expert Login

Awards

About Us
Tell friends
Link to Us
Disclaimer

 
 
 
 
About Peter Choi
Expertise
I am a senior Oracle DBA, PeopleSoft Administrator and Project Manager with 10 years experience. I have been working with PeopleSoft (HRMS 5, 7, 7.x and 8.9), Oracle RDBMS (7.3 - 10gR2) on various Unix and Windows platforms, and some Oracle Application Server (9i/10gR2). I also have experience with the configuration and administration of BEA`s Tuxedo and WebLogic for PeopleSoft 8.x.

 
   

You are here:  Experts > Computing/Technology > Oracle > Oracle > switching instances

Oracle - switching instances


Expert: Peter Choi - 8/18/2008

Question
I have a server running Oracle on Linux, and I need two data bases (one for testing, and one for production), how I can switch from one to another ?
Is necessary two listeners ?
Wich is the procedure to pass data between then

Answer
Hi Gabriel,

You can have two database instances running on the same server. If they are the exact same Oracle version and patch level, you can have one database listener listening to both instances.

On Windows, Linux and Unix, there is an environment variable called ORACLE_SID. This should be set to the database that you wish to connect as. Thus if you set ORACLE_SID=DB_TEST (assuming that DB_TEST is your test instance) then you can issue SQL*PLUS that will connect against that database instance.

To change to your DB_PROD instance, set the environment variable to ORACLE_SID=DB_PROD.

While you don't always have to set these variables, it's safer especially when you have to log in to the database instance as SYS or SYSTEM to administer the database.

If you're only running as a simple Oracle DB user account (i.e. not as SYSTEM or SYS), say just using SQL*Plus, then you can specify the instance on your command line...

>sqlplus <user>/<password>@<oracle_sid>

Hope this helps.

Peter

Add to this Answer    Ask a Question



  Rate this Answer
   Was this answer helpful?
Not at allDefinitely              
   12345  

     
About Us | Advertise on This Site | User Agreement | Privacy Policy | Help
Copyright  © 2008 About, Inc. About and About.com are registered trademarks of About, Inc. The About logo is a trademark of About, Inc. All rights reserved.