Skip to end of metadata
Go to start of metadata

As usual this thing cannot do what most other software can, without trouble. But that is because it costs an arm and a leg, obviously. So, if you really cannot use the excellent PostgreSQL database - here goes...

Download software

Install packages:

sudo apt install libc6-i386
sudo apt install gcc-multilib g++-multilib libc6-dev-i386 libstdc++6:i386
sudo apt install alien autoconf automake autotools-dev elfutils rpm rpm-common
sudo apt install build-essential debhelper expat gawk gsfonts-x11 html2text sysstat
sudo apt install unixodbc unixodbc-dev doxygen ksh openssh-server pax perl-doc rlwrap
sudo apt install lsb lsb-core zlibc
sudo apt install lib32z1-dev lib32ncurses5 libaio1 libaio-dev
sudo apt install libelf-dev libodbcinstq4-1 libpth-dev libpthread-stubs0-dev libpthread-workqueue0 libpthread-workqueue-dev
sudo apt-get install libtiff5-dev libzthread-dev libqt4-opengl:i386 libodbcinstq4-1:i386 libglu1-mesa:i386
sudo apt-get install -s cabextract
sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt update
sudo apt install wimtools libwim-dev
sudo apt install -s libbz2-dev:i386

Create soft links:

sudo ln -s /usr/bin/basename /bin/basename
sudo ln -s bin/bash /usr/bin/bash
sudo ln -sf /bin/bash /bin/sh
sudo ln -s /usr/bin/rpm /bin/rpm
sudo ln -s /usr/bin/awk /bin/awk
sudo ln -s /usr/lib/x86_64-linux-gnu /usr/lib64
sudo ln -s /usr/lib/x86_64-linux-gnu/libstdc++.so.6 /lib64/libstdc++.so.6
sudo ln -s /lib/x86_64-linux-gnu/libgcc_s.so.1 /lib64/libgcc_s.so.1
sudo ln -s /usr/lib/i386-linux-gnu/libpthread_nonshared.a /usr/lib/libpthread_nonshared.a
sudo ln -s /lib/lsb/init-functions /etc/init.d/functions

And some more for programs:


if [ -z "$BASH_VERSION" -o -n "$ORALD_USE_GCC" ] ; then
  exec gcc "$@"
  exit 1
fi

Change the link options in bin/orald:

add the -no-pie option to gcc in here:

if [ -z "$BASH_VERSION" -o -n "$ORALD_USE_GCC" ] ; then
  exec gcc -no-pie "$@"
  exit 1
fi



The proper option is -no-pie with a SINGLE dash before it! Having two dashes does not seem to report an error but the option does not work!!

Now start the installer and run it WITHOUT creating a database.

After a while you will get link errors. At that time edit then execute the following script:

#!/bin/bash

# Change the path below to point to your installation
export $ORACLE_HOME=/opt/oracle/12cr2

sudo ln -s $ORACLE_HOME/lib/libclntshcore.so.12.1 /usr/lib
sudo ln -s $ORACLE_HOME/lib/libclntsh.so.12.1 /usr/lib

cp $ORACLE_HOME/rdbms/lib/ins_rdbms.mk $ORACLE_HOME/rdbms/lib/ins_rdbms.bkp
cp $ORACLE_HOME/rdbms/lib/env_rdbms.mk $ORACLE_HOME/rdbms/lib/env_rdbms.bkp

sed -i 's/\$(ORAPWD_LINKLINE)/\$(ORAPWD_LINKLINE) -lnnz12/' $ORACLE_HOME/rdbms/lib/ins_rdbms.mk
sed -i 's/\$(HSOTS_LINKLINE)/\$(HSOTS_LINKLINE) -lagtsh/' $ORACLE_HOME/rdbms/lib/ins_rdbms.mk
sed -i 's/\$(EXTPROC_LINKLINE)/\$(EXTPROC_LINKLINE) -lagtsh/' $ORACLE_HOME/rdbms/lib/ins_rdbms.mk
sed -i 's/\$(OPT) \$(HSOTSMAI)/\$(OPT) -Wl,--no-as-needed \$(HSOTSMAI)/' $ORACLE_HOME/rdbms/lib/env_rdbms.mk
sed -i 's/\$(OPT) \$(HSDEPMAI)/\$(OPT) -Wl,--no-as-needed \$(HSDEPMAI)/' $ORACLE_HOME/rdbms/lib/env_rdbms.mk
sed -i 's/\$(OPT) \$(EXTPMAI)/\$(OPT) -Wl,--no-as-needed \$(EXTPMAI)/' $ORACLE_HOME/rdbms/lib/env_rdbms.mk
sed -i 's/^\(TNSLSNR_LINKLINE.*\$(TNSLSNR_OFILES)\) \(\$(LINKTTLIBS)\)/\1 -Wl,--no-as-needed \2/g' $ORACLE_HOME/network/lib/env_network.mk
sed -i 's/\$(SPOBJS) \$(LLIBSERVER)/\$(SPOBJS) -Wl,--no-as-needed \$(LLIBSERVER)/' $ORACLE_HOME/rdbms/lib/env_rdbms.mk
sed -i 's/\$(S0MAIN) \$(SSKFEDED)/\$(S0MAIN) -Wl,--no-as-needed \$(SSKFEDED)/' $ORACLE_HOME/rdbms/lib/env_rdbms.mk
sed -i 's/\$(S0MAIN) \$(SSKFODED)/\$(S0MAIN) -Wl,--no-as-needed \$(SSKFODED)/' $ORACLE_HOME/rdbms/lib/env_rdbms.mk
sed -i 's/\$(S0MAIN) \$(SSKFNDGED)/\$(S0MAIN) -Wl,--no-as-needed \$(SSKFNDGED)/' $ORACLE_HOME/rdbms/lib/env_rdbms.mk
sed -i 's/\$(S0MAIN) \$(SSKFMUED)/\$(S0MAIN) -Wl,--no-as-needed \$(SSKFMUED)/' $ORACLE_HOME/rdbms/lib/env_rdbms.mk
sed -i 's/^\(ORACLE_LINKLINE.*\$(ORACLE_LINKER)\) \($(PL_FLAGS)\)/\1 -Wl,--no-as-needed \2/g' $ORACLE_HOME/rdbms/lib/env_rdbms.mk
sed -i 's/\$LD \$LD_RUNTIME/$LD -Wl,--no-as-needed \$LD_RUNTIME/' $ORACLE_HOME/bin/genorasdksh
sed -i 's/\$(GETCRSHOME_OBJ1) \$(OCRLIBS_DEFAULT)/\$(GETCRSHOME_OBJ1) -Wl,--no-as-needed \$(OCRLIBS_DEFAULT)/' $ORACLE_HOME/srvm/lib/env_srvm.mk

sed -i 's/LDDISABLENEWDTAGS=-Wl,--disable-new-dtags/LDDISABLENEWDTAGS=-Wl,--no-as-needed,--disable-new-dtags/' $ORACLE_HOME/rdbms/lib/env_rdbms.mk
sed -i 's/LDDISABLENEWDTAGS=-Wl,--disable-new-dtags/LDDISABLENEWDTAGS=-Wl,--no-as-needed,--disable-new-dtags/' $ORACLE_HOME/crs/lib/env_has.mk;
sed -i 's/LDDISABLENEWDTAGS=-Wl,--disable-new-dtags/LDDISABLENEWDTAGS=-Wl,--no-as-needed,--disable-new-dtags/' $ORACLE_HOME/odbc/lib/env_odbc.mk;
sed -i 's/LDDISABLENEWDTAGS=-Wl,--disable-new-dtags/LDDISABLENEWDTAGS=-Wl,--no-as-needed,--disable-new-dtags/' $ORACLE_HOME/precomp/lib/env_precomp.mk;
sed -i 's/LDDISABLENEWDTAGS=-Wl,--disable-new-dtags/LDDISABLENEWDTAGS=-Wl,--no-as-needed,--disable-new-dtags/' $ORACLE_HOME/srvm/lib/env_srvm.mk;
sed -i 's/LDDISABLENEWDTAGS=-Wl,--disable-new-dtags/LDDISABLENEWDTAGS=-Wl,--no-as-needed,--disable-new-dtags/' $ORACLE_HOME/network/lib/env_network.mk;
sed -i 's/LDDISABLENEWDTAGS=-Wl,--disable-new-dtags/LDDISABLENEWDTAGS=-Wl,--no-as-needed,--disable-new-dtags/' $ORACLE_HOME/ldap/lib/env_ldap.mk;
sed -i 's/LDDISABLENEWDTAGS=-Wl,--disable-new-dtags/LDDISABLENEWDTAGS=-Wl,--no-as-needed,--disable-new-dtags/' $ORACLE_HOME/ord/im/lib/env_ordim.mk;
sed -i 's/LDDISABLENEWDTAGS=-Wl,--disable-new-dtags/LDDISABLENEWDTAGS=-Wl,--no-as-needed,--disable-new-dtags/' $ORACLE_HOME/plsql/lib/env_plsql.mk;
sed -i 's/LDDISABLENEWDTAGS=-Wl,--disable-new-dtags/LDDISABLENEWDTAGS=-Wl,--no-as-needed,--disable-new-dtags/' $ORACLE_HOME/ctx/lib/env_ctx.mk;
sed -i 's/LDDISABLENEWDTAGS=-Wl,--disable-new-dtags/LDDISABLENEWDTAGS=-Wl,--no-as-needed,--disable-new-dtags/' $ORACLE_HOME/sqlplus/lib/env_sqlplus.mk;

Press the "retry" button on the installer which should at least let the installation complete.


But the resulting Oracle installation will not be able to start an instance: startup nomount will hang with a deadlocked Oracle BEQ process which shows a stack trace similar to this:

#0  __lll_lock_wait_private () at ../sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:95
#1  0x00007fadc7f99376 in __tz_convert (timer=0x7fadc82b2c20 <tzset_lock>, use_localtime=1, tp=0x7fadc7437870) at tzset.c:579
#2  0x0000000010cd2fd6 in localtime_r ()
#3  0x0000000003e01f5f in slsstdts ()
#4  0x0000000003e01dbd in slsstdtscond ()
#5  0x0000000002d366fb in dbktWriteTimestampWCdbInfo ()
#6  0x0000000002a43917 in ssexhd ()
#7  0x00000000036c638f in sslssSynchHdlr ()
#8  0x00000000036c6086 in sslsshandler ()
#9  <signal handler called>
#10 0x00007fadc7f985e6 in update_vars () at tzset.c:132
#11 __tzset_parse_tz (tz=<optimized out>) at tzset.c:363
#12 0x00007fadc7f9ac60 in __tzfile_compute (timer=<optimized out>, use_localtime=use_localtime@entry=1, 
    leap_correct=leap_correct@entry=0x7ffcf45fd9b0, leap_hit=leap_hit@entry=0x7ffcf45fd9ac, tp=tp@entry=0x7ffcf45fdaa0) at tzfile.c:684
#13 0x00007fadc7f9951e in __tz_convert (timer=timer@entry=0x7ffcf45fda88, use_localtime=use_localtime@entry=1, 
    tp=tp@entry=0x7ffcf45fdaa0) at tzset.c:587
#14 0x00007fadc7f9657d in __localtime_r (t=t@entry=0x7ffcf45fda88, tp=tp@entry=0x7ffcf45fdaa0) at localtime.c:30
#15 0x00007fadc7f971dc in ranged_convert (tp=0x7ffcf45fdaa0, t=0x7ffcf45fda88, convert=<optimized out>) at mktime.c:310
#16 __mktime_internal (offset=0x7fadc82b2b98 <localtime_offset>, convert=<optimized out>, tp=0x7ffcf45fdb60) at mktime.c:478
#17 __GI_mktime (tp=0x7ffcf45fdb60) at mktime.c:591
#18 0x0000000003e02271 in slclts ()
#19 0x00000000029d6d7b in kzxslNotifier ()
#20 0x0000000003295609 in kscnfy ()
#21 0x0000000000f8cb02 in ksmcsg ()
#22 0x0000000001e73b26 in opistr_real ()
#23 0x0000000001e7257d in opistr ()
#24 0x0000000010c3a54d in opiodr ()
#25 0x0000000010ed4fa9 in ttcpip ()
#26 0x0000000001e6bc04 in opitsk ()
#27 0x0000000001e706dd in opiino ()
#28 0x0000000010c3a54d in opiodr ()

This shows a deadlock because localtime() is entered recursively due to some signal being handled - and localtime is not reentrant so it blocks on a lock.

The solution is the following:

  • Remove all libc* libraries from lib/stubs/
  • Relink all
cd lib/stubs
rm libc*
cd ../../bin
./relink all

After the relink check its log file to ensure that all links succeeded.

After this you can run dbca to create a database, either assisted or unassisted:

dbca -silent -createDatabase \
-templateName General_Purpose.dbc \
-gdbname $DBNAME -sid $DBNAME -responseFile NO_VALUE \
-characterSet AL32UTF8 \
-sysPassword oracle \
-systemPassword oracle \
-createAsContainerDatabase false \
-databaseType MULTIPURPOSE \
-automaticMemoryManagement false \
-totalMemory 2048 \
-storageType FS \
-datafileDestination "/opt/oracle/oradata/" \
-redoLogFileSize 500 \
-emConfiguration NONE \
-ignorePreReqs





Links:

http://ec2-52-212-36-108.eu-west-1.compute.amazonaws.com/blogs/index.php/2018/04/20/recipe-for-ubuntu-18-04/

https://tutorialforlinux.com/how-to-install-oracle-database-11g12c-on-linux/

https://www.dizwell.com/wordpress/recompile-with-fpic/


  • No labels