0

So I will start off by stating I have moved the regular install location of Oracle 11.2 XE to a logical volume (/oracle) I had created on my RHEL 6.6 server. After shutting down both the database and the Oracle listener, I performed...

$ cp -R /u01/app/* /oracle
$ rm -rf /u01/app/oracl
$ ln -s /oracle/oracle /u01/app/oracle

Then restarted the listener and the database. Now when I attempt to run the following as the user 'oracle' I get a message...

$ sqlplus
Enter user-name: sys / as sysdba
Enter password: ****
Connected to idle instance.

Further, when I attempt a startup I get an error.

> startup
ORA-45301: XE Edition single instance violation error

I have attempted the solutions found here to no avail.

Here is the output for my listener controller:

bash-4.1$ lsnrctl status

LSNRCTL for Linux: Version 11.2.0.2.0 - Production on 10-MAR-2015 10:26:25

Copyright (c) 1991, 2011, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC_FOR_XE)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.2.0 - Production
Start Date                10-MAR-2015 10:25:57
Uptime                    0 days 0 hr. 0 min. 28 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Default Service           XE
Listener Parameter File   /u01/app/oracle/product/11.2.0/xe/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/dev/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC_FOR_XE)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=dev)(PORT=1521)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
  Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully

I'm really quite lost as to what to attempt next. I know I could just reinstall and keep the directory in its proper location but I need it to be in it's own logical volume.

EDIT

Some further information to help clarify my system...

bash-4.1$ env | grep ORA
ORACLE_SID=XE
ORACLE_BASE=/oracle/oracle
ORACLE_HOME=/oracle/oracle/product/11.2.0/xe

bash-4.1$ env | grep TNS
TNS_ADMIN=/oracle/oracle/product/11.2.0/xe/network/admin

bash-4.1$ ps -aux | grep pmon
oracle    2431  0.0  0.2 1265956 16652 ?       Ss   11:43   0:00 xe_pmon_XE

FURTHER EDIT

Attempting to sign in to sqlplus using the SYSTEM user returned an error:

ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Linux-x86_64 Error: 2: No such file or directory

FURTHER EDIT

Output of the ipcs command

bash-4.1$ ipcs

------ Shared Memory Segments --------
key        shmid      owner      perms      bytes      nattch     status
0xc0a59444 32768      oracle     660        4096       0

------ Semaphore Arrays --------
key        semid      owner      perms      nsems
0xd4a9963c 229378     oracle     660        104
0x884d8f34 491523     oracle     660        104

------ Message Queues --------
key        msqid      owner      perms      used-bytes   messages
SBlancher
  • 11
  • 2
  • 8

3 Answers3

1

Check output of ipcs command and try to delete all shared memory segments/semaphores owned by Oracle.

When Oracle starts it uses two strings ORACLE_SID(uppercase) and ORACLE_HOME, hashes these two strings and uses this hash value a key for shmget call. So even if you append slash / to ORACLE_HOME everything is different from Oracle's perspective - even if the disk path is the same.

So I think you moved ORACLE_HOME into some other location, but the old value was preserved somewhere and now Oracle thinks that you are trying to start multiple instances.

EDITED: I'm not sure about XE, but regular Oracle editions are shipped as a bunch of .o object files. These files are linked during installation, but you can also re-link Oracle anytime. Check the script $ORACLE_HOME/bin/relink if the old ORACLE_HOME is hardcoded in it. And then try to re-link all libraries by executing relink all. Also note that Oracle uses link option -Wl,-rpath=..., so some Oracle binaries have library search patch compiled in them.

For Standard/Enterprise edition it is not problem to copy binaries into different Oracle home.

ibre5041
  • 4,903
  • 1
  • 20
  • 35
  • I performed ipcs but no output was available. As well, my ORACLE_HOME environment variable isn't appended with a '/'. Your conclusion sounds right there, but I'm unsure where this old value is persisting. – SBlancher Mar 10 '15 at 20:59
  • Unfortunately, there doesn't seem to be a 'relink' in the bin directory with XE. But further news on this problem, I'm not sure what happened but I now have output for the command 'ipcs'. – SBlancher Mar 11 '15 at 16:21
  • Which I will pasted in my original topic, please see above (your help is vastly appreciated) – SBlancher Mar 11 '15 at 16:21
  • these shared resources might be left by previos Oracle instance. try to kill Oracle processes and them remove them via `ipcrm`. On Linux you can also use some tool, which will tell you if shared resources are accessed by some proces – ibre5041 Mar 11 '15 at 17:18
  • btw the value: 0xc0a59444 is a hash of ORACLE_SID and ORACLE_HOME, so it should change for every db instance. – ibre5041 Mar 11 '15 at 17:22
  • Should I be killing EVERY Oracle process? There are about 15-20 of them. – SBlancher Mar 11 '15 at 17:46
  • if you have so many processes running, what exactly is the problem? is pmon (process monitor running)? Check also databases logfile alterXE.log it should end with something like `DATABASE OPEN`. – ibre5041 Mar 11 '15 at 18:49
  • try to login as sys user `sqlplus / as sysdba`. Or as a system user via listener `sqlplus system@XE`. – ibre5041 Mar 11 '15 at 18:50
  • When logging in with "/ as sysdba" it states 'Connected to idle instance'. Then I cannot startup at all. When logging in with "SYSTEM@XE" it states 'ORA-01033: ORACLE initialization or shutdown in progress'. – SBlancher Mar 11 '15 at 19:02
  • is it possible that `/etc/oratab` file or some other startup script still contains old oracle home? Try to find PID of oraXE_pmon process and then check it's environment `cat /proc//environ`. But most of the information lies in alert_XE.log. It looks like your instance is already running but it uses different environment. – ibre5041 Mar 11 '15 at 19:18
  • Here we go! The environ file contains the wrong ORACLE_BASE, PATH, HOME, and ORACLE_HOME directories. – SBlancher Mar 11 '15 at 20:15
  • I've attempted to find the alert_XE.log but cannot anywhere – SBlancher Mar 11 '15 at 20:15
  • How can I fix this issue though? – SBlancher Mar 11 '15 at 20:16
  • Found the problem, tnsname.ora had a wrong entry and as well I had a directory's file permission wrong. Thank you for your help either way! – SBlancher Mar 11 '15 at 21:01
0

Check in /u01/app/oracle/product/11.2.0/xe/dbs/ if you have renamed your XE database or attempted to create a new one, you must be sure there is only one database known by xe. It's limited to one instance. /etc/init.d/oracle-xe stop cd /u01/app/oracle/product/11.2.0/xe/dbs/ rename any unused pwfile and spfile to .old /etc/init.d/oracle-xe start

-1

Issue was a wrong entry in tsnnames.ora (I had added a line that shouldn't of been there) and as well the permissions for my /oracle directory were incorrect. Thank you to everyone who tried to help, it was greatly appreciated.

SBlancher
  • 11
  • 2
  • 8