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.
-
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– 90002011年06月11日 10:48:51 +00:00Commented Jun 11, 2011 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– gruszczy2011年06月11日 10:53:57 +00:00Commented Jun 11, 2011 at 10:53
2 Answers 2
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).
-
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– gruszczy2011年06月11日 19:51:20 +00:00Commented Jun 11, 2011 at 19:51
-
This blog is about Oracle 11g on F14 but should work on F15: blog.fpmurphy.com/2010/12/…fpmurphy– fpmurphy2011年06月21日 14:29:58 +00:00Commented Jun 21, 2011 at 14:29
Do you have a trailing /
at the end of the ORACLE_HOME
entry in the listener.ora
configuration file?
If so, remove it.