Fun: How is it possible? - updated (and the winner is...)
Purpose of this post is more for fun than practice. Consider this output:
$ ps -aef|grep pmon|grep -v grep
oracle 25330 1 0 Apr16 ? 00:00:02 ora_pmon_RMANDELL
oracle 26084 1 0 Apr16 ? 00:00:01 ora_pmon_RMANDELL
oracle 26128 1 0 Apr16 ? 00:00:01 ora_pmon_RMANDELL
oracle 26295 1 0 Apr16 ? 00:00:01 ora_pmon_RMANDELL
Four PMONs for the same ORACLE_SID? How did I do it?
To ask some additional question or to post answer simply add a comment.
Deadline is set on 24.4.2008 23:59 (Thursday).
More info:
$ ls $ORACLE_HOME/dbs
hc_RMANDELL.dat initRMANDELL.ora lkRMANDELL orapwRMANDELL
- ps shows real Oracle PMON processes
- one (S)PFILE
- one Oracle installation
- instances are started under the same user and group
- version of Oracle DB does not matter
Waiting for Your answers...
UPDATE
And the winner is Jakub Wartak who posted correct solution although I was expected little different solution (he had used symlink for it) but the main point is the same - you need to set "different" ORACLE_HOME.
So how i did start more (for instances) with the same ORACLE_SID?
My ORACLE_HOME for 11g is located at /opt/oracle/111.
$ ps -aef|grep pmon|grep -v grep
$ env|grep ORA
ORACLE_SID=RMANDELL
ORACLE_BASE=/opt/oracle
ORACLE_HOME=/opt/oracle/111
$ sqlplus / as sysdba
SQL*Plus: Release 11.1.0.6.0 - Production on Mon Apr 21 08:46:23 2008
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup nomount
ORACLE instance started.
Total System Global Area 538656768 bytes
Fixed Size 2146112 bytes
Variable Size 150995136 bytes
Database Buffers 381681664 bytes
Redo Buffers 3833856 bytes
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 -
64bit Production
With the Partitioning, Oracle Label Security, OLAP, Data Mining
and Real Application Testing options
Now I change the ORACLE_HOME and add "/" at the end of path which change the
ORACLE_HOME but in fact path reamains valid.
So my new ORACLE_HOME is /opt/oracle/111/.
$ export ORACLE_HOME=/opt/oracle/111/
$ sqlplus / as sysdba
SQL*Plus: Release 11.1.0.6.0 - Production on Mon Apr 21 08:46:46 2008
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup nomount
ORACLE instance started.
Total System Global Area 538656768 bytes
Fixed Size 2146112 bytes
Variable Size 150995136 bytes
Database Buffers 381681664 bytes
Redo Buffers 3833856 bytes
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 -
64bit Production
With the Partitioning, Oracle Label Security, OLAP, Data Mining
and Real Application Testing options
Again I modify ORACLE_HOME and I put another "/".
$ export ORACLE_HOME=/opt/oracle/111//
$ sqlplus / as sysdba
SQL*Plus: Release 11.1.0.6.0 - Production on Mon Apr 21 08:47:12 2008
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup nomount
ORACLE instance started.
Total System Global Area 538656768 bytes
Fixed Size 2146112 bytes
Variable Size 150995136 bytes
Database Buffers 381681664 bytes
Redo Buffers 3833856 bytes
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 -
64bit Production
With the Partitioning, Oracle Label Security, OLAP, Data Mining
and Real Application Testing options
I can also add "/" at begin of path and path of course remains valid.
$ export ORACLE_HOME=///opt/oracle/111
$ sqlplus / as sysdba
SQL*Plus: Release 11.1.0.6.0 - Production on Mon Apr 21 08:48:01 2008
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup nomount
ORACLE instance started.
Total System Global Area 538656768 bytes
Fixed Size 2146112 bytes
Variable Size 150995136 bytes
Database Buffers 381681664 bytes
Redo Buffers 3833856 bytes
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 -
64bit Production
With the Partitioning, Oracle Label Security, OLAP, Data Mining
and Real Application Testing options
Now I have started four RMANDELL instances.
$ !ps
ps -aef|grep pmon|grep -v grep
oracle 26459 1 0 08:46 ? 00:00:00 ora_pmon_RMANDELL
oracle 26501 1 0 08:46 ? 00:00:00 ora_pmon_RMANDELL
oracle 26541 1 0 08:47 ? 00:00:00 ora_pmon_RMANDELL
oracle 26583 1 0 08:48 ? 00:00:00 ora_pmon_RMANDELL
Maybe you are asking what is the meaning of this post.
As I wrote in title in this post it is for fun. Even this post is for fun it brings one lesson.
If you've got following message
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
or you've got "Connected to an idle instance.", your instance is up and running and your enviroment seems to be correct.
Then you did (probably) set the enviroment manually (using a "Tab key" in Bash) and that created "/" at the end of the path.
To find out which ORACLE_HOME is used just take a look on any trace file genereated in background_dump_dest directory.