Created
April 15, 2026 12:25
-
-
Save luzfcb/4770500adaf392825ff57c904d3444e1 to your computer and use it in GitHub Desktop.
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/bash | |
| set -euo pipefail | |
| # Configurations | |
| # latest version of instant client basic lite | |
| export ORACLE_INSTANT_CLIENT_URL="https://download.oracle.com/otn_software/linux/instantclient/instantclient-basiclite-linuxx64.zip" | |
| TMP_DIR="/tmp/oracle" | |
| INSTALL_DIR="/opt/oracle" | |
| echo "Starting the Oracle Instant Client installation..." | |
| # 1. Prepare directories | |
| mkdir -p "$TMP_DIR" | |
| sudo mkdir -p "$INSTALL_DIR" | |
| # 2. Download | |
| echo "Downloading the package..." | |
| wget --progress=dot:giga --tries 3 --wait 2 --output-document "$TMP_DIR/instantclient.zip" "$ORACLE_INSTANT_CLIENT_URL" | |
| # 3. Extraction | |
| echo "Extracting files..." | |
| sudo unzip -o "$TMP_DIR/instantclient.zip" -d "$INSTALL_DIR" | |
| # 4. Cleaning up unnecessary files | |
| sudo rm -rf "$INSTALL_DIR/META-INF" | |
| rm -rf "$TMP_DIR" | |
| # 5. Linker Configuration | |
| echo "Configurando bibliotecas do sistema..." | |
| # The command below finds the newly created directory (e.g., instantclient_21_1) and saves it to the conf file. | |
| find "$INSTALL_DIR" -maxdepth 1 -type d -name "instantclient*" | sudo tee /etc/ld.so.conf.d/oracle-instantclient.conf > /dev/null | |
| # 6. Update library cache | |
| sudo ldconfig | |
| echo "Installation completed successfully!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment