Wednesday, July 31, 2013

ORA-12547: TNS:lost contact error

Issue: When trying to connect to the database we are getting the ORA-12547: TNS:lost contact error.

[oraem@linux01 ~]$ export ORACLE_SID=orcl
[oraem@linux01 ~]$ export ORACLE_HOME=/u01/app/oracle/product/112030/dbhome_1
[oraem@linux01 ~]$ export PATH=$ORACLE_HOME/bin:$PATH
[oraem@linux01 ~]$ sqlplus sys as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Wed Jul 31 04:43:52 2013

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

Enter password: 
ERROR:
ORA-12547: TNS:lost contact

Tried a lot of scenarios by changing the listener.ora, sqlnet.ora & tnsnames.ora files but still the issue was not resolved.
Finally checked the ORACLE_HOME/bin, there was file permission issues for oracle binary file

-rwxr-x--x 1 oraem   dba 232399123 Jul 29 09:20 oracle

As per Oracle the file permission should be 6751 for oracle binary file, so changed the permission of that file

[oraem@linux01 bin]$ chmod 6751 oracle
[oraem@linux01 bin]$ ls -lrt oracle
-rwsr-s--x 1 oraem dba 232399123 Jul 29 09:20 oracle

Tried to login to the database and it was success.

[oraem@linux01 bin]$ sqlplus sys as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Wed Jul 31 06:39:02 2013

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

Enter password: 

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> select name, open_mode from v$database;

NAME      OPEN_MODE
--------- --------------------
ORCL      READ WRITE

Monday, July 29, 2013

ORA-01506: missing or illegal database name

Sometimes when we try to start a database in windows or other OS platform, we get the error ORA-01506: missing or illegal database name

Environment Details:
OS: Windows Server 2008
Database Version: 11gR2
User: oracle
Oracle Home: E:\oracle\product\11.2.0\dbhome_1
Oracle SID: orcldb

Debugging: 
TNS Ping is working fine
E:\>tnsping orcldb

TNS Ping Utility for 32-bit Windows: Version 11.2.0.1.0 - Production on 29-JUL-2013 07:56:32

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

Used parameter files:
E:\oracle\product\11.2.0\dbhome_1\network\admin\sqlnet.ora
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION= (ADDRESS=(PROTOCOL=tcp)(HOST=winhost1.com)(PORT=1521)) (CONNECT_DATA=(SID=orcldb)))
OK (60 msec)

Listener is also up and running
E:\>lsnrctl status

LSNRCTL for 32-bit Windows: Version 11.2.0.1.0 - Production on 29-JUL-2013 12:37:21

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=winhost1.com)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for 32-bit Windows: Version 11.2.0.1.0 - Production
Start Date                29-JUL-2013 07:42:58
Uptime                    0 days 4 hr. 54 min. 23 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   E:\oracle\product\11.2.0\dbhome_1\network\admin\listener.ora
Listener Log File         E:\oracle\diag\tnslsnr\winhost1\listener\alert\log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=winhost1.com)(PORT=1521)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
  Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "orcldb.us.oracle.com" has 1 instance(s).
  Instance "orcldb", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully

but if we login & start the database we get error 

E:\>set ORACLE_HOME=E:\oracle\product\11.2.0\dbhome_1
E:\>set PATH=%ORACLE_HOME%\bin;%PATH%
E:\>set ORACLE_SID=orcldb
E:\>sqlplus sys as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Mon Jul 29 12:50:28 2013
Copyright (c) 1982, 2010, Oracle.  All rights reserved.

Enter password:
Connected to an idle instance.

SQL> startup
ORA-01506: missing or illegal database name
SQL> exit
Disconnected


Solution:
Verify the content of parameter file used to start the database especially the db_name parameter. Provide correct name of the database and then start the database
Location of parameter file %ORACLE_HOME%\database
parameter file name: initorcldb.ora

E:\>sqlplus sys as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Mon Jul 29 12:55:28 2013
Copyright (c) 1982, 2010, Oracle.  All rights reserved.

Enter password:
Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area  518922240 bytes
Fixed Size                  1375676 bytes
Variable Size             159384132 bytes
Database Buffers          352321536 bytes
Redo Buffers                5840896 bytes
Database mounted.
Database opened.

SQL> select name, open_mode from v$database;

NAME      OPEN_MODE
--------- --------------------

ORCLDB    READ WRITE


Wednesday, July 24, 2013

Oracle 11g Installation Error


Issue: 
1. Even if all the oracle software installation pre requisites are met and the DISPLAY variable is set correctly, when running the runInstaller it is throwing error. 

2. When Starting the Listener there is ERROR Linux Error: 29: Illegal seek

Environment Details:
OS: Linux Server 5.8 64bit
Database Version: 11gR2
User: oracle
Software Location: /u01/stage/database

[oracle@linux01 ~]$ cd /u01/stage/database/
[oracle@linux01 database]$ ./runInstaller
Starting Oracle Universal Installer...
Checking Temp space: must be greater than 120 MB.   Actual 132493 MB    Passed
Checking swap space: must be greater than 150 MB.   Actual 22159 MB    Passed
Checking monitor: must be configured to display at least 256 colors.    Actual 65536    Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2013-07-13_09-24-35AM. Please wait ...[oracle@linux01 database]$ #
# An unexpected error has been detected by HotSpot Virtual Machine:
#
#  SIGILL (0x4) at pc=0x00000031d8614be0, pid=12186, tid=140422856902346
#
# Java VM: Java HotSpot(TM) 64-Bit Server VM (1.5.0_30-b03 mixed mode)
# Problematic frame:
# C  [ld-linux-x86-64.so.2+0x14be0]
#
# An error report file with more information is saved as hs_err_pid12186.log
#
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
#


[oracle@linux01 ~]$ lsnrctl start

LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 13-JUL-2013 10:34:58

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

Starting /u01/app/oracle/product/11.2.0/xe/bin/tnslsnr: please wait...

TNS-12537: TNS:connection closed
 TNS-12560: TNS:protocol adapter error
  TNS-00507: Connection closed

   Linux Error: 29: Illegal seek

Resolution: set the environment variable LD_BIND_NOW to 1 and then invoke the installer, it will go through. Setting the LD_BIND_NOW force the loader to do the Procedure Linkage Table fixups 

[oracle@linux01 database]$ export LD_BIND_NOW=1
[oracle@linux01 database]$ ./runInstaller

Monday, July 22, 2013

Weblogic Installation

Simple Weblogic Installation

Environment Details:
OS: Linux Server 5.8 64bit
Version: Weblogic Server 10.3.6
Installation location: /u01/app/oracle/product/fmw
User: oraem(We can have any user)

Steps to be executed as oraem user:

Step 1: First install 64 bit java of the desired version, here in our installation we are using Java 6u32 64 bit

execute the command ./jdk-6u32-linux-x64.bin, it will install the java in the particular directory 




Step 2: Invoke the command java -jar -d64 wls1036_generic.jar (here -d64 option installs 64bit version of weblogic)


Step 3: Click Next on the "Welcome Screen"


Step 4: Give the complete location where we are going to install the weblogic server and click Next



Step 5: In these screen the installer asks for the Oracle Support username password, which can be skipped by un checking the box and confirming to remained uninformed of critical issues by clicking Yes. Then click Next


Step 6: Click Custom and click Next


Step 7: This screen shows what all components we are going to install. Click Next



Step 8: Select the Java Home which we installed and uncheck the other java which was mentioned, and click Next


Step 9: Choose the Product Installation Directory, we can keep them as default and click Next


Step 10: Review the Installation Summary and click Next



Step 11: Installation Progress Screen



Step 12: The installation is over, uncheck the Run Quickstart box and click Done.




Note: After the installation is over the base domain can be created by invoking the config.sh script from location /u01/app/oracle/product/fmw/wlserver_10.3/common/bin.


Installation Issues/Error:

1. Sometime if there is a space issue on the server we may get the below mentioned error 
Fatal error encountered during self-extraction.[No space left on device]


To Resolve this we need to find a mount point where there is space available and then use the -Djava.io.tmpdiroption while doing the installation

[oraem@Linux1 stage]$ java -d64 -Djava.io.tmpdir=/u03/stage/temp -jar wls1036_generic.jar


2. In windows machine the -d64 option doesn't work and we may get the error: Could not create the Java virtual machine.

Simply invoke the installer by omitting that option(-d64)



Friday, July 12, 2013

Public Yum Configuration | Oracle Linux

Public Yum Configuration.

Operating System: Oracle Linux 5.8

Install the yum repos as follows:

Step 1. Login as a root user to the linux box and go to the location /etc/yum.repos.d

[root@host1 ~]# cd /etc/yum.repos.d/
[root@host1 yum.repos.d]# 

Step 2. Get the public yum file using the below mentioned command

[root@host1 yum.repos.d]#  wget http://public-yum.oracle.com/public-yum-el5.repo

Step 3. Open the file using a text editor (here I am using vi editor).

[root@host1 yum.repos.d]# vi /etc/yum.repos.d/public-yum-el5.repo

Step 4. Search for the below mentioned parameters 

ol5_u8_base and el5_addons and set the value for "enabled=1"





Step 5. This step is optional.

Type the following commands in a shell to check that your yum repository is configured correctly:

[root@host1 ~]#sudo yum repolist

The output should look like this:

el5_addons              |  951 B     00:00    
ol5_u8_base             |  1.1 kB    00:00    
repo id       repo name                             status
base          Red Hat Linux - Base                  enabled:3,024
el5_addons    Enterprise Linux 5 - x86_64 - addons  enabled:   93
ol5_u8_base   Oracle Linux 5 - U8 - x86_64 - base   enabled:4,551

Make sure that both the el5_addons and ol5_u8_base repos are listed. The list of repos can be different depending on the Linux version and current user's configuration of yum.