Install Oracle Database 10g Express Edition & Oracle PRO*C On Linux Mint 14

  6 years ago

This is a tutorial that documents my successful installation
of Oracle Database 10g Express Edition & Oracle PRO*C on my
Linux Mint 32 bit computer.

Oracle offers a newer edition of Oracle express - Oracle Database Express Edition 11g Release 2 .

But this version only works for 32 bit Windows machines
and 64 bit Linux machines. So, this tutorial can be
useful for those Linux/Linux Mint users who are operating
on a 32 bit machine.

This Oracle Database 10g Express Edition & Oracle PRO*C install used the below Linux version:

anthony@an1:~ $ cat /etc/lsb-release

anthony@an1:~ $ uname -a
Linux an1 3.5.0-17-generic #28-Ubuntu SMP Tue Oct 9 19:32:08 UTC 2012 i686 i686 i686 GNU/Linux

To install Oracle Database 10g Express Edition,
I used as a guide  .

Per the suggestion in the above guide, I added

   "deb unstable main non-free"
       ("https", not "http")

to my "/etc/apt/sources.list" file .

I did not add

   "deb-src unstable main"

to my "/etc/apt/sources.list" file .

To perform the PRO*C install, I used as a guide

"Getting Started with Oracle Pro*C on Linux (Instant Client Zip Files)"

by Mark Williams

I downloaded the "Instant Client" packages from these links.

# Instant Client Package - Basic Lite
# Instant Client Package - SDK
# Instant Client Package - SQL*Plus

# Instant Client Package - Precompiler

anthony@an1:~/oracle $ ls *.zip

Use "unzip" to unzip ".zip" files.
Unzipping will install the files in an "instantclient_11_2"
directory as suggested in the article.

Created "oic11.env" file and executed it to enable
Oracle paths in my shell, as suggested in the article.

To test the Oracle "Instant Client" package
installation, I modified the suggested command
line to successfully connect to SqlPlus.


anthony@an1:~/oracle $ sqlplus hr/hr@an1:1521/XE

SQL*Plus: Release Production on Wed Mar 27 09:04:30 2013

Copyright (c) 1982, 2011, Oracle.  All rights reserved.

Connected to:
Oracle Database 10g Express Edition Release - Production



To compile and build the sample PRO*C file "proctest.pc",
I created a "PRO*C_Example" directory that contains
the sample code and "make" files.

1) Modified "proctest.pc" source code to refer to my login.

-- /* strncpy((char *) database.arr, "oel02:1521/XE", NAME_LEN); */
-- strncpy((char *) database.arr, "an1:1521/XE", NAME_LEN);

2) Copied a sample makefile from the downloaded PRO*C sample directory.
-- cp $ORACLE_HOME/sdk/demo/ .

3) Modified "pcscfg.cfg":
-- Added sys_include=/usr/include/i386-linux-gnu .
     (path from my personal Linux Mint installation)
   Used Linux command
     dpkg-architecture -qDEB_HOST_MULTIARCH
   to obtain correct include path.

4) Modified sys_include in ""
     as above to add "/usr/include/i386-linux-gnu"
     to existing sys_include path .

5) Added


   to beginning of "pcscfg.cfg" per suggestion from

   to prevent "stdarg.h", "stddef.h" compilation errors.

   Thus, my "pcsdfg.cfg" looks like this:


6) Added "#define size_t long" to the beginning of "proctest.pc"
   to prevent core dumps during compilation.

7) Modified "sql_error" in "proctest.pc" to
   eliminate a compiler warning message.

-- /* printf("%.*s", msg_len, err_msg); */
-- printf("%.*s", (int) msg_len, err_msg);

I defined 2 "make" commands as suggested in the article.

make -f build PROCFLAGS="common_parser=yes" EXE=proctest OBJS="proctest.o"
make -f dust PROCDEMO=proctest


Executing "make" and "proctest" on my Linux computer, displaying output.

anthony@an1:~/oracle/PRO*C_Example$ make -f build PROCFLAGS="common_parser=yes" EXE=proctest OBJS="proctest.o"
rm -rf SunWS_cachea
rm -rf /home/anthony/oracle/PRO*C/instantclient_11_2/
make -f PROCFLAGS="common_parser=yes" PCCSRC=proctest I_SYM=include= pc1
make[1]: Entering directory `/home/anthony/oracle/PRO*C_Example'
/home/anthony/oracle/PRO*C/instantclient_11_2/sdk/proc common_parser=yes iname=proctest include=. sys_include=\(/home/anthony/oracle/PRO*C/instantclient_11_2/sdk/include,/usr/include,/usr/include/i386-linux-gnu\)

Pro*C/C++: Release - Production on Wed Apr 10 03:21:29 2013

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

System default option values taken from: /home/anthony/oracle/PRO*C/instantclient_11_2/precomp/admin/pcscfg.cfg

make[1]: Leaving directory `/home/anthony/oracle/PRO*C_Example'
/usr/bin/gcc -m32  -O2  -fPIC -DPRECOMP -I/home/anthony/oracle/PRO*C/instantclient_11_2/sdk/include -DLINUX -D_GNU_SOURCE -D_LARGEFILE64_SOURCE=1 -D_LARGEFILE_SOURCE=1 -DSLTS_ENABLE -DSLMXMX_ENABLE -D_REENTRANT -DNS_THREADS   -c proctest.c
ln /home/anthony/oracle/PRO*C/instantclient_11_2/ /home/anthony/oracle/PRO*C/instantclient_11_2/
/usr/bin/gcc -m32 -o proctest proctest.o -g -L/home/anthony/oracle/PRO*C/instantclient_11_2/ -lclntsh -ldl -lm  -lpthread
rm -rf /home/anthony/oracle/PRO*C/instantclient_11_2/
anthony@an1:~/oracle/PRO*C_Example$ ./proctest
10, Jennifer Whalen, 4400, 1
20, Michael Hartstein, 13000, 1
20, Pat Fay, 6000, 2
30, Den Raphaely, 11000, 1
30, Alexander Khoo, 3100, 2
30, Shelli Baida, 2900, 3
40, Susan Mavris, 6500, 1
50, Adam Fripp, 8200, 1
50, Matthew Weiss, 8000, 2
50, Payam Kaufling, 7900, 3
60, Alexander Hunold, 9000, 1
60, Bruce Ernst, 6000, 2
60, David Austin, 4800, 3
70, Hermann Baer, 10000, 1
80, John Russell, 14000, 1
80, Karen Partners, 13500, 2
80, Alberto Errazuriz, 12000, 3
90, Steven King, 24000, 1
90, Neena Kochhar, 17000, 2
90, Lex De Haan, 17000, 3
100, Nancy Greenberg, 12000, 1
100, Daniel Faviet, 9000, 2
100, John Chen, 8200, 3
110, Shelley Higgins, 12000, 1
110, William Gietz, 8300, 2

jahid_0903014 7 years ago

nicely described

sujitnag 8 years ago

I personally prefer to use mysql. It is easy to install, free and helpful in web development.

Hammer459 8 years ago

A slightly confusing mix of random thoughts, loose snippets from the actual install instruction from Oracle (that you linked to) and random examples of embedded SQL in C.
Not impressed ...