Oracle Database 11g and Ubuntu 11.10 Oneiric Ocelot

If you’ve upgraded your laptop to Ubuntu 11.10 Oneiric Ocelot and want to install an Oracle Database Software for strictly self-educational purposes, you might be very annoyed by a small change in the way gcc checks its references when linking.

Note:
Don’t use Ubuntu with any Oracle Database other than XE or for self-educational purposes

So assuming you are using the best blog to perform such a dangerous task as installing Oracle on Ubuntu, you should still hit the message below :

Investigations

Looking at the logs, using the nm command and googling the web, you’ll find first a weird message suggesting the nnz11 library (that is an Oracle library!) is missing:

INFO: /usr/bin/gcc -m32  -o /u01/app/oracle/product/11.2.0/db_1/sysman/lib/emdctl -L/u01/app/oracle/product/11.2.0/db_1/lib/ -L/u01/app/oracle/product/11.2.0/db_1/sysman/lib/ -L/u01/app/oracle/product/11.2.0/db_1/lib/stubs/       `cat /u01/app/oracle/product/11.2.0/db_1/lib/sysliblist` -Wl,-rpath,/u01/app/oracle/product/11.2.0/db_1/lib -lm    `cat /u01/app/oracle/product/11.2.0/db_1/lib/sysliblist` -ldl -lm   -L/u01/app/oracle/product/11.2.0/db_1/lib /u01/app/oracle/product/11.2.0/db_1/sysman/lib//s0nmectl.o -lnm
INFO: ectl -lclntsh -L/u01/app/oracle/product/11.2.0/db_1/lib  -L/u01/app/oracle/product/11.2.0/db_1/sysman/lib/ -lnmemso -lcore11 -Wl,-rpath,/u01/app/oracle/product/11.2.0/db_1/lib/:/u01/app/oracle/product/11.2.0/db_1/sysman/lib/:/u01/app/oracle/product/11.2.0/db_1/jdk/jre/lib/i386/client:/u01/app/oracle/product/11.2.0/db_1/jdk/jre/lib/i386 -L/u01/app/oracle/product/11.2.0/db_1/jdk/jre/lib/i386/client -L/u01/app/oracle/product/11.2.0/db_1/jdk/jre/lib/i386 -z lazyload -ljava -ljvm -lverify -z nolazyload -Wl,-rpat
INFO: h,/u01/app/oracle/product/11.2.0/db_1/lib/:/u01/app/oracle/product/11.2.0/db_1/sysman/lib/:/u01/app/oracle/product/11.2.0/db_1/jdk/jre/lib/i386/client:/u01/app/oracle/product/11.2.0/db_1/jdk/jre/lib/i386 -Wl,--allow-shlib-undefined    `cat /u01/app/oracle/product/11.2.0/db_1/lib/sysliblist` -ldl -lm

INFO: /usr/bin/ld: warning: -z lazyload ignored.
/usr/bin/ld: warning: -z nolazyload ignored.
/usr/bin/ld: /u01/app/oracle/product/11.2.0/db_1/sysman/lib//libnmectl.a(nmectlt.o): undefined reference to symbol 'B_DestroyKeyObject'
/usr/bin/ld: note: 'B_DestroyKeyObject' is defined in DSO /u01/app/oracle/product/11.2.0/db_1/lib/libnnz11.so so try adding it to the linker command line
/u01/app/oracle/product/11.2.0/db_1/lib/libnnz11.so: could not read symbols: Invalid operation

INFO: collect2: ld returned 1 exit status

INFO: make[1]: *** [/u01/app/oracle/product/11.2.0/db_1/sysman/lib/emdctl] Error 1

INFO: make[1]: Leaving directory `/u01/app/oracle/product/11.2.0/db_1/sysman/lib'

INFO: make: *** [emdctl] Error 2

If you correct that error and continue, you’ll find another library asmclntsh11 missing too:

INFO: /usr/bin/gcc -m32  -o /u01/app/oracle/product/11.2.0/db_1/rdbms/lib/kfod -m32 -L/u01/app/oracle/product/11.2.0/db_1/rdbms/lib/ -L/u01/app/oracle/product/11.2.0/db_1/lib/ -L/u01/app/oracle/product/11.2.0/db_1/lib/stubs/ -L/u01/app/oracle/product/11.2.0/db_1/lib/ -lirc -lipgo   /u01/app/oracle/product/11.2.0/db_1/lib/s0main.o /u01/app/oracle/product/11.2.0/db_1/rdbms/lib/sskfoded.o /u01/app/oracle/product/11.2.0/db_1/rdbms/lib/skfodpt.o /u01/app/oracle/product/11.2.0/db_1/rdbms/lib/kfod.o /u01/app/oracle/prod
INFO: uct/11.2.0/db_1/lib/libgeneric11.a -ldbtools11 /u01/app/oracle/product/11.2.0/db_1/lib/libgeneric11.a -lcommon11 -lcell11 -lskgxp11 /u01/app/oracle/product/11.2.0/db_1/lib/libcore11.a -lhasgen11 -lskgxn2 -lnnz11 -lzt11 -lxml11 -locr11 -locrb11 -locrutl11 -lhasgen11 -lskgxn2 -lnnz11 -lzt11 -lxml11  -lasmclnt11 -lclntsh  `cat /u01/app/oracle/product/11.2.0/db_1/lib/ldflags`    -lncrypt11 -lnsgr11 -lnzjs11 -ln11 -lnl11 -lnro11 `cat /u01/app/oracle/product/11.2.0/db_1/lib/ldflags`    -lncrypt11 -lnsgr11 -lnzjs1
INFO: 1 -ln11 -lnl11 -lnnz11 -lzt11 -lztkg11 -lztkg11 -lclient11 -lnnetd11  -lvsn11 -lcommon11 -lgeneric11 -lmm -lsnls11 -lnls11  -lcore11 -lsnls11 -lnls11 -lcore11 -lsnls11 -lnls11 -lxml11 -lcore11 -lunls11 -lsnls11 -lnls11 -lcore11 -lnls11 `cat /u01/app/oracle/product/11.2.0/db_1/lib/ldflags`    -lncrypt11 -lnsgr11 -lnzjs11 -ln11 -lnl11 -lnro11 `cat /u01/app/oracle/product/11.2.0/db_1/lib/ldflags`    -lncrypt11 -lnsgr11 -lnzjs11 -ln11 -lnl11 -lclient11 -lnnetd11  -lvsn11 -lcommon11 -lgeneric11   -lsnls11 -lnls1
INFO: 1  -lcore11 -lsnls11 -lnls11 -lcore11 -lsnls11 -lnls11 -lxml11 -lcore11 -lunls11 -lsnls11 -lnls11 -lcore11 -lnls11 -lclient11 -lnnetd11  -lvsn11 -lcommon11 -lgeneric11 -lsnls11 -lnls11  -lcore11 -lsnls11 -lnls11 -lcore11 -lsnls11 -lnls11 -lxml11 -lcore11 -lunls11 -lsnls11 -lnls11 -lcore11 -lnls11   `cat /u01/app/oracle/product/11.2.0/db_1/lib/sysliblist` -Wl,-rpath,/u01/app/oracle/product/11.2.0/db_1/lib -lm    `cat /u01/app/oracle/product/11.2.0/db_1/lib/sysliblist` -ldl -lm   -L/u01/app/oracle/product/11.
INFO: 2.0/db_1/lib

INFO: /u01/app/oracle/product/11.2.0/db_1/lib//libocrb11.so: undefined reference to `kgfoOpenFile'
/u01/app/oracle/product/11.2.0/db_1/lib//libocrb11.so: undefined reference to `kgfoCreateCtxExt'
/u01/app/oracle/product/11.2.0/db_1/lib//libocrb11.so: undefined reference to `kgfoIO'
/u01/app/oracle/product/11.2.0/db_1/lib//libocrb11.so: undefined reference to `kgfoFnameMax'
/u01/app/oracle/product/11.2.0/db_1/lib//libocrb11.so: undefined reference to `kgfoCommit2P'
/u01/app/oracle/product/11.2.0/db_1/lib//libocrb1
INFO: 1.so: undefined reference to `kgfoCheckHdl'
/u01/app/oracle/product/11.2.0/db_1/lib//libocrb11.so: undefined reference to `kgfoRenameFile'
/u01/app/oracle/product/11.2.0/db_1/lib//libocrb11.so: undefined reference to `kgfoDeleteFile'
/u01/app/oracle/product/11.2.0/db_1/lib//libocrb11.so: undefined reference to `kgfoCloseFile'
/u01/app/oracle/product/11.2.0/db_1/lib//libocrb11.so: undefined reference to `kgfoErrorMessage'
/u01/app/oracle/product/11.2.0/db_1/lib//libocrb11.so: undefined reference to `kgfoGetS
INFO: ize'
/u01/app/oracle/product/11.2.0/db_1/lib//libocrb11.so: undefined reference to `kgfoCreateFile'
/u01/app/oracle/product/11.2.0/db_1/lib//libocrb11.so: undefined reference to `kgfoOpenDirty'
/u01/app/oracle/product/11.2.0/db_1/lib//libocrb11.so: undefined reference to `kgfoCheckMount'
/u01/app/oracle/product/11.2.0/db_1/lib//libocrb11.so: undefined reference to `kgfoDestroyCtx'
/u01/app/oracle/product/11.2.0/db_1/lib//libocrb11.so: undefined reference to `kgfoControl'
/u01/app/oracle/product/11.2.0/db_1/
INFO: lib//libocrb11.so: undefined reference to `kgfoCreate2P'
collect2: ld returned 1 exit status

INFO: make: *** [/u01/app/oracle/product/11.2.0/db_1/rdbms/lib/kfod] Error 1

But the worse is yet to come since you’ll find links that already reference a library included in the command… in the wrong place. And, last but not least, a cycle between library references.

Cause and Fix

The reason behind the issue is actually a change with the default symbol reference check behavior that has been introduced in gcc by Debian. This change has also been considered for Fedora 14 but is probably not implemented since Tim Hall installed Oracle no issue on the 16th Release of the distribution.

Anyway, Ubuntu suggests to report a bug to the software provider. Obviously I did not ;-)! Instead, I’ve added the ugly -Wl,--no-as-needed parameter to the scripts. How ? Probably not in the best way for sure but in a way that works:

1- during the installation, press the « Continue » button until you reach the installer end (It should be 5 times if I’ve counted well). Then run the root.sh script and finish the installation

2- Once the installation done, change the content of the various makefiles :

  • sysman/lib/ins_emagent.mk

replace:

$(SYSMANBIN)emdctl:
        $(MK_EMAGENT_NMECTL)

with:

$(SYSMANBIN)emdctl:
        $(MK_EMAGENT_NMECTL) -lnnz11
  • rdbms/lib/env_rdbms.mk

replace:

KFED_LINKLINE=$(LINK) $(S0MAIN) $(SSKFEDED) $(SKFEDPT)

with:

KFED_LINKLINE=$(LINK) $(S0MAIN) -Wl,--no-as-needed $(SSKFEDED) $(SKFEDPT)

replace:

KFOD_LINKLINE=$(LINK) $(S0MAIN) $(SSKFODED) $(SKFODPT) $(KFODOBJ)

with:

KFOD_LINKLINE=$(LINK) $(S0MAIN) -Wl,--no-as-needed $(SSKFODED) $(SKFODPT)

replace:

KFNDG_LINKLINE=$(LINK) $(S0MAIN) $(SSKFNDGED) $(SKFNDGPT) $(KFNDGOBJ)

with:

KFNDG_LINKLINE=$(LINK) $(S0MAIN) -Wl,--no-as-needed $(SSKFNDGED)

replace:

AMDU_LINKLINE=$(LINK) $(S0MAIN) $(SSKFMUED) $(SKFMUPT)

with:

AMDU_LINKLINE=$(LINK) $(S0MAIN) -Wl,--no-as-needed $(SSKFMUED) $(SKFMUPT)

replace

ORACLE_KERNEL_LIBS=$(LLIBSKGTR) $(LLIBPERFSRV) $(NAETTOBJS) $(CONFIG)
         $(SPOBJS) $(LLIBSERVER) $(LLIBODM) $(LLIBSAGE)

with

ORACLE_KERNEL_LIBS=$(LLIBSKGTR) $(LLIBPERFSRV) $(NAETTOBJS) $(CONFIG)
        $(SPOBJS) -Wl,--no-as-needed $(LLIBSERVER) $(LLIBODM) $(LLIBSAGE)
  • bin/genorasdksh

replace

$LD $LD_RUNTIME $LD_OPT $LD_OUT $LD_SELF_CONTAINED $BASE_LIB

with

$LD $LD_RUNTIME -Wl,--no-as-needed $LD_OPT $LD_OUT $LD_SELF_CONTAINED $BASE_LIB
  • srvm/lib/env_srvm.mkins_srvm.mk

replace

GETCRSHOME_LINKLINE=$(LINK) $(LDPATHFLAG)$(RDBMSLIB) $(CDEBUG) $(OPT) 
                $(GETCRSHOME_OBJ1) $(OCRLIBS_DEFAULT) $(LLIBCLNTSH)

with

GETCRSHOME_LINKLINE=$(LINK) $(LDPATHFLAG)$(RDBMSLIB) $(CDEBUG) $(OPT) 
                $(GETCRSHOME_OBJ1) -Wl,--no-as-needed $(OCRLIBS_DEFAULT) $(LLIBCLNTSH)
  • network/lib/env_network.mk

replace

TNSLSNR_LINKLINE=$(LINK) $(TNSLSNR_OFILES) $(LINKTTLIBS) $(LLIBONS)

with

TNSLSNR_LINKLINE=$(LINK) $(TNSLSNR_OFILES) -Wl,--no-as-needed $(LINKTTLIBS) $(LLIBONS)

3- Once the .mk files modified, relink the Oracle software as below; change the $ORACLE_HOME according to your configuration :

export ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_2
export PATH=$ORACLE_HOME/bin:$PATH
cd $ORACLE_HOME/bin
relink all
cd .. 
grep Error install/relink.log

Et voila! Hopefully it will now work as well as with the Narwhal…

Gregory Guillou

About Gregory Guillou

Gregory Guillou has written 760 post in this blog.

Senior Technical Architect at Easyteam

20 thoughts on “Oracle Database 11g and Ubuntu 11.10 Oneiric Ocelot

  1. Anonymous

    I think there is an error in this part (last part of replace line missing):

    replace:
    KFNDG_LINKLINE=$(LINK) $(S0MAIN) $(SSKFNDGED) $(SKFNDGPT) $(KFNDGOBJ)
    with:
    KFNDG_LINKLINE=$(LINK) $(S0MAIN) -Wl,–no-as-needed $(SSKFNDGED)

    I corrected the replace string to
    KFNDG_LINKLINE=$(LINK) $(S0MAIN) -Wl,–no-as-needed $(SSKFNDGED) $(SKFNDGPT) $(KFNDGOBJ)

    and then it seemed to work.

  2. Anonymous

    Thanks to suggestions from Jeremy Schnieder, Arkzoyd and the FTDTeam I was able to finally install Oracle Enterprise Edition 11.2.0.1.0 on Ubuntu Oneiric (11:10).
    I followed the initial setup suggestions from FTDTeam, until the point where I encountered linker errors:
    http://ftdteam.wordpress.com/2012/02/15/oracle-database-11g-release-2-%CF%83%CF%84%CE%BF-ubuntu-server-11-10-64-bit/

    Somehow I was not able to resolve the RDBMS linker errors with the suggestions from FTDTeam.

    So for the make, linker errors I followed the instructions listed in the 2nd comment to this post, from Jeremy Schneider.

    Thanks once again.
    Sandesh

  3. Anonymous

    Thank you for this post, it very useful for us.
    But I have problem with message:
    Error in invoking target ‘client_sharedlib’ of makefile ‘…ins_rdbms.mk’.

    sysctl.conf is changed correctly.

    Do you have any ideas about it? Thank you again

  4. Henrique Lima

    Thanks so much for this post.

    I was trying to install Oracle 11g r2 in Ubuntu 11 and was getting those same errors.

    I just followed the steps you have described as the errors were being shown by the OUI.

    It worked and I got a successful installation.

    Thanks so much for your post!!

  5. indapublic

    I have error « Error in invoking target ‘all_no_orcl’ of makefile ‘/home/oracle/base/product/11gR2/db/rdbms/lib/ins_rdbms.mk’. See ‘/home/oracle/oraInventory/logs/installActions2012-02-13_10-10-01AM.log’ for details »

    I search by this warning and found: its problem of libstdc++. But i not have need experience for fix it

  6. ArKZoYD

    Hi,

    I’m sorry 2x :
    - I cannot do much with something like « It doesn’t work ». It kind of hard to guess what doesn’t work in your case.
    - Even if you could provide me access to your System, I don’t have time to fix things for you.

    Now, the very good news for you are :
    - It’s very likely you can make it work. Several people made it work like the comments suggest (read Jeremy’s method for example)
    - You have a nice opportunity to learn about make and the Oracle linking process here.

    Again: have fun with Oracle on Ubuntu ! And if you’re looking for an easier way, get Virtualbox for Ubuntu

    Gregory

  7. ArKZoYD

    They work by peer! env_rdbms.mk set the env for ins_rdbms.mk.

    This blog provide hints not support. It sounds like it has helped several people to achieve the install but they probably had to enhance the method. Unfortunately it requires to know about the make process.

    I remind you that Oracle 11.2 is not supported on Ubuntu or Fedora except for XE. Oracle Enterprise Linux and Virtualbox are free of charge, btw. It’s probably the best way to learn.

    This said, I encourage you to get to the end of the install by figuring out the error messages and by fixing them. It’s very likely they are due to the change in the gcc linkage.

    Enjoy

  8. Sune Hansen

    I don’t care whether you came up with all this yourself – you are now my personal hero, since there is no way I would have gotten this far without your instructions.

    Worked like a charm – I had an issue with GETCRSHOME_LINKLINE being in ins_srvm.mk rather than env_srvm.mk, but it really wasn’t bothersome.

  9. Jeremy Schneider

    Great post – thanks! Got me through 11gR2 installation (OTN version) on Oneiric. FYI, there’s one thing that seemed to be a mistake in your post and I did a few things differently just because of my own preferences.

    I tried to use the copy-dt-needed-entries wherever possible… thought this was a bit cleaner than no-as-needed. However it only worked in one case.

    Also, I never « skipped » a step in the installer – I just changed the files whenever an error came up, and then hit « retry »… so my installation finished with a « success » message.

    Here were my steps:

    sysman/lib/ins_emagent.mk:
    LDFLAGS=-Wl,–copy-dt-needed-entries -o $@ …

    i didn’t need any changes to rdbms/lib/env_rdbms.mk at this point

    bin/genorasdksh:
    LD= »gcc -Wl,–no-as-needed -shared …
    [basically same as what you did]

    srvm/lib/env_srvm.mk: [MISTAKE: wrong filename]
    srvm/lib/ins_srvm.mk:
    GETCRSHOME_LINKLINE=$(LINK) -Wl,–no-as-needed $(LDPATHFLAG)$(RDBMSLIB) …
    [basically same as what you did]

    network/lib/env_network.mk:
    TNSLSNR_LINKLINE=$(LINK) -Wl,–no-as-needed $(TNSLSNR_OFILES) …
    [basically same as what you did]

    rdbms/lib/env_rdbms.mk: first error on this file was now, for main oracle binary… this change fixed it
    ORACLE_LINKER=$(ADE_DEL_FILE_CMD) $(PURECMDS) gcc -Wl,–no-as-needed $(OLAPPRELINKOPTS) $(LDFLAGS) $(COMPSOBJS)

  10. Anonymous

    Thank you so much for this. I had started out tracking down each linking error and found there was some issue with default symbol reference. I had started to use an older version of GCC but this messed up other things and you saved me a ton of work. Please note that the compiled oracle executable will reference /dev/shm which now exists in ubuntu as /run/shm. There are posts for using okteta to modify the compiled executable. It is much easier than trying to use a mount script since the symbolic link of /dev/shm does not work. Thanks again.