Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[example] set instant client environment by a shell in linux(ubuntu) #421

Open
TruthHun opened this issue Sep 15, 2021 · 1 comment
Open

Comments

@TruthHun
Copy link

TruthHun commented Sep 15, 2021

this is my example,it's work.

oci8.pc

prefix=/opt/oracle/instantclient_12_2
exec_prefix=${prefix}
libdir= ${prefix}
includedir= ${prefix}/sdk/include

glib_genmarshal=glib-genmarshal
gobject_query=gobject-query
glib_mkenums=glib-mkenums

Name: oci8
Description: oci8 library
Libs: -L${libdir} -lclntsh
Cflags: -I${includedir}
Version: 12.2

exec_install.sh

#! /bin/env bash

sudo mkdir -p /opt/oracle
sudo mkdir -p /opt/pkg-config

wget https://raw.githubusercontent.com/TruthHun/oracle-instantclient/master/instantclient-sdk-linux.x64-12.2.0.1.0.zip
wget https://raw.githubusercontent.com/TruthHun/oracle-instantclient/master/instantclient-sqlplus-linux.x64-12.2.0.1.0.zip
wget https://raw.githubusercontent.com/TruthHun/oracle-instantclient/master/instantclient-basic-linux.x64-12.2.0.1.0.zip

sudo unzip -d /opt/oracle instantclient-sdk-linux.x64-12.2.0.1.0.zip
sudo unzip -d /opt/oracle instantclient-sqlplus-linux.x64-12.2.0.1.0.zip
sudo unzip -d /opt/oracle instantclient-basic-linux.x64-12.2.0.1.0.zip

sudo cp oci8.pc /opt/pkg-config

echo "export LD_LIBRARY_PATH=/opt/oracle/instantclient_12_2:\$LD_LIBRARY_PATH" >> ~/.bashrc
echo "export PATH=\$LD_LIBRARY_PATH:\$PATH" >> ~/.bashrc
echo "export PKG_CONFIG_PATH=/opt/pkg-config:\$PKG_CONFIG_PATH" >> ~/.bashrc

source ~/.bashrc

# fixed:/usr/bin/ld: cannot find -lclntsh
cd /opt/oracle/instantclient_12_2
sudo ln -s libclntsh.so.12.1 libclntsh.so

usage

bash exec_install.sh
@cjbj
Copy link

cjbj commented Sep 15, 2021

Why not use 19c client? You can wget it directly from Oracle and it already has the sym link you were adding. It also connects to the same DB versions that the 12.2 Instant Client will. Or even use 21c client (which will connect to DB 12.1 or later).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants