alejandroErik

alejandroErik

Iex-odbc build on Solaris 11.3

POST IN CONSTRUCTION
Process for compile erlang otp 20 with odbc-unix for Oracle connections on Solaris 11.3 for 64 bits:
Introduction ,this is a resume for get a elixir 1.5.1 whit Oracle odbc support on Solaris 11.3 .
0.- Precondition :

0.1.- A solaris version:

ale@switch:~$ uname -a
SunOS switch 5.11 11.3 i86pc i386 i86pc

0.2.- The releases:

otp_src_20.0.tar.gz unixODBC-2.3.4.tar.gz instantclient-basic-solaris.x64-12.2.0.1.0.zip instantclient-sqlplus-solaris.x64-12.2.0.1.0.zip instantclient-odbc-solaris.x64-12.2.0.1.0.zip

root user :

1 .- Environment and tools…

1.1.- Install gcc and tools:

# pkg install gcc
# pkg install developer/build/libtool
# pkg install developer-studio-utilities

1.2.- Install oracle client:

# cd /usr/local
# unzip instantclient-basic-solaris.x64-12.2.0.1.0.zip
# unzip instantclient-sqlplus-solaris.x64-12.2.0.1.0.zip
# unzip instantclient-odbc-solaris.x64-12.2.0.1.0.zip

1.3.- Configure oracle sqlplus connection:

# cd /usr/local/instantclient_12_2
# mkdir network
# cd network
# mkdir admin
# cd admin
# vi tnsnames.ora

XE=(DESCRIPTION=
_ (ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))_
_ (CONNECT_DATA =_
_ (SERVER = DEDICATED)_
_ (SERVICE_NAME=xe)_
_ )_
)

/usr/local/instantclient_12_2# ls -ltr total 519324 -rwxrwxr-x 1 root root 390144 Jan 31 2017 uidrvci -rwxrwxr-x 1 root root 124773008 Jan 31 2017 libociei.so -rwxrwxr-x 1 root root 58096 Jan 31 2017 genezi -rw-rw-r-- 1 root root 331 Jan 31 2017 BASIC_README -rwxrwxr-x 1 root root 66776 Jan 31 2017 adrci -rwxrwxr-x 1 root root 142384 Jan 31 2017 liboramysql12.so -r-xr-xr-x 1 root root 348720 Jan 31 2017 libons.so -r-xr-xr-x 1 root root 14799968 Jan 31 2017 libnnz12.so -rwxrwxr-x 1 root root 1839216 Jan 31 2017 libocci.so.12.1 -r-xr-xr-x 1 root root 435888 Jan 31 2017 libmql1.so -r-xr-xr-x 1 root root 3632736 Jan 31 2017 libipc1.so -rwxrwxr-x 1 root root 11747904 Jan 31 2017 libclntshcore.so.12.1 -rwxrwxr-x 1 root root 93849584 Jan 31 2017 libclntsh.so.12.1 -rw-rw-r-- 1 root root 74230 Jan 31 2017 xstreams.jar -r--r--r-- 1 root root 4036257 Jan 31 2017 ojdbc8.jar -r-xr-xr-x 1 root root 183384 Jan 31 2017 libocijdbc12.so -rwxrwxr-x 1 root root 1756448 Jan 31 2017 libocci_stlport4.so.12.1 -rwxrwxr-x 1 root root 1625392 Jan 31 2017 libocci_cpp11.so.12.1 -r-xr-xr-x 1 root root 12192 Jan 31 2017 sqlplus -r-xr-xr-x 1 root root 1642848 Jan 31 2017 libsqlplusic.so -r-xr-xr-x 1 root root 2235168 Jan 31 2017 libsqlplus.so -r-xr-xr-x 1 root root 342 Jan 31 2017 glogin.sql -rw-rw-r-- 1 root root 335 Jan 31 2017 SQLPLUS_README -r-xr-xr-x 1 root root 4663 Jan 31 2017 odbc_update_ini.sh -r-xr-xr-x 1 root root 18742 Jan 31 2017 ODBC_IC_Readme_Unix.html -rwxrwxr-x 1 root root 891216 Jan 31 2017 libsqora.so.12.1 drwxrwxr-x 4 root root 4 Jan 31 2017 help drwxr-xr-x 3 root root 3 Sep 23 16:51 network
# chmod 755 ./*

1.4.- Disable native isql command :

# mv /usr/bin/isql /usr/bin/isql_back

2.- For compile unixODBC-2.3.4…

simple user:

$ export CFLAGS=-m64 $ export LD_LIBRARY_PATH=/usr/lib/amd64 $ mkdir /export/home/ale/programs/unixODBC-2.3.4/build64 $ ./configure --prefix=/export/home/ale/programs/unixODBC-2.3.4/build64 $ make $ make install

3.- For compile otp_src_20.0 …

$ export CFLAGS="-m64 -I/export/home/ale/programs/unixODBC-2.3.4/build64/include" $ export LD_LIBRARY_PATH=/usr/local/instantclient_12_2:/export/home/ale/programs/unixODBC-2.3.4/build64/lib $ ./configure --prefix=/export/home/ale/programs/otp_src_20.0/build --with-odbc=/export/home/ale/programs/unixODBC-2.3.4/build64/lib --without-ssl --enable-m64-build $ gmake $ gmake install

4.- Connection test SQLPLUS

$ export ORACLE_HOME=/usr/local/instantclient_12_2 $ export PATH=${PATH}:${ORACLE_HOME}:/export/home/ale/programs/unixODBC-2.3.4/build64/bin $ export ORACLE_SID=xe $ export LD_LIBRARY_PATH=/usr/local/instantclient_12_2:/export/home/ale/programs/unixODBC-2.3.4/build64/lib $ sqlplus SYC/lolalola@XE

SQL*Plus: Release 12.2.0.1.0 Production on Sat Sep 23 17:10:19 2017

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

Connected to:
Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production

SQL> select (1) from dual;
(1)


1
SQL> quit
Disconnected from Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production

5.- UNIX ODBC configuration …

$ cd /export/home/ale/programs/unixODBC-2.3.4/build/ $ vi etc/odbc.ini
[simple]
Driver = OracleODBC-12g
DSN = OracleODBC-12g
ServerName = xe
UserID = SYC
Password = lolalola
Server = 127.0.0.1
Port = 49161
SQLTranslateErrors = T

$ vi etc/odbcins.ini
[OracleODBC-12g]
Description = Oracle ODBC driver for Oracle 12g
Driver = /usr/local/instantclient_12_2/libsqora.so
FileUsage = 1
Driver Logging = 7

Connection test ISQL
$ isql -v simple

±--------------------------------------+
| Connected! |
| |
| sql-statement |
| help [tablename] |
| quit |
| |
±--------------------------------------+
SQL> select (1) from dual;
±----------------------------------------+
| (1) |
±----------------------------------------+
| 1 |
±----------------------------------------+
SQLRowCount returns -1
1 rows fetched

6.- Connection test ERL

ale@switch:~/programs/otp_src_20.0/build$ bin/erl

Erlang/OTP 20 [erts-9.0] [source] [64-bit] [smp:2:2] [ds:2:2:10] [async-threads:10] [hipe] [kernel-poll:false]
Eshell V9.0 (abort with ^G)
>odbc:start().
ok
21> {ok, Ref} = odbc:connect(“DSN=simple”, [{scrollable_cursors, off}]).
{ok,<0.112.0>}
22> odbc:sql_query(Ref, “select (1) from dual”)
22> .
{selected,[“(1)”],[{1.0}]}
[/quote]

7.- Connection test IEX

" I downloaded Precompiled.zip 1.5.1 release"

ale@switch:~/programs/elixir-1.5.1_precompiled$ bin/iex

Erlang/OTP 20 [erts-9.0] [source] [64-bit] [smp:2:2] [ds:2:2:10] [async-threads:10] [hipe] [kernel-poll:false]
Interactive Elixir (1.5.1) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> :odbc.start
:ok
iex(3)> {ok, ref } = :odbc.connect(‘DSN=simple’, [ scrollable_cursors: :off])
{:ok, pid<0.94.0>}
iex(4)> :odbc.sql_query(ref, ‘select (1) from dual’)
{:selected, [‘(1)’], [{1.0}]}
iex(5)>

Thats it, I wish it to help you .

Most Liked

NobbZ

NobbZ

Can you please use some markdown to do better formatting, also an introductionary sentence would be nice. Currently it reads like a strait dump of your shellsession.

alejandroErik

alejandroErik

NobbZ thanks for the reply, I am working on it .

Where Next?

Popular in Guides/Tuts Top

1player
A question I had when first learning contexts and Ecto was how to expand the default context API to support more flexible queries. Usuall...
New
sergio
Wrote this guide on how to integrate DropzoneJS with Phoenix Liveview. Hope it helps someone out! Woah read that title again, what a ...
New
zachallaun
Hey friends, wanted to share a tiny shell script I’ve been using to start Livebook with easy access to either a running production server...
New
siever
I just wrote a simple guide on how you can setup a productive elixir development environment in vim. Its really easy, just a few steps. ...
New
yeshan333
vfox (version-fox) is a popular general version management tool write in Go, and the plug-in mechanism uses Lua to achieve extensibility....
New
TwistingTwists
This is a thread to note down things/best practices encountered in LiveBeats App as I explore the source code. https://github.com/fly-...
New
marcin
This post is intended to be a guide for others, I was running a remote debugger for the first time and appreciate feedback on how I could...
New
dogweather
I just finished a long process of configuring and debugging a Docker Compose-based dev environment. Several late-night hours! I think I’v...
New
nietaki
Just a quick heads up: There seems to be a bug in Erlang/OTP 21.3, which can cause some errors when making http requests. If you’re using...
New
anuragg
We just published a guide to automatic clustering in Elixir 1.9, with Mix releases and libcluster. The cluster automatically discovers n...
New

Other popular topics Top

senggen
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] 15:22:35.803 [error] gen_event {lager_file_backend...
New
sorentwo
Hello! tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability. After spen...
985 43487 311
New
chrismccord
Phoenix 1.4.0 released Phoenix 1.4 is out! This release ships with exciting new features, most notably with HTTP2 support, improved deve...
688 31013 112
New
ovidiubadita
Hey all, I discovered Elixir and I love it. I always wanted to learn a functional programming and I intended to go for Haskell, but afte...
New
pmjoe
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New
jononomo
For some reason my phoenix channels are working for me in my local dev environment, but as soon as I deploy via Docker, I get a 403 error...
New

Latest on Elixir Forum

Elixir Forum

We're in Beta

About us Mission Statement