Linux – How to switch between Oracle 11g and 12c on same linux

linuxoracle-11goracle-12c

I have oracle11g and 12c installed on same machine and few test cases that need to be run on both versions.
Can power up both database simultaneously and run tests parallely.
Do you know any document that describe this scenario of multiple oracle on same machine.

Note: I am not from DB background and just using it for something so please suggest accordingly

Best Answer

Check the /etc/oratab file. In there the ORACLE_HOME is defined in the second field. Make sure that both instances point to the right ORACLE_HOME. If you do an . oraenv to change from one instance to another this scripts sets the correct ORACLE_HOME so you connect with the right binaries to start, stop, and access the instance. The file is normally also used to stat-up the instances at boot time.

Example of a line in the /etc/oratab file:

DEVA:/u01/app/oracle/product/11.2.0/db_2:Y

DEVA is the name (SID) of the instance, /u01/app/oracle/product/11.2.0/db_2 is the ORACLE_HOME, and Y indicates that the instance must be started at boot time.

You say that you have no DB background so be aware that you cannot run the same instance in both versions of Oracle.