{
  "slug": "Connect-to-a-remote-Oracle-Database-with-Ubuntu-22-04-b1e2d803d6ec",
  "title": "Connect to a remote Oracle Database with Ubuntu 22.04",
  "subtitle": "This article provides a structured, step-by-step guide for connecting to a remote Oracle Database on Ubuntu 22.04",
  "excerpt": "This article provides a structured, step-by-step guide for connecting to a remote Oracle Database on Ubuntu 22.04",
  "date": "2025-11-04",
  "tags": [
    "Linux"
  ],
  "readingTime": "2 min",
  "url": "https://medium.com/@mobinshaterian/connect-to-a-remote-oracle-database-with-ubuntu-22-04-b1e2d803d6ec",
  "hero": "https://cdn-images-1.medium.com/max/800/1*6VpTLPN6rjUopmlhf39pwg.png",
  "content": [
    {
      "type": "heading",
      "level": 2,
      "text": "Connect to a remote Oracle Database with Ubuntu 22.04"
    },
    {
      "type": "heading",
      "level": 2,
      "text": "Abstract"
    },
    {
      "type": "paragraph",
      "html": "This article provides a structured, step-by-step guide for connecting to a remote Oracle Database on Ubuntu 22.04. The primary focus is on installing Oracle Instant Client 23, a critical component for Oracle DB connectivity, using the ZIP distribution method. Initial steps include updating system packages and installing prerequisites (alien, libaio-dev, wget, unzip). The guide outlines downloading essential Instant Client ZIP files (instantclient-basic-linux.x64 and instantclient-sqlplus-linux.x64) from Oracle’s official download portal, unzipping them into a dedicated directory (/opt/oracle), and configuring environment variables (LD_LIBRARY_PATH and PATH) to ensure proper client recognition. A compatibility fix is addressed for newer Ubuntu versions, involving creating a backward-compatible symlink for libaio.so.1 to resolve potential library version conflicts. Verification is demonstrated using the SQLPLUS command to confirm successful installation. Additionally, DBeaver, a recommended GUI tool for developers, is introduced with instructions for installation via the snap package manager. The article aims to streamline the setup process, ensuring users can efficiently connect to remote Oracle Databases on Ubuntu 22.04 while addressing common compatibility challenges."
    },
    {
      "type": "image",
      "src": "https://cdn-images-1.medium.com/max/800/1*6VpTLPN6rjUopmlhf39pwg.png",
      "alt": "Connect to a remote Oracle Database with Ubuntu 22.04",
      "caption": "",
      "width": 1024,
      "height": 1024
    },
    {
      "type": "heading",
      "level": 2,
      "text": "✅ Step 1: Install Oracle Instant Client"
    },
    {
      "type": "paragraph",
      "html": "Oracle Instant Client gives you everything needed to connect to an Oracle DB."
    },
    {
      "type": "code",
      "lang": "bash",
      "code": "sudo\napt update\nsudo\napt install alien libaio-dev\nwget unzip"
    },
    {
      "type": "heading",
      "level": 2,
      "text": "🟩 Install Oracle Instant Client 23 on Ubuntu (ZIP method)"
    },
    {
      "type": "code",
      "lang": "bash",
      "code": "sudo\nmkdir -p /opt/oraclecd /opt/oracle"
    },
    {
      "type": "heading",
      "level": 2,
      "text": "2️⃣ Download the ZIP files"
    },
    {
      "type": "paragraph",
      "html": "You’ll need <strong>at least</strong> the following two files from<br>&nbsp;🔗 <a href=\"https://www.oracle.com/database/technologies/instant-client/downloads.html\" target=\"_blank\" rel=\"noreferrer noopener\">https://www.oracle.com/database/technologies/instant-client/downloads.html</a>"
    },
    {
      "type": "paragraph",
      "html": "<a href=\"https://www.oracle.com/database/technologies/instant-client/linux-x86-64-downloads.html\" target=\"_blank\" rel=\"noreferrer noopener\">https://www.oracle.com/database/technologies/instant-client/linux-x86-64-downloads.html</a>"
    },
    {
      "type": "code",
      "lang": "bash",
      "code": "wget\nhttps://download.oracle.com/otn_software/linux/instantclient/2326000/instantclient-basic-linux.x64-23.26.0.0.0.zip\nwget\nhttps://download.oracle.com/otn_software/linux/instantclient/2326000/instantclient-sqlplus-linux.x64-23.26.0.0.0.zip"
    },
    {
      "type": "heading",
      "level": 2,
      "text": "3️⃣ Unzip them"
    },
    {
      "type": "code",
      "lang": "bash",
      "code": "sudo\napt install unzip -yunzip instantclient-basic-linux.x64-23.26.0.0.0.zipunzip\ninstantclient-sqlplus-linux.x64-23.26.0.0.0.zip"
    },
    {
      "type": "heading",
      "level": 2,
      "text": "4️⃣ Set environment variables"
    },
    {
      "type": "paragraph",
      "html": "Add this to your shell profile (<code>~/.bashrc</code> or <code>~/.zshrc</code>):"
    },
    {
      "type": "code",
      "lang": "text",
      "code": "echo 'export LD_LIBRARY_PATH=/opt/oracle/instantclient_23_26:$LD_LIBRARY_PATH' >> ~/.bashrcecho\n'export PATH=/opt/oracle/instantclient_23_26:$PATH' >> ~/.bashrcsource ~/.bashrc"
    },
    {
      "type": "heading",
      "level": 2,
      "text": "🩵 Step-by-step fix"
    },
    {
      "type": "heading",
      "level": 3,
      "text": "We’ll create a compatibility symlink pointing to the existing library, which is 100% safe and commonly done for Oracle clients on new Ubuntu versions."
    },
    {
      "type": "heading",
      "level": 2,
      "text": "1️⃣ Check what files you have:"
    },
    {
      "type": "code",
      "lang": "bash",
      "code": "ls -l /usr/lib/x86_64-linux-gnu/libaio*"
    },
    {
      "type": "heading",
      "level": 2,
      "text": "✅ Fix: Create a backward-compatible symlink"
    },
    {
      "type": "paragraph",
      "html": "Run this one safe command:"
    },
    {
      "type": "code",
      "lang": "bash",
      "code": "sudo ln -s /usr/lib/x86_64-linux-gnu/libaio.so.1t64.0.2 /usr/lib/x86_64-linux-gnu/libaio.so.1"
    },
    {
      "type": "heading",
      "level": 2,
      "text": "✅ Then test again"
    },
    {
      "type": "code",
      "lang": "text",
      "code": "sqlplus -v"
    },
    {
      "type": "code",
      "lang": "text",
      "code": "SQL*Plus: Release 23.26.0.0.0 - ProductionVersion 23.26.0.0.0"
    },
    {
      "type": "heading",
      "level": 2,
      "text": "🟩 1. DBeaver (Recommended for Most Developers)"
    },
    {
      "type": "code",
      "lang": "bash",
      "code": "sudo snap install dbeaver-ce"
    },
    {
      "type": "heading",
      "level": 2,
      "text": "Conclusion"
    },
    {
      "type": "paragraph",
      "html": "This guide has provided a clear, actionable process for establishing connectivity to a remote Oracle Database on Ubuntu 22.04, centered on installing and configuring Oracle Instant Client 23. By following the outlined steps — from updating system packages and installing prerequisites, to downloading and unzipping the Instant Client ZIP files, setting environment variables, resolving compatibility issues with a safe symlink fix, and verifying the installation via <code>sqlplus</code>—users can efficiently set up a functional Oracle client environment. Additionally, recommending DBeaver as a user-friendly GUI tool further simplifies database management for developers. The structured approach ensures that even those new to Oracle on Linux can navigate potential challenges, such as library version conflicts, with confidence. Ultimately, this setup enables seamless interaction with remote Oracle databases, supporting real-world development and operational needs on Ubuntu 22.04."
    }
  ]
}
