Od
Databases Azure

Oracle Database Client 21c on OEL 7 on Azure User Guide

| Product: Oracle Database Client 21c on OEL 7 on Azure

Videos

Overview: Oracle Database Client 21c on OEL 7 on Azure: overview
Launch and log in: Oracle Database Client 21c on OEL 7 on Azure: launch and log in
Deep Dive: Oracle Database Client 21c on OEL 7 on Azure: deep dive

Overview

This guide covers deploying cloudimg's Oracle Database Client 21c on OEL 7 image on Microsoft Azure (offer 8b9fee8e-7bc1-40fb-a559-0558ac80ea9f). Oracle Database Client 21c is the set of tools and libraries an application or a DBA uses to reach a remote Oracle database: SQL*Plus, SQLcl, Oracle Net (tnsping, tnsnames.ora), SQL*Loader, Data Pump (expdp, impdp), Recovery Manager and the OCI and JDBC client libraries. It does not include a database server: the VM connects out to an Oracle database you already run.

⚠️ Support dates — read before deploying

Oracle Linux 7 left Oracle Premier Support in December 2024. Oracle's Lifetime Support Policy lists Oracle Linux 7 as: Premier Support to December 2024, Extended Support to July 2029, then Sustaining Support. Since Premier Support ended, the free public yum channel publishes no new Oracle Linux 7 errata: yum update still works, but finds nothing newer than the last errata Oracle published there. Continued security fixes need a paid Oracle Linux Extended Support subscription, delivered through the Unbreakable Linux Network.

Oracle Database 21c is an Innovation Release. Its Premier Support runs to July 2027 and it has no Extended Support. This image ships the 21.3 base release with no Release Update applied.

Use this image to keep a workload that needs an Oracle Linux 7 client machine running while you move it. For new deployments, cloudimg publishes Oracle Database Client 21c on Oracle Linux 8 and Oracle Database Client 23ai on Oracle Linux 9 on Azure.

What's included in this VM image:

  • Oracle Database Client 21c, version 21.3.0.0.0 (Administrator install), with its Oracle home at /u01/app/oracle/product
  • SQL*Plus, SQLcl 21.2, tnsping, SQL*Loader, Data Pump (expdp and impdp), exp and imp, Recovery Manager (rman), tkprof, adrci, wrap, the wallet tools mkstore and orapki, and the Net Configuration Assistant (netca)
  • The JDBC drivers (ojdbc8.jar, ojdbc11.jar), the Oracle Call Interface library (libclntsh.so) and the Instant Client libraries
  • A dedicated oracle OS user with an environment script, /home/oracle/setEnv.sh
  • sqlnet.ora set for tnsnames and Easy Connect naming, ready for your tnsnames.ora
  • /u01 on its own 10 GB Azure data disk, so the Oracle software sits apart from the OS disk
  • A package update at every boot (yum -y update), which brings a new VM up to the last published Oracle Linux 7 errata
  • Password login over SSH switched off: you sign in with your SSH key
  • Azure Linux Agent (waagent), cloud-init and chronyd
  • cloudimg's support team on hand 24 hours a day by email (support@cloudimg.co.uk), with a guaranteed response within 24 hours

Platform: Microsoft Azure (Generation 1 virtual machine) Operating system: Oracle Linux Server 7.9 Login user: the administrator user name you choose when you deploy (azureuser in this guide) Oracle Home: /u01/app/oracle/product TNS Admin: /u01/app/oracle/product/network/admin

Prerequisites

Before deploying this image, make sure you have:

  1. An active Microsoft Azure subscription
  2. The Azure CLI, installed locally or in Azure Cloud Shell
  3. An SSH key pair for Linux VM access
  4. The address range you will manage the machine from, to limit SSH to it
  5. The host name, port and service name of the Oracle database you want to connect to, and a network path from Azure to it (usually TCP 1521 outbound)

The Oracle Client is a set of tools and libraries rather than a running service, so a small general purpose size is enough for most work.

Step 1: Deploy the Virtual Machine

Deploy the image by its Marketplace URN. The image carries a purchase plan, so accept its terms once per subscription first. Replace <your-mgmt-cidr> with the network you connect from, for example 203.0.113.0/24.

az vm image terms accept --urn cloudimg1647283583153:8b9fee8e-7bc1-40fb-a559-0558ac80ea9f:8b9fee8e-7bc1-40fb-a559-0558ac80ea9f:latest

az group create --name myResourceGroup --location eastus
az vm create \
  --resource-group myResourceGroup \
  --name my-oracle-client-vm \
  --image cloudimg1647283583153:8b9fee8e-7bc1-40fb-a559-0558ac80ea9f:8b9fee8e-7bc1-40fb-a559-0558ac80ea9f:latest \
  --admin-username azureuser \
  --ssh-key-values ~/.ssh/id_ed25519.pub \
  --public-ip-sku Standard \
  --nsg-rule NONE
az network nsg rule create --resource-group myResourceGroup \
  --nsg-name my-oracle-client-vmNSG --name AllowSSHFromMgmt \
  --priority 1000 --access Allow --protocol Tcp --direction Inbound \
  --source-address-prefixes <your-mgmt-cidr> \
  --destination-port-ranges 22

Add --size to choose the machine size. The image's data disk, which holds the Oracle software at /u01, is created with the machine. The Oracle Client makes outbound connections to your databases, so the VM needs no inbound port other than SSH.

Read the machine's public IP address once it is running:

az vm show --resource-group myResourceGroup --name my-oracle-client-vm \
  --show-details --query "[powerState, publicIps]" -o tsv
VM running
203.0.113.25

Step 2: Connect via SSH

Connect as the administrator user you chose, with your key:

ssh azureuser@203.0.113.25

Early attempts can be refused for a minute while cloud-init finishes provisioning.

Step 3: Let the First Boot Update Finish

At every boot the image runs yum -y update as root and appends its output to /stage/scripts/initial_boot_update.log. On a new VM the first update takes about seven minutes: it brings the VM up to the last errata Oracle published for Oracle Linux 7, a new kernel among them. Wait for it to finish before you install anything or run updates yourself, because yum takes one lock at a time:

while pgrep -x yum >/dev/null; do sleep 10; done; sudo tail -1 /stage/scripts/initial_boot_update.log

Expected output:

Complete!

The update installs a new kernel, so restart once to run it. Check first:

sudo needs-restarting -r

It lists the core packages the update replaced (systemd, glibc and the kernels among them) and ends with:

Reboot is required to ensure that your system benefits from these updates.
sudo reboot

Connect again once the VM is back. The update at that boot finds nothing new, and sudo needs-restarting -r then reports no reboot needed.

Step 4: Switch to the Oracle User and Set the Environment

The Oracle Client software is owned by the oracle OS user. Switch to it, source the environment script and check the SQL*Plus release:

sudo su - oracle
. ~/setEnv.sh
sqlplus -V

Expected output:

SQL*Plus: Release 21.0.0.0.0 - Production
Version 21.3.0.0.0

setEnv.sh sets the variables the client tools need. Check them with:

env | grep -E "^(ORACLE_BASE|ORACLE_HOME|LD_LIBRARY_PATH)=" | sort

Expected output:

LD_LIBRARY_PATH=/u01/app/oracle/product/lib:/lib:/usr/lib
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=/u01/app/oracle/product

The environment is set for the oracle user only. To use the client tools from another account, source the same values in that account's ~/.bash_profile.

Step 5: Explore the Client Tooling

List the main tools in the Oracle home:

ls $ORACLE_HOME/bin | grep -xE "sqlplus|sql|sqlldr|tnsping|exp|imp|expdp|impdp|rman|tkprof|adrci|wrap|mkstore|orapki|netca" | paste -sd" " -

Expected output:

adrci exp expdp imp impdp mkstore netca orapki rman sql sqlldr sqlplus tkprof tnsping wrap

SQLcl, the Java based command line, is installed beside SQL*Plus and runs on the JDK in the Oracle home:

sql -V

Expected output:

SQLcl: Release 21.2.0.0 Production Build: 21.2.0.174.2245

Oracle Net reads sqlnet.ora for its naming methods. The image looks names up in tnsnames.ora first, then accepts Easy Connect strings:

grep -v "^#" $ORACLE_HOME/network/admin/sqlnet.ora | grep .

Expected output:

NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)

For your own applications, the JDBC drivers are in $ORACLE_HOME/jdbc/lib (ojdbc8.jar for Java 8 and later, ojdbc11.jar for Java 11 and later) and the Oracle Call Interface library is $ORACLE_HOME/lib/libclntsh.so.

Step 6: Configure tnsnames.ora

The image ships no tnsnames.ora: create it with an entry for your database. Run the following as the oracle user, replacing the placeholder values with your database's details:

cat >> $ORACLE_HOME/network/admin/tnsnames.ora << 'TNS'
MY_DATABASE =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = YOUR_DB_HOSTNAME)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = YOUR_SERVICE_NAME)
    )
  )
TNS

Replace the following values:

  • YOUR_DB_HOSTNAME with the IP address or DNS name of your Oracle database server
  • 1521 with the listener port, if it is different
  • YOUR_SERVICE_NAME with the service name of the target database

Then check the alias resolves and the listener answers:

tnsping MY_DATABASE

With the placeholder host still in place, the output shows Oracle Net resolving the alias and then failing to find the host:

TNS Ping Utility for Linux: Version 21.0.0.0.0 - Production on 02-DEC-2026 05:09:25

Copyright (c) 1997, 2021, Oracle.  All rights reserved.

Used parameter files:
/u01/app/oracle/product/network/admin/sqlnet.ora


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = YOUR_DB_HOSTNAME)(PORT = 1521))) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = YOUR_SERVICE_NAME)))
TNS-12545: Connect failed because target host or object does not exist

With your real host in the entry you can expect one of the following:

  • OK (n msec) when the host resolves and the remote listener accepts the connection. This is what you want to see.
  • TNS-12545: Connect failed because target host or object does not exist when the host does not resolve. Check the host name in the entry.
  • TNS-12541: TNS:no listener when the host resolves but nothing listens on the port. Check the listener is up and reachable from this VM.

Step 7: Connect to a Remote Database

With the environment sourced and tnsnames.ora populated, connect to your database by its alias. SQL*Plus prompts for the password, so it never appears on the command line or in your shell history:

sqlplus system@MY_DATABASE

You can also connect with an Easy Connect string, without editing tnsnames.ora:

sqlplus system@//your-db-host:1521/your-service-name

SQLcl takes the same connect strings: sql system@MY_DATABASE. Type EXIT to leave either session.

Step 8: Keep the VM Updated

The first boot update, and the one at every later boot, apply whatever the free Oracle Linux 7 channel carries. You can run the same update yourself at any time:

sudo yum -y update

On the free channel this brings the VM to the last errata Oracle published for Oracle Linux 7; it receives no new fixes (see the support dates at the top of this guide). Restart after an update that installs a new kernel (sudo needs-restarting -r says when).

Server Components

Component Version Install Path
Oracle Database Client (Administrator) 21.3.0.0.0 /u01/app/oracle/product
SQLcl 21.2.0 /u01/app/oracle/product/sqldeveloper (run as sql)
JDK (bundled with the client) 1.8.0_291 /u01/app/oracle/product/jdk
Oracle Linux 7.9 /

Filesystem Layout

Mount Point Size Description
/ 38 GB Root filesystem (ext4)
/boot 2 GB Operating system kernel files
/u01 10 GB Azure data disk holding the Oracle base, the Oracle home and the inventory
/mnt varies Azure temporary resource disk (not persistent across stop or deallocate)

Key Oracle directories:

Directory Purpose
/u01/app/oracle Oracle base directory
/u01/app/oracle/product Oracle Client home directory
/u01/app/oracle/product/bin Client tools (sqlplus, sql, sqlldr, tnsping, expdp, impdp, exp, imp, rman, tkprof, adrci, wrap, mkstore, orapki, netca)
/u01/app/oracle/product/lib Oracle Call Interface libraries (libclntsh.so)
/u01/app/oracle/product/jdbc/lib JDBC drivers (ojdbc8.jar, ojdbc11.jar)
/u01/app/oracle/product/network/admin Oracle Net configuration (sqlnet.ora, your tnsnames.ora)
/u01/app/oraInventory Oracle Universal Installer inventory

Managing the Oracle Client

The Oracle Client is a set of tools and libraries, not a running service: there is nothing to start or stop. Switch to the oracle user and source the environment to use the tools:

sudo su - oracle
. ~/setEnv.sh

Check the client is ready:

sqlplus -V
which sqlplus

Scripts and Log Files

Script/Log Path Description
setEnv.sh /home/oracle Sets the Oracle environment variables for sqlplus and the other tools
initial_boot_update.sh /stage/scripts Runs yum -y update as root at every boot
initial_boot_update.log /stage/scripts The output of every boot's update

On Startup

Root's crontab runs /stage/scripts/initial_boot_update.sh at every boot (@reboot). It runs yum -y update and appends the output to /stage/scripts/initial_boot_update.log. See it with:

sudo crontab -l

Expected output:

@reboot /stage/scripts/initial_boot_update.sh

To stop the update at boot, for example to control when packages change, remove that line with sudo crontab -e. Then run sudo yum -y update on your own schedule.

Troubleshooting

Cannot connect via SSH

  1. Verify the VM is in the Running state: az vm show --resource-group myResourceGroup --name my-oracle-client-vm --show-details --query powerState -o tsv
  2. Check that port 22 is allowed from your address in the Network Security Group
  3. Use the administrator user name you chose at deployment, with the key you gave
  4. Sign in as that user, not as root: root's key login only prints a message and disconnects

yum says another app is currently holding the yum lock

The boot update is still running. Wait for it as Step 3 shows.

sqlplus: command not found

  1. Confirm you switched to the oracle user: sudo su - oracle
  2. Source the environment script: . ~/setEnv.sh
  3. Verify the install path exists: ls /u01/app/oracle/product/bin/sqlplus
  4. Confirm /u01 is mounted: df -h /u01

ORA-12154: TNS:could not resolve the connect identifier specified

  1. Check that your alias is defined in tnsnames.ora: cat $ORACLE_HOME/network/admin/tnsnames.ora
  2. Validate the alias resolves: tnsping MY_DATABASE
  3. Watch for typos in the alias name

ORA-12170: TNS:Connect timeout occurred

  1. Confirm the database host and port are reachable from the VM: timeout 5 bash -c '</dev/tcp/YOUR_DB_HOSTNAME/1521' && echo reachable
  2. Check the database side's Network Security Group allows inbound from your VM
  3. Verify route tables, peering, or VPN from this Azure VM to the database network

ORA-12541: TNS:no listener

  1. The remote database listener may be down. Check with the DBA managing the database
  2. Confirm the port number in your tnsnames.ora entry
  3. Run tnsping MY_DATABASE to confirm the listener responds

Security Recommendations

  • Plan the move off Oracle Linux 7: the free channel publishes no new fixes (see the support dates at the top of this guide)
  • Restrict outbound access: Only allow outbound TCP 1521 from this VM to the Oracle databases it needs to reach
  • Protect tnsnames.ora: It names your database hosts and services. Keep its permissions tight
  • Keep passwords off the command line: Let SQL*Plus prompt for them, or store them in an Oracle Wallet (mkstore)
  • Encrypt connections: Configure Oracle Net encryption for client to database traffic
  • Limit SSH access: Allow port 22 only from trusted addresses

Support

If you encounter any issues with this product, contact cloudimg support:

For Oracle licensing questions, contact your Oracle account manager.

Oracle and Oracle Database are registered trademarks of Oracle Corporation. cloudimg is an independent provider and is not affiliated with or endorsed by Oracle Corporation.