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

Anthony100
  1 week ago
  0

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 using Linux Mint Version 17 .
This tutorial updates a previous tutorial using Linux Mint Version 14 .
(http://community.linuxmint.com/tutorial/view/1262)

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

http://www.oracle.com/technetwork/products/express-edition/downloads/index.html

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 Mint version:

anthony@an1:~ $ cat /etc/lsb-release
DISTRIB_ID=LinuxMint
DISTRIB_RELEASE=17.1
DISTRIB_CODENAME=rebecca
DISTRIB_DESCRIPTION="Linux Mint 17.1 Rebecca"

anthony@an1:~ $ uname -a
Linux an1 3.13.0-37-generic #64-Ubuntu SMP Mon Sep 22 21:30:01 UTC 2014 i686 i686 i686 GNU/Linux

http://www.linuxquestions.org/questions/linux-general-1/getting-the-linux-distribution-name-and-version-number-23726/
http://www.linuxquestions.org/questions/linux-general-1/how-to-check-linux-kernel-is-32-bit-or-64-bit-612352/

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

    http://www.debianhelp.co.uk/oracle.htm  .

Per the suggestion in the above guide, I added

   "deb https://oss.oracle.com/debian/ unstable main non-free"
       ("https", not "http")

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

I did not add

   "deb-src http://oss.oracle.com/debian/ unstable main"

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

After installing Oracle, I then accessed the
Database Home Page by going to
http://127.0.0.1:8080/apex
as suggested in the Oracle install guide.
I logged onto the database as administrator,
and unlocked the "HR" user, giving this user
a "HR" password.

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

http://oradim.blogspot.com/2009/09/getting-started-with-oracle-proc-on.html

I downloaded the "Instant Client" packages, version 12.1.0.2.0, from these links.

http://www.oracle.com/technetwork/topics/linuxsoft-082809.html

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

http://www.oracle.com/technetwork/topics/precomp-112010-084940.html

# Instant Client Package - Precompiler

anthony@an1:~/oracle $ ls *.zip
instantclient-basiclite-linux-12.1.0.2.0.zip  instantclient-sdk-linux-12.1.0.2.0.zip
instantclient-precomp-linux-12.1.0.2.0.zip    instantclient-sqlplus-linux-12.1.0.2.0.zip

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

Created "oic12.env" file and executed it to enable
Oracle paths in my shell, as suggested in the article.
("oic12.env" for version 12 of the packages)

To test the Oracle "Instant Client" package
installation, I modified the suggested command
line to successfully connect to SqlPlus
(using the "HR" user previously unlocked).

-------------------------------------------

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

SQL*Plus: Release 12.1.0.2.0 Production on Sun Mar 22 22:03:27 2015

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


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

SQL> select user from dual;

USER
------------------------------
HR

SQL> quit
Disconnected from Oracle Database 10g Express Edition Release 10.2.0.1.0 - 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/demo_proc_ic.mk .

3) Modified "demo_proc_ic.mk":
    
   For
   # InstantClient Directories.
   Changed

    "ICSDKHOME" and "ICLIBHOME" definitions
    
          to

     ICSDKHOME=$(ORACLE_HOME)/sdk/
     ICLIBHOME=$(ORACLE_HOME)/

4) Modified "instantclient_12_1/precomp/admin/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.

5) Added

   define=_STDIO_H
   define=_STRING_H
   define=_STDLIB_H

   to beginning of "pcscfg.cfg" per suggestion from

     https://community.oracle.com/message/288770

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

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

define=_STDIO_H
define=_STRING_H
define=_STDLIB_H
sys_include=($ORACLE_HOME/sdk/include,/usr/include,sys_include=/usr/include/i386-linux-gnu)
ltype=short

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 a "make" command as suggested in the article.

make -f demo_proc_ic.mk build PROCFLAGS="common_parser=yes" EXE=proctest OBJS="proctest.o"

----------------------------------------------------

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

anthony@an1:~/oracle/PRO*C_Example $ make -f demo_proc_ic.mk build PROCFLAGS="common_parser=yes" EXE=proctest OBJS="proctest.o"
rm -rf SunWS_cachea
rm -rf /home/anthony/oracle/PRO*C/instantclient_12_1/libclntshcore.so
rm -rf /home/anthony/oracle/PRO*C/instantclient_12_1/libclntsh.so
make -f demo_proc_ic.mk 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_12_1/sdk/proc common_parser=yes iname=proctest include=. sys_include=\(/home/anthony/oracle/PRO*C/instantclient_12_1/sdk/include,/usr/include,/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include,/usr/lib/gcc/x86_64-redhat-linux/4.4.7/include,/usr/lib/gcc/x86_64-redhat-linux/4.4.4/include,/usr/lib64/gcc/x86_64-suse-linux/4.1.2/include,/usr/lib64/gcc/x86_64-suse-linux/4.3/include\)

Pro*C/C++: Release 12.1.0.2.0 - Production on Mon Mar 23 01:19:56 2015

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

System default option values taken from: /home/anthony/oracle/PRO*C/instantclient_12_1/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_12_1/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_12_1/libclntshcore.so.12.1 /home/anthony/oracle/PRO*C/instantclient_12_1/libclntshcore.so
ln /home/anthony/oracle/PRO*C/instantclient_12_1/libclntsh.so.12.1 /home/anthony/oracle/PRO*C/instantclient_12_1/libclntsh.so
/usr/bin/gcc -m32  -o proctest proctest.o -g -L/home/anthony/oracle/PRO*C/instantclient_12_1/ -lclntsh -ldl -lm  -lpthread
rm -rf /home/anthony/oracle/PRO*C/instantclient_12_1/libclntshcore.so
rm -rf /home/anthony/oracle/PRO*C/instantclient_12_1/libclntsh.so

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
 

Comments
Hammer459 4 years ago

Not so big considering most is ripped directly from Oracle


lib2know 4 years ago

big peace of work