Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

So yesterday I was fighting with importing cx_Oracle and it finally worked. However, I could not connect to the database. So I checked sqlplus to find out, whether I can connect to my Oracle database at all. I have tried both SYS and SYSTEM with the password I set during configuration as well as SCOTT/TIGER, but nothing helps and I get always the same error. This is what is printed:

[gruszczy@gruszczy-laptop matches]$ sqlplus

SQL*Plus: Release 11.2.0.2.0 Beta on Sat Jun 11 12:33:48 2011

Copyright (c) 1982, 2010, Oracle.  All rights reserved.

Enter user-name: sys
Enter password: 
ERROR:
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Linux-x86_64 Error: 2: No such file or directory
Process ID: 0
Session ID: 0 Serial number: 0


Enter user-name: system
Enter password: 
ERROR:
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Linux-x86_64 Error: 2: No such file or directory
Process ID: 0
Session ID: 0 Serial number: 0


Enter user-name: scott
Enter password: 
ERROR:
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Linux-x86_64 Error: 2: No such file or directory
Process ID: 0
Session ID: 0 Serial number: 0

Do you have any idea, what might not have been set? I have found information on Google, that I need to have no trailing slash in ORACLE_HOME and ORACLE_SID set. I have done both those things:

export ORACLE_HOME=/u01/app/oracle/product/11.2.0/xe
export PATH=$PATH:$ORACLE_HOME/bin
export ORACLE_SID=XE
export LD_LIBRARY_PATH=$ORACLE_HOME/lib

Is there anything that I have done wrong or do I have to set up something more?

EDIT

My tnsnames.ora:

XE =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = gruszczy-laptop)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = XE)
    )
  )

EXTPROC_CONNECTION_DATA =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC_FOR_XE))
    )
    (CONNECT_DATA =
      (SID = PLSExtProc)
      (PRESENTATION = RO)
    )
  )

EDIT

I tried doing suggested operations and got this:

$ sudo su - oracle
$ -bash-4.2$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.2.0 Beta on Sat Jun 11 21:47:15 2011

Copyright (c) 1982, 2010, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> startup
ORA-00119: invalid specification for system parameter LOCAL_LISTENER
ORA-00130: invalid listener address '(ADDRESS=(PROTOCOL=TCP)(HOST=gruszczy-laptop)(PORT=1521))'
SQL> Disconnected

-bash-4.2$ lsnrctl status

LSNRCTL for Linux: Version 11.2.0.2.0 - Beta on 11-JUN-2011 21:47:43

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC_FOR_XE)))
TNS-12541: TNS:no listener
 TNS-12560: TNS:protocol adapter error
  TNS-00511: No listener
   Linux Error: 2: No such file or directory
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=gruszczy-laptop)(PORT=1521)))

This doesn't say me anything and I have no idea, how this all should be configured. I have never had to set this up before. Also usually before I try doing anything I start database with 'Start Database' application.

share|improve this question
    
BTW, Oracle installation manual contains directions how to set up shared memory correctly. Did you follow them? Also, what's in your tnsnames.ora? –  9000 Jun 11 '11 at 10:48
    
No, I have not used directions form Oracle installation manual. Previously when I installed Oracle 10 (32bit) on Ubuntu 10.10 I didn't have to do much more beside what I already did. I have edited my question with my tnsnames.ora. –  gruszczy Jun 11 '11 at 10:53
add comment

2 Answers 2

up vote 3 down vote accepted

Looks like your database is not started. Connect with

sqlplus / as sysdba

Then issue the startup command.

Also make sure the listener is up and running with lsnrctl status (lsnrctl start if it's not running).

share|improve this answer
    
I have tried doing what you recommended and got some output I have no idea how to use. Could you help me a little more? –  gruszczy Jun 11 '11 at 19:51
    
This blog is about Oracle 11g on F14 but should work on F15: blog.fpmurphy.com/2010/12/… –  fpmurphy1 Jun 21 '11 at 14:29
add comment

Do you have a trailing / at the end of the ORACLE_HOME entry in the listener.ora configuration file?

If so, remove it.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.