Unable to connect to oracle in red hat linux

Hi Gurus,

I have installed the oracle xpress 10g edition in my red hat linux and saw the message that it has been installed successfully ,but after that I started the database by going through application->database->start database
and after that i open the sql prumt but when i tried to connect by using "system" and the corresponding passowrd ,it is throwing an error.(for error please see below)

SQL> show user
USER is ""
SQL> conn system
Enter password: 
ERROR:
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Linux Error: 2: No such file or directory

please guide me how to resolve the issue

operating system details

[root@dhcppc0 ~]# uname -a
Linux dhcppc0 2.6.18-164.el5PAE #1 SMP Tue Aug 18 15:59:11 EDT 2009 i686 i686 i386 GNU/Linux

it is read hat linux 5

waiting your reply.
longlive

Looks like Oracle did not start in the first place. Check the ps list to verify.

tyler_durden

thanks Tyler,

I saw by using ps -ef|grep oracle

[biswa@dhcppc0 ~]$ ps -ef|grep oracle
biswa 4761 4685 0 13:29 pts/1 00:00:00 grep oracle

no oracle process is showing

Please guide me how to solve this

---------- Post updated at 04:05 PM ---------- Previous update was at 01:32 PM ----------

Hi ,

I checked with the status command and got the following outputs below

[root@dhcppc0 ~]# /etc/init.d/oracle-xe status

LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 17-JAN-2011 15:46:39

Copyright (c) 1991, 2005, 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=dhcppc0)(PORT=1521)))
TNS-12545: Connect failed because target host or object does not exist
 TNS-12560: TNS:protocol adapter error
  TNS-00515: Connect failed because target host or object does not exist

please help me to resolve this above issue.

God bless you all.

Hello sanjay.login,

Have you defined a database yet or just installed the software? To define the database, you will need to decide all sorts of things, not least the data file sizes and locations (including if they are raw devices or files in the filesystem)

There is a whole procedure to create a database before you can sign on. How much have you got through?

Robin
Liverpool/Blackburn
UK

You'll have to set some environment variables first for SQL*Plus to connect to the correct instance, especially ORACLE_SID. There's a handy script for that in /usr/lib/oracle/xe/app/oracle/product/<version>/server/bin/oracle_env.sh

I suggest you watch this You Tube video on how to install it: How to install Oracle 10g Express on Linux

hi puldi,

the error is not related to env variable setting,i installed in red hat 4 it was working fine the same way i did today for red hat 5 it is not working

the status is saying unable to start the database (in previous post)..

and for your reference the below is the line inside the env.sh script

ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server
export ORACLE_HOME
ORACLE_SID=XE
export ORACLE_SID
NLS_LANG=`$ORACLE_HOME/bin/nls_lang.sh`
export NLS_LANG
PATH=$ORACLE_HOME/bin:$PATH
export PATH
if [ $?LD_LIBRARY_PATH ]
then
        LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
else
        LD_LIBRARY_PATH=$ORACLE_HOME/lib
fi
export LD_LIBRARY_PATH

Ok, another thing to check because of the TNS error: check your /etc/hosts that the machine has an entry for itself other than 127.0.0.1.

i checked it and

I think it is correct

# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1               localhost.localdomain localhost
::1             localhost6.localdomain6 localhost6

Nope, you'll need another entry for the machine name dhcppc0 and an IP address other than 127.0.0.1

thanks pludi,
could you please tell me what line i should add
Do you mean like

127.0.5.2 dhcppc0 localhost

I am confused ,please guide me

Get your current IP using ifconfig. Then add that IP to the hosts file like this

123.456.789.987 dhcppc0.local dhcppc0

and hope that you'll get the same IP again on the next reboot. Or ask your administrator for a fixed IP.

I did as you told no luck. The same error I am facing.

Regards,
sanjay

Usually after sucessfull oracle xe installation you get:
"Install completed sucessfully", not sure what was your status.

Try:

reboot your system

then set the env and try connecting through sqlplus client as you mentioned you should be good.

Another way to connect and to test is to get the Oracle JDBC and a simple jdbc client like xigole jisql (and JAVA). If you tns listener is listening, then you can connect with that. This helps sort out client from server side problems. JDBC is free and compatible for all platforms and RDBMS.

I use the open source JDBC GUI SQuirreL on all RDBMS. It is free, many featured, and most of the skills you build transfer between RDBMS.

Hi,

I've not used the express edition so forgive me if this is total rubbish.

What happens when you go into SQL: sqlplus / as sysdba

and run the startup command?

Are there any errors in the alert log?

As oracle user make sure your environement is correctly set then :

lsnrctl start
lnsrctl status
sqlplus "system/manager"
startup
exit

(or whatever "user/passwd" you have setup)

Hello :

1> Did you check your alert.log file for oracle .What does it say ?
2> Did you configure the parameters in the system . On Solaris it is as follows

oracle_START (do not remove)
set noexec_user_stack=1
set shmsys:shminfo_shmmax=4294967295
set shmsys:shminfo_shmmin=1
set shmsys:shminfo_shmmni=512
set shmsys:shminfo_shmseg=1000
set semsys:seminfo_semmap=5120
set semsys:seminfo_semmni=5118
set semsys:seminfo_semmns=10240
set semsys:seminfo_semmnu=3072
*set semsys:seminfo_semmsl=25
set semsys:seminfo_semmsl=256
*set semsys:seminfo_semopm=10
set semsys:seminfo_semopm=100
set rlim_fd_max=1024
set rlim_fd_cur=512
set semsys:seminfo_semume=128
set semsys:seminfo_semusz=96
set semsys:seminfo_semvmx=32767
set semsys:seminfo_semaem=16384
* oracle_END (do not remove)

For RHEL 5, the kernel parameters are:

fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 536870912
kernel.shmmni = 4096
# semaphores: semmsl, semmns, semopm, semmni
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default=262144
net.core.rmem_max=4194304
net.core.wmem_default=262144
net.core.wmem_max=1048586

You also need to modify PAM (Plugable Authentication Module) configuration files to increase the session limits for the oracle user. Add the following line to /etc/pam.d/login if it does not already exist:

    session    required     pam_limits.so

and add the following lines to /etc/security/limits.conf:

    oracle     soft    nproc   2047
    oracle     hard    nproc   16384
    oracle     soft    nofile  1024
    oracle     hard    nofile  65536

Finally, I suggest you disable SELINUX until everything else if working

If /etc/security/limits.conf does currently exist on your system, then create this file with the appropriate permissions.