Thursday, February 23, 2012

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


When running a OS script via a job on Enterprise Manager 11g the following error may occur when calling SQL*plus:

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

The problem relates to the environment variable settings used by SQL*Plus, specifically the LD_LIBRARY_PATH variables.

There is a metalink note describing this error:
Sp2-1503 And Sp2-0152 When Running SQL Script Job From Grid Control [ID 1226083.1]

For a solution set the LD_LIBRARY_PATH (or LD_LIBRARY_PATH_64) variable after setting up the environment (for example after setting oraenv).

Example:

# setup the Oracle environment without being prompted

export ORACLE_SID=AAA
export ORAENV_ASK=NO
. /usr/local/bin/oraenv

#LD_LIBRARY_PATH
export LD_LIBRARY_PATH=${ORACLE_HOME}/lib:${LD_LIBRARY_PATH}

#LD_LIBRARY_PATH_64
export LD_LIBRARY_PATH_64=${LD_LIBRARY_PATH}
If the above don't work also try LD_LIBRARY_PATH64.

On 32-bit Linux the lib directory under the ORACLE_HOME is $ORACLE_HOME/lib32 so set:
export LD_LIBRARY_PATH=${ORACLE_HOME}/lib32:${LD_LIBRARY_PATH}

2 comments:

  1. To all who are looking for a solution to this....

    I had the same issue above. I installed Oracle 10G R2 on my Windows 7 laptop. Though I had no issues during install I wasn't able to run sqlplus, either via the gui or through the command prompt. I didn't find anyone covering a solution for this besides installing Oracle 11.6, but I did find a solution.

    Run sqlplus as administrator. I just right-clicked on the shortcut for the gui app and selected "Run as Administrator" and SQLPlus ran just fine. I'm not sure how to use this information to run it in command mode but I'm sure it's possible.

    Hope this helps someone.

    ReplyDelete
  2. Thanks for your comments.

    I had similar problem the other day denstalling 12c from the command line, so I ran deinstall.bat as administrator and worked.

    You can 'runas' command to run on the command line as another user.

    Examples:
    > runas /noprofile /user:mymachine\administrator cmd
    > runas /profile /env /user:mydomain\admin "mmc %windir%\system32\dsa.msc"
    > runas /env /user:user@domain.microsoft.com "notepad \"my file.txt\""

    ReplyDelete