Wednesday, January 18, 2012

TNS-12541 TNS-12560 TNS-00511 Linux Error: 111

 [oracle@localhost ~]$ lsnrctl

LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 18-JAN-2012 22:45:15

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

Welcome to LSNRCTL, type "help" for information.

LSNRCTL> reload
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost.localdomain)(PORT=1521)))
TNS-12541: TNS:no listener
 TNS-12560: TNS:protocol adapter error
  TNS-00511: No listener
   Linux Error: 111: Connection refused
LSNRCTL> service          
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost.localdomain)(PORT=1521)))
TNS-12541: TNS:no listener
 TNS-12560: TNS:protocol adapter error
  TNS-00511: No listener
   Linux Error: 111: Connection refused

This problem is related with IP address. To solve, just follow the following simple steps:-

[oracle@localhost ~]$ su - root
Password:
[root@localhost ~]# vi /etc/hosts        (copy & paste the below line)


127.0.0.1       localhost.localdomain   localhost


[root@localhost ~]# su - oracle
[oracle@localhost ~]$ lsnrctl start

LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 18-JAN-2012 22:51:23

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

Starting /u01/oracle/product/10.2.0/db_1/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 10.2.0.1.0 - Production
System parameter file is /u01/oracle/product/10.2.0/db_1/network/admin/listener.ora
Log messages written to /u01/oracle/product/10.2.0/db_1/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost.localdomain)(PORT=1521)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost.localdomain)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date                18-JAN-2012 22:51:24
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/oracle/product/10.2.0/db_1/network/admin/listener.ora
Listener Log File         /u01/oracle/product/10.2.0/db_1/network/log/listener.log
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost.localdomain)(PORT=1521)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
  Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "orcl" has 1 instance(s).
  Instance "orcl", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully

[oracle@localhost ~]$

Saturday, January 14, 2012

HOW TO UNISTALL ORACLE COMPLETELY FROM LINUX REDHAT OR CENTOS.

Simply run the following commands:

[root@localhost ~]# rm -f /etc/oraInst.loc

[root@localhost ~]# rm -f /etc/oratab

[root@localhost ~]# rm -R -f /etc/oracle

Simple Steps : HOW TO INSTALL ORACLE 10G ON LINUX REDHAT5, CENTOS5 or above..etc.

1. Check minimum hardware requirements given by ORACLE.


2. Installed all Packages or Installed the following packages before Oracle installation:

-    compat-db-4.2.52-5.1.i386.rpm

-    sysstat-7.0.2-1.el5.i386.rpm

-   libaio-devel-0.3.106-3.2.i386.rpm

-   libXp-1.0.0-8.1.el5.i386.rpm


LOGIN ROOT: ( Use VI as editor)*

3. Add the following lines to the end of /etc/sysctl.conf file:

kernel.shmmax = 2147483648

kernel.shmall = 2097152

kernel.shmmni=4096

kernel.sem=250 32000 100 128

fs.file-max=65536

net.ipv4.ip_local_port_range=1024 65000

net.core.rmem_default=1048576

net.core.rmem_max=1048576

net.core.wmem_default=262144

net.core.wmem_max=262144

4. Execute this command:   /sbin/sysctl -p
or RESTART system to take changes.



5.Add the following lines in the /etc/security/limits.conf file (Shell limits for the Oracle User):

oracle              soft    nproc   2047

oracle              hard    nproc   16384

oracle              soft    nofile  1024

oracle              hard    nofile  65536



6. Add the following lines to /etc/pam.d/login file


session    required     /lib/security/pam_limits.so

session    required     pam_limits.so



7.Add the following lines to /etc/profile file in order to user oracle software:


if [ $USER = "oracle" ]; then

        if [ $SHELL = "/bin/ksh" ]; then

              ulimit -p 16384

              ulimit -n 65536

        else

              ulimit -u 16384 -n 65536

        fi

fi



8. RHEL5 or above is not supported platform so change  /etc/redhat-release as: Just copy & paste to terminal:


cp /etc/redhat-release /etc/redhat-release.original

echo "redhat-4" > /etc/redhat-release




9.Create groups and user for Oracle Installation using following commands:


groupadd  oinstall

groupadd  dba

useradd -m -g oinstall -G dba -d /home/oracle -s /bin/bash -c "Oracle Software Owner" oracle

passwd oracle



NEW TERMINAL

10. Create oracle home folder (COpy & paste to terminal):

cd /
mkdir u01
cd u01
mkdir oracle
cd oracle/
mkdir product
cd product/
mkdir 10.2.0
cd 10.2.0/
mkdir db_1
cd db_1/
pwd



LOGIN TO ORACLE

11.Unrar or extract oracle software

12. In terminal:

cd /
su root
chown -R oracle:oinstall /u01/
exit


13. Go to oracle software folder and execute in the terminal:

 ./runInstaller

 --installation completed--

14.Execute the following commands as root:

/home/oracle/oraInventory/orainstRoot.sh
cd $ORACLE_HOME/
./root.sh


15. Setting Oracle Enviroment: Add following lines to  /home/oracle/.bash_profile file:

>>For 32bit (x86) architecture:

export ORACLE_HOME=/u01/oracle/product/10.2.0/db_1

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib

export ORACLE_SID=orcl

export PATH=$ORACLE_HOME/bin:$PATH

alias database ='export ORACLE_SID=orcl;sqlplus "/ as sysdba"'


>>For 64bit (x86_64) architecture:

export ORACLE_HOME=/u01/oracle/oracle/product/10.2.0/db_1

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib32

export ORACLE_SID=orcl

export PATH=$ORACLE_HOME/bin:$PATH

alias database ='export ORACLE_SID=orcl;sqlplus “/ as sysdba”'


16. REBOOT SYSTEM and the login to ORACLE


Gud luck.. ;)