-
-
Save PhouvanhKCSV/a377a6d9001699ee099000803a1190ba to your computer and use it in GitHub Desktop.
Setup for go-oci8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
prefix=/opt/oracle | |
includedir=${prefix}/instantclient_12_1/sdk/include | |
libdir=${prefix}/instantclient_12_1 | |
Name: oci8 | |
Description: Oracle Instant Client | |
Version: 12.1 | |
Cflags: -I${includedir} | |
Libs: -L${libdir} -lclntsh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
sudo apt-get install -y pkg-config | |
sudo apt-get install -y libaio1 | |
rm -rf instantclient_12_1 | |
unzip instantclient-basic-linux.x64-12.1.0.2.0.zip | |
unzip instantclient-sdk-linux.x64-12.1.0.2.0.zip | |
sudo rm -rf /opt/oracle | |
sudo mkdir -p /opt/oracle | |
sudo mv instantclient_12_1 /opt/oracle | |
sudo chown -R `whoami`:`whoami` /opt/oracle | |
ln -s /opt/oracle/instantclient_12_1/libclntsh.so.12.1 /opt/oracle/instantclient_12_1/libclntsh.so | |
sudo cp oci8.pc /usr/lib/pkgconfig | |
grep -q "/opt/oracle/instantclient_12_1" /etc/environment | |
if [ $? -ne 0 ]; then | |
echo 'export LD_LIBRARY_PATH="/opt/oracle/instantclient_12_1"' | sudo tee --append /etc/environment | |
fi | |
sudo sh -c "echo /opt/oracle/instantclient_12_1 > /etc/ld.so.conf.d/oracle-instantclient.conf" | |
sudo ldconfig |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment