Skip to content

Instantly share code, notes, and snippets.

@viniciusgati
Created February 9, 2021 18:34
Show Gist options
  • Save viniciusgati/71e624149a2698c8926bbdc84c3dc04f to your computer and use it in GitHub Desktop.
Save viniciusgati/71e624149a2698c8926bbdc84c3dc04f to your computer and use it in GitHub Desktop.
#!/bin/sh
echo 'Installing Oracle Instant Client...'
export DEBIAN_FRONTEND=noninteractive
apt-get -y install libaio1 unzip
# See: http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html#ic_x64_inst
client_version='21_1'
devel_pkg='instantclient-sdk-linux.x64-21.1.0.0.0.zip'
basic_pkg='instantclient-basic-linux.x64-21.1.0.0.0.zip'
src_dir='/opt/oracle'
mkdir -p "$src_dir" && chmod 755 "$src_dir"
unzip -o "./$devel_pkg" -d "$src_dir"
unzip -o "./$basic_pkg" -d "$src_dir"
cd "$src_dir/instantclient_$client_version"
# ln -sf libclntsh.so.21.1 libclntsh.so
# ln -sf libocci.so.21.1 libocci.so
# Required to make this value available persistently.
echo "export LD_LIBRARY_PATH=\"$src_dir/instantclient_$client_version\"" >> ~/.bashrc
echo "export ORACLE_HOME=\"$src_dir/instantclient_$client_version\"" >> ~/.bashrc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment