Friday, July 17, 2009

PLS-925 native compilation failed

As requested by one of our techies, I had to enable native compilation for database which is on 10.2.0.3 and Apps is on 12.0.6

This is done as follows:

ALTER SESSION SET PLSQL_CODE_TYPE='NATIVE';

which has a default value as INTERPRETED;

as required for a particular session .


The other two parameters for native compilation are:

PLSQL_NATIVE_LIBRARY_DIR
plsql_native_library_subdir_count

which have values well set for my instance.


But when I tested it with a test procedure,
native compilation failed with these errors.

PLS-00925: native compilation failed: Unable to create C file.


Checked with the file permissions for nativelib directory under $ORACLE_HOME/plsql

but still didnot work.


The reason is found to be

The directories required to store the shared libraries
generated as part of native PL/SQL compilation are not present.

I thought that the gcc compiler is not picking up the code.

So checked with the spnc_commands file under plsql directory ( which by default
should not have any problem)

The $ORACLE_HOME, I replaced it with actual path and retested which didnt work.

Finally, I discovered that the directories which the compiler
is trying to access under nativelib directory are not there as indicated by the
error.

PLS-925: native compilation failed: Unable to create C file

DB oracle home/plsql/nativelib/d_number/name.c

So created the directories manually
using mkdir -p d0 ------- d100

and then the compilation went fine as per the procedure.

2 comments:

  1. Its a very good note !! BTW, what is this spnc_commands you tried on plsql directory ? Can you please also let me know the method of your testing i.e., where and how do u compile pl/sql

    ReplyDelete
  2. spnc_commands is a file under plsql directory.And the testing is done by writing a small test procedure and compiling which was throwing error I said..

    Thanks

    ReplyDelete