Wednesday, August 11, 2010

PLS-00923: native compilation failed

Symptoms :
Attempting to implement Native Compilation on a 10g Database fails with an error :PLS-00923: native compilation failed: C compilation or linking failed

plsql_code_type parameter  was set  to   native and plsql_native_library_dir was  set 

Compiling  the  packages  give error : PLS-00923: native compilation failed: C compilation or linking failed:spdzj.c:Could not invoke program /opt/SunProd/SUNWspro8/bin/cc:No such file or directory

Cause:
The wrong/invalid compiler is being referenced within the spnc_commands file.
Take the compiler and path referenced in the error message and at the OS prompt execute the 'ls' command.
The error "No such file or directory" is returned confirming why it can not be invoked

ls  -lrt   /opt/SunProd/SUNWspro8/bin/cc

Solution:
  1. Find a  compiler
    which cc
    /usr/bin/cc
  2. Modify  $ORACLE_HOME/plsql/spnc_commands that uses  new  compiler.for this example  change  /opt/SunProd/SUNWspro8/bin/cc  with  /usr/bin/cc  in the  file
  3. Backup to session and  recompile (It may  needed  to restart the database )
  4. check   the  directory  that  referenced in plsql_native_library_dir   parameter  There will  be  some  compiled  c  files

No comments: