Linux "symbol lookup error" loading OCI user callback exit
Date: Mon, 7 Oct 2013 17:24:41 -0600
Message-Id: <52A8510A-D61E-4A38-899A-92C8357D8508_at_centrexcc.com>
Hi all,
this is a question to those more versed in Linux than I am ( which comprises probably everybody )
I am looking for help with the OCI user callback exit. After Tanel Poder's Hotsos presentation many years ago about this exit I wrote one to display the sql sent to the database from the client program. I know for purely tracing the sql there are other options but I want to expand that user exit to show and do other things as well.
I am working on Linux 5 ( Linux hcmdb-85304.centrexcc.com 2.6.32-400.29.1.el5uek #1 SMP Tue Jun 11 15:16:42 PDT 2013 x86_64 x86_64 x86_64 GNU/Linux ) with Oracle 11.2.0.3. It's from a Oracle/Peoplesoft VM template converted to vmware Fusion.
I compiled and linked the user exit and it works as expected with SQLPlus:
[oracle_at_hcmdb-85304 demo]$ make -f ociucb.mk user_callback SHARED_LIBNAME=ociucb.so.1.0 OBJS=ocitrace.o
/usr/bin/gcc -fPIC -c -I/u01/app/oracle/product/11.2.0.x/db_1/rdbms/demo -I/u01/app/oracle/product/11.2.0.x/db_1/rdbms/public -I/u01/app/oracle/product/11.2.0.x/db_1/plsql/public -I/u01/app/oracle/product/11.2.0.x/db_1/network/public -I/u01/app/oracle/product/11.2.0.x/db_1/precomp/public ocitrace.c -DLINUX -DORAX86_64 -D_GNU_SOURCE -D_LARGEFILE64_SOURCE=1 -D_LARGEFILE_SOURCE=1 -DSLTS_ENABLE -DSLMXMX_ENABLE -D_REENTRANT -DNS_THREADS -DLONG_IS_64 -DSS_64BIT_SERVER -DLDAP_CM
/usr/bin/gcc -shared -L/u01/app/oracle/product/11.2.0.x/db_1/lib -o /u01/app/oracle/product/11.2.0.x/db_1/lib/ociucb.so.1.0 ocitrace.o
[oracle_at_hcmdb-85304 demo]$ sqlplus
SQL*Plus: Release 11.2.0.3.0 Production on Mon Oct 7 11:30:44 2013
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Enter user-name: sysadm_at_hr92p001
Enter password:
ServerDetach Exit
ServerAttach Exit
service = [hr92p001]
SessionBegin Exit
StmtPrepare Exit
sql_stmt = [SELECT USER FROM DUAL]
StmtPrepare Exit
sql_stmt = [BEGIN DBMS_OUTPUT.DISABLE; END;]
StmtPrepare Exit
sql_stmt = [SELECT ATTRIBUTE,SCOPE,NUMERIC_VALUE,CHAR_VALUE,DATE_VALUE FROM SYSTEM.PRODUCT_PRIVS WHERE (UPPER('SQL*Plus') LIKE UPPER(PRODUCT)) AND (USER LIKE USERID)]
StmtPrepare Exit
sql_stmt = [SELECT CHAR_VALUE FROM SYSTEM.PRODUCT_PRIVS WHERE (UPPER('SQL*Plus') LIKE UPPER(PRODUCT)) AND ((USER LIKE USERID) OR (USERID = 'PUBLIC')) AND (UPPER(ATTRIBUTE) = 'ROLES')]
StmtPrepare Exit
sql_stmt = [BEGIN DBMS_APPLICATION_INFO.SET_MODULE(:1,NULL); END;]
StmtPrepare Exit
sql_stmt = [SELECT DECODE('A','A','1','2') FROM DUAL]
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning and Oracle Label Security options
SQL> even when run from a different account:
[psadm2_at_hcmdb-85304 ~]$ sqlplus
SQL*Plus: Release 11.2.0.3.0 Production on Mon Oct 7 11:37:01 2013
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Enter user-name: sysadm_at_hr92p001
Enter password:
ServerDetach Exit
ServerAttach Exit
service = [hr92p001]
SessionBegin Exit
StmtPrepare Exit
sql_stmt = [SELECT USER FROM DUAL]
StmtPrepare Exit
sql_stmt = [BEGIN DBMS_OUTPUT.DISABLE; END;]
StmtPrepare Exit
sql_stmt = [SELECT ATTRIBUTE,SCOPE,NUMERIC_VALUE,CHAR_VALUE,DATE_VALUE FROM SYSTEM.PRODUCT_PRIVS WHERE (UPPER('SQL*Plus') LIKE UPPER(PRODUCT)) AND (USER LIKE USERID)]
StmtPrepare Exit
sql_stmt = [SELECT CHAR_VALUE FROM SYSTEM.PRODUCT_PRIVS WHERE (UPPER('SQL*Plus') LIKE UPPER(PRODUCT)) AND ((USER LIKE USERID) OR (USERID = 'PUBLIC')) AND (UPPER(ATTRIBUTE) = 'ROLES')]
StmtPrepare Exit
sql_stmt = [BEGIN DBMS_APPLICATION_INFO.SET_MODULE(:1,NULL); END;]
StmtPrepare Exit
sql_stmt = [SELECT DECODE('A','A','1','2') FROM DUAL]
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning and Oracle Label Security options
SQL> exit
SessionEnd Exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning and Oracle Label Security options
ServerDetach Exit
However, when I try to use it with one of the Peoplesoft executables, where I really want to use it, it fails
[psadm2_at_hcmdb-85304 ~]$ psae -CT ORACLE -CD HR92P001 -CO "PS" -CP "PS" -R TEST -I 1647 -AI TL_PYBST_RPT -OT 6 -FP "/home/psadm2/psft/pt/8.53/appserv/prcs/PRCSDOM/log_output/AE_TL_PYBST_RPT_1647/" -OF 14
psae: symbol lookup error: /u01/app/oracle/product/11.2.0.x/db_1/lib/ociucb.so.1.0: undefined symbol: OCISharedLibInit
[psadm2_at_hcmdb-85304 ~]$
I suspect it may have to do with the fact that the Peoplesoft executables are 32 bit, not 64 bit. I tried to install the 32 bit client in the psadm2 account and compile and link the user exit there but then I get "format" errors . I restored the snapshot I took before installing the 32 bit client so I can not easily look up the errors right now.
These are the Oracle related settings:
[psadm2_at_hcmdb-85304 ~]$ env | grep ORA
PS_DB=ORA
SQRDIR=/opt/oracle/psft/pt/tools/bin/sqr/ORA/bin
ORA_OCI_UCBPKG=ociucb
SQR_HOME=/opt/oracle/psft/pt/tools/bin/sqr/ORA
LD_LIBRARY_PATH=/opt/oracle/psft/pt/tools/jre/lib/amd64/native_threads:/opt/oracle/psft/pt/tools/jre/lib/amd64/server:/opt/oracle/psft/pt/tools/jre/lib/amd64:/opt/oracle/psft/pt/bea/tuxedo/bin:/opt/oracle/psft/pt/bea/tuxedo/lib:/opt/oracle/psft/pt/tools/bin:/opt/oracle/psft/pt/tools/bin/interfacedrivers:/opt/oracle/psft/pt/tools/bin/sqr/ORA/bin:/opt/oracle/psft/pt/tools/optbin:/opt/oracle/psft/pt/tools/verity/linux/_ilnx21/bin:/u01/app/oracle/product/11.2.0.x/db_1/lib:/u01/app/oracle/product/11.2.0.x/db_1/lib
ORACLE_SID=HR92P001
PATH=/opt/oracle/psft/pt/tools/jre/bin:/opt/oracle/psft/pt/tools/appserv:/opt/oracle/psft/pt/tools/setup:/opt/oracle/psft/pt/bea/tuxedo/bin:.:/u01/app/oracle/product/11.2.0.x/db_1/bin:/u01/app/oracle/product/11.2.0.x/db_1/OPatch:/u01/app/oracle/product/11.2.0.x/db_1/perl/bin:/usr/local/bin:/bin:/usr/bin:/opt/oracle/psft/pt/tools/bin:/opt/oracle/psft/pt/tools/bin/sqr/ORA/bin:/opt/oracle/psft/pt/tools/verity/linux/_ilnx21/bin:/home/psadm2/bin
ORACLE_HOME=/u01/app/oracle/product/11.2.0.x/db_1
Can anyone suggest what might be the problem or suggest what to do to troubleshoot.
Thank you
-- http://www.freelists.org/webpage/oracle-lReceived on Tue Oct 08 2013 - 01:24:41 CEST