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

Neurofunk
Hi folks! I wrote an article about BEAM and Haskell Interoperabilty. I'm describing the use of the erlang-ffi project, that impersonates ...
New
malloryerik
Hi, this is for people who, like me, have had some friction using .html.heex templates in VSCode. The solution seems to be, in a hyphena...
New
eclark
I’ve been working on a phoenix project lately and I wanted to use the latest versions of everything. Webpack 5 had some breaking changes ...
New
GenericJam
Just leaving some breadcrumbs for future me and future others like me. Connect with TCP (not secured) - most servers will reject but use...
New
Eiji
Hey, today I give amnesia library a try and found a few problems. I would like describe how to setup it properly and solve problems which...
New
fmcgeough
pipe into case? I use that fairly frequently…unless I’m misunderstanding what you’re wanting…could be… its still very early… str = "Hell...
New
bitli
In case this is handy for other people, here is how you can run Elixir on Android: Install https://termux.com/ apt update; apt upgrad...
New
georgeguimaraes
Another cool plugin for Neovim, GitHub - jmbuhr/otter.nvim: Just ask an otter! 🦦 makes it possible to run linters for embedded code, like...
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
kevinlang
Hey all, With Phoenix 1.6 just around the corner, I figured I’d make a tutorial on how to add Bulma to a new Phoenix 1.6 project. By lev...
New

Other popular topics Top

shahryarjb
Hello, I get Persian date from my client and convert it to normal calendar like this: def jalali_string_to_miladi_english_number(persi...
New
Tee
can someone please explain to me how Enum.reduce works with maps
New
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 record...
New
_russellb
I want to try my hand at web scraping. What tools/libraries do I need to use. I’m hoping to turn this into something professional so don’...
New
minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
chensan
I have a User schema with a :from_id field set to type :string: defmodule TweetBot.Repo.Migrations.CreateUsers do use Ecto.Migration ...
New
electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
AstonJ
by Lance Halvorsen Elixir and Phoenix are generating tremendous excitement as an unbeatable platform for building modern web application...
460 27162 124
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

We're in Beta

About us Mission Statement