Wednesday, January 25, 2012

SP2-1503: Unable to initialize Oracle call interface SP2-0152: ORACLE may not be functioning properly

For a new project I have both a 10g and a 11g database running on the same host.

Both the databases instances were up and running fine, the processes can be seen below

-bash-3.2$ ps -ef | grep test
oracle   13727     1  0 Jan20 ?        00:00:00 ora_pmon_testteng
oracle   13729     1  0 Jan20 ?        00:00:00 ora_psp0_testteng
oracle   13731     1  0 Jan20 ?        00:00:01 ora_mman_testteng
oracle   13733     1  0 Jan20 ?        00:00:00 ora_dbw0_testteng
oracle   13735     1  0 Jan20 ?        00:00:00 ora_dbw1_testteng
oracle   13737     1  0 Jan20 ?        00:00:00 ora_dbw2_testteng
oracle   13739     1  0 Jan20 ?        00:00:00 ora_lgwr_testteng
oracle   13741     1  0 Jan20 ?        00:00:13 ora_ckpt_testteng
oracle   13743     1  0 Jan20 ?        00:00:05 ora_smon_testteng
oracle   13745     1  0 Jan20 ?        00:00:00 ora_reco_testteng
oracle   13747     1  0 Jan20 ?        00:00:03 ora_cjq0_testteng
oracle   13749     1  0 Jan20 ?        00:00:01 ora_mmon_testteng
oracle   13751     1  0 Jan20 ?        00:00:04 ora_mmnl_testteng
oracle   13753     1  0 Jan20 ?        00:00:00 ora_d000_testteng
oracle   13755     1  0 Jan20 ?        00:00:00 ora_s000_testteng
oracle   13761     1  0 Jan20 ?        00:00:00 ora_qmnc_testteng
oracle   13979     1  0 Jan20 ?        00:00:00 ora_q000_testteng
oracle   14007     1  0 Jan20 ?        00:00:03 ora_q001_testteng

oracle   29643     1  0 22:54 ?        00:00:00 ora_pmon_testdb1
oracle   29645     1  0 22:54 ?        00:00:00 ora_vktm_testdb1
oracle   29649     1  0 22:54 ?        00:00:00 ora_gen0_testdb1
oracle   29651     1  0 22:54 ?        00:00:00 ora_diag_testdb1
oracle   29653     1  0 22:54 ?        00:00:00 ora_dbrm_testdb1
oracle   29655     1  0 22:54 ?        00:00:00 ora_psp0_testdb1
oracle   29657     1  0 22:54 ?        00:00:00 ora_dia0_testdb1
oracle   29659     1  0 22:54 ?        00:00:01 ora_mman_testdb1
oracle   29661     1  0 22:54 ?        00:00:00 ora_dbw0_testdb1
oracle   29663     1  0 22:54 ?        00:00:00 ora_dbw1_testdb1
oracle   29665     1  0 22:54 ?        00:00:00 ora_dbw2_testdb1
oracle   29667     1  0 22:54 ?        00:00:00 ora_lgwr_testdb1
oracle   29669     1  0 22:54 ?        00:00:00 ora_ckpt_testdb1
oracle   29671     1  0 22:54 ?        00:00:00 ora_smon_testdb1
oracle   29673     1  0 22:54 ?        00:00:00 ora_reco_testdb1
oracle   29675     1  0 22:54 ?        00:00:00 ora_mmon_testdb1
oracle   29677     1  0 22:54 ?        00:00:00 ora_mmnl_testdb1
oracle   29679     1  0 22:54 ?        00:00:00 ora_d000_testdb1
oracle   29681     1  0 22:54 ?        00:00:00 ora_s000_testdb1
oracle   29704     1  0 22:54 ?        00:00:00 ora_qmnc_testdb1
oracle   29718     1  0 22:54 ?        00:00:00 ora_cjq0_testdb1
oracle   29729     1  0 22:54 ?        00:00:00 ora_q000_testdb1
oracle   29731     1  0 22:54 ?        00:00:00 ora_q001_testdb1
oracle   30227     1  0 23:04 ?        00:00:00 ora_smco_testdb1
oracle   30229     1  0 23:04 ?        00:00:00 ora_w000_testdb1
oracle   31137 27895  0 23:22 pts/3    00:00:00 grep test
-bash-3.2$

Here I execute the .profile for the 10g instance where I set the ORACLE_HOME, ORACLE_SID and PATH. I then tried to connect using
sqlplus. As seen below everything worked fine, and I was able to connect.


-bash-3.2$ . ./.bash_profile_ten
-bash-3.2$ echo $ORACLE_HOME
/u01/app/oracle/product/10.2.0/dbhome_1
-bash-3.2$ echo $ORACLE_SID
testteng
-bash-3.2$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on Tue Jan 24 23:20:02 2012

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


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options

SQL>

Next I executed the .profile for the 11g instance where I set the ORACLE_HOME, ORACLE_SID and PATH. I then tried to connect using
sqlplus. As seen below I got the SP2-1503 and the SP2-0152 error messages


-bash-3.2$ . ./.bash_profile
-bash-3.2$ echo $ORACLE_HOME
/u01/app/oracle/product/11.2.0/dbhome_1
-bash-3.2$ echo $ORACLE_SID
testdb1
-bash-3.2$ sqlplus / as sysdba
SP2-1503: Unable to initialize Oracle call interface
SP2-0152: ORACLE may not be functioning properly



Reason for the error message:
Find out what sqlplus you are using.
-bash-3.2$ which sqlplus
/u01/app/oracle/product/10.2.0/dbhome_1/bin/sqlplus
-bash-3.2$
-bash-3.2$ echo $PATH
/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/u01/app/oracle/product/10.2.0/dbhome_1/bin:/u01/app/oracle/product/11.2.0/dbhome_1/bin

The above showed that the sqlplus I was using was from the 10g. This was because the PATH to the 10g bin was ahead of 11g bin in the PATH variable.

Fix:
Edit to .profile for the 11g and remove the 10g path from the PATH variable.
After the edit the PATH variable should look like below

-bash-3.2$ echo $PATH
/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin::/u01/app/oracle/product/11.2.0/dbhome_1/bin
-bash-3.2$ echo $ORACLE_HOME
/u01/app/oracle/product/11.2.0/dbhome_1
-bash-3.2$ echo $ORACLE_SID
testdb1
-bash-3.2$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Tue Jan 24 23:57:17 2012

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


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

SQL>

2 comments:

sam said...

How can I fix this error in Windows 7. thanks

Mayur said...

Zuber, do you indeed have 10g and 11g Oracle running on your Windows7 box. If so, just point to the correct PATH on your Windows7 box to resolve the issue.