Oracle Database Client 21c on Oracle Linux 8
Overview
This guide covers deploying and configuring Oracle Database Client 21c on Oracle Linux 8 on Microsoft Azure. It uses SecureAnyCloud's preconfigured virtual machine image from the Azure Marketplace.
Oracle Database Client 21c provides the tools and libraries needed to connect to and manage remote Oracle 21c and earlier database instances. It includes SQL*Plus, Oracle Net, JDBC and OCI drivers, and the full Administrator install set. You do not need a database server on the same VM.
What you get:
- Oracle Database Client 21c 21.3.0.0.0 (Administrator install) installed at /u01
- A dedicated oracle OS user with an environment script (setEnv.sh)
- SQL*Plus, sqlldr, tnsping, expdp, impdp, and the full Oracle Net client utility set
- Preseeded tnsnames.ora and sqlnet.ora files, ready for your entries
- A system-wide /etc/profile.d hook, so any future user picks up the client tools
- An OS package update script to keep the system current
- The Azure Linux Agent (waagent) for Azure integration
- cloud-init for automated provisioning
- The latest security patches, applied at build time
- 24/7 SecureAnyCloud support with a guaranteed 24 hour response SLA
Platform: Microsoft Azure (Gen2 Hyper-V). Default user: azureuser. Oracle Home: /u01/app/oracle/product/21c/client_1. TNS Admin: /u01/app/oracle/product/21c/client_1/network/admin.
Prerequisites
Before you deploy this image, make sure you have:
- An active Microsoft Azure subscription
- Access to the Azure Portal or Azure CLI
- An SSH key pair for Linux VM access
- The hostname, port, and service name of the Oracle Database you want to connect to
- Network connectivity from the new VM to the target Oracle Database (typically TCP 1521 outbound)
Recommended VM size: Standard_B2s (2 vCPU, 4 GB RAM) or larger. The Oracle Client is a set of libraries and tools rather than a running service, so the minimum requirements are modest: 1 vCPU, 1 GB RAM, and 20 GB disk space.
Deploy the virtual machine
Option A: Azure Portal
- Go to the Azure Marketplace and search for "Oracle Database Client 21c Oracle Linux 8 SecureAnyCloud".
- Select the image and click Create.
- Configure the basics:
- Subscription: Select your Azure subscription.
- Resource Group: Create a new group or select an existing one.
- Virtual Machine Name: Enter a name for your VM.
- Region: Select your preferred Azure region.
- Size: Select
Standard_B2s(recommended). - Under Administrator Account, select SSH public key and enter your key.
- Under Inbound Port Rules, allow SSH (port 22) from your trusted IP only.
- Click Review + Create, then Create.
Option B: Azure CLI
az vm image terms accept --urn sac1647283583153:oracle-db-21c-client-oel8:default:latest
az vm create \
--resource-group myResourceGroup \
--name my-oracle-client-21c-vm \
--image sac1647283583153:oracle-db-21c-client-oel8:default:latest \
--size Standard_B2s \
--admin-username azureuser \
--generate-ssh-keys \
--public-ip-sku StandardImportant: The Oracle Client makes outbound connections to remote databases on port 1521. You do not need to open port 1521 inbound on this VM. Check your Network Security Group and route table to confirm that the VM can reach your target Oracle Database server on the listener port.
Connect over SSH
When your VM is running, connect over SSH:
ssh azureuser@<public-ip-address>To find your VM's public IP address, run:
az vm show --resource-group myResourceGroup --name my-oracle-client-21c-vm --show-details --query publicIps -o tsvTo switch to the root user, run:
sudo su -Important: Wait for the VM to reach a running state before you connect. Early connection attempts can produce permission denied errors while cloud-init completes the initial provisioning.
Switch to the oracle user and set the environment
The Oracle Client software is owned by the dedicated oracle OS user. Switch to this user and source the environment. Type the command rather than copying and pasting it:
sudo su - oracle cd $HOME . ./setEnv.shThe setEnv.sh script sets the Oracle environment variables required for utilities such as sqlplus:
ORACLE_BASE=/u01/app/oracle ORACLE_HOME=/u01/app/oracle/product/21c/client_1 TNS_ADMIN=$ORACLE_HOME/network/admin PATH=$ORACLE_HOME/bin:$PATH LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH NLS_LANG=AMERICAN_AMERICA.AL32UTF8A system-wide hook is also installed at /etc/profile.d/oracle-client.sh. Any future Linux user on the VM picks up the same environment automatically at login.
Configure tnsnames.ora
Before you connect to a remote Oracle Database, add an entry for it to tnsnames.ora. Run the following commands as the oracle user, and replace the example values with your target database details:
cd $HOME . ./setEnv.sh 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) ) ) TNSReplace the following values:
- YOUR_DB_HOSTNAME with the IP address or DNS name of your Oracle Database server
- 1521 with the port number, if it differs from the default
- YOUR_SERVICE_NAME with the service name of the target database
Verify that Oracle Net can resolve the alias:
tnsping MY_DATABASEExpected output (common prefix):
TNS Ping Utility for Linux: Version 21.0.0.0.0 - Production Used parameter files: /u01/app/oracle/product/21c/client_1/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)))The output continues with one of the following:
OK (n msec)ifYOUR_DB_HOSTNAMEresolves 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 existifYOUR_DB_HOSTNAMEis still the example value or cannot otherwise be resolved. This proves that the TNS layer is loading correctly. Replace the example host with a real Oracle database server that you can reach.TNS-12541: TNS:no listenerif the hostname resolves but nothing is listening on port 1521 at that address. Check that the target database listener is up and reachable from this VM.
Any of the three results means that tnsping is wired correctly. Only the first result means that the full round trip to your target database works.
Connect to a remote database with SQL*Plus
With the environment sourced and tnsnames.ora populated, connect to your remote database. The simplest form uses the TNS alias you just created:
cd $HOME . ./setEnv.sh sqlplus system/your_password@MY_DATABASEYou can also use the EZCONNECT syntax, which does not require any edit to tnsnames.ora:
sqlplus 'system/your_password@//your-db-host:1521/your-service-name'Expected output:
SQL*Plus: Release 21.0.0.0.0 Production Copyright (c) 1982, 2021, Oracle. All rights reserved. Connected to: Oracle Database ... SQL>Type EXIT to leave the SQL*Plus session.
Components
Component Version Install Path
Oracle Database Client 21c (Administrator) 21.3.0.0.0 /u01/app/oracle/product/21c/client_1
Oracle Linux 8 /
Note: Component versions may be updated on first boot by the automatic OS package update script.
Filesystem layout
The image uses LVM on a single OS disk. The root filesystem hosts the Oracle Client software under /u01. There is no separate /u01 mount point to manage or resize independently.
Mount Point Size Description
/ 37 GB Root filesystem (LVM logical volume), hosts the Oracle Client software under /u01
/boot 2 GB Operating system kernel files
/boot/efi 100 MB UEFI boot partition (Gen2 Hyper-V)
/var/crash 10 GB Reserved for kernel crash dumps (LVM logical volume)
/mnt varies Azure temporary resource disk (not persistent across stop/deallocate)
Key Oracle directories:
Directory Purpose
/u01/app/oracle Oracle base directory
/u01/app/oracle/product/21c/client_1 Oracle Client home directory
/u01/app/oracle/product/21c/client_1/bin Client binaries (sqlplus, sqlldr, tnsping, expdp, impdp)
/u01/app/oracle/product/21c/client_1/lib Oracle Net libraries (libclntsh.so)
/u01/app/oracle/product/21c/client_1/network/admin TNS configuration files (tnsnames.ora, sqlnet.ora)
/u01/app/oraInventory Oracle Universal Installer inventory
Manage the Oracle Client
The Oracle Client is a set of tools and libraries, not a running service, so there are no services to start or stop. To use the client tools, switch to the oracle user and source the environment:
sudo su - oracle cd $HOME . ./setEnv.shTo verify that the client is ready, run:
sqlplus -V which sqlplusExpected output:
SQL*Plus: Release 21.0.0.0.0 - Production Version 21.3.0.0.0 /u01/app/oracle/product/21c/client_1/bin/sqlplusScripts and log files
Script/Log Path Description
initial_boot_update.sh /stage/scripts Updates the OS with the latest packages on first boot
initial_boot_update.log /stage/scripts Output log for the boot update script
setEnv.sh /home/oracle Sets Oracle environment variables for sqlplus and other tools
oracle-client.sh /etc/profile.d System-wide environment hook for any logged-in user
On startup
An OS package update script runs on first boot to bring the image up to date. To disable it, remove the script and its crontab entry:
sudo rm -f /stage/scripts/initial_boot_update.sh
sudo crontab -e
# Delete the following line, save and exit: @reboot /stage/scripts/initial_boot_update.shTroubleshooting
Cannot connect over SSH
- Verify that the VM is in the Running state in the Azure Portal.
- Check that port 22 is allowed in the Network Security Group.
- Use the correct username:
azureuser. - Verify that your SSH key matches the one you configured during deployment.
sqlplus: command not found
- Confirm that you switched to the oracle user:
sudo su - oracle. - Source the environment script:
. ~/setEnv.sh. - Verify that the install path exists:
ls /u01/app/oracle/product/21c/client_1/bin/sqlplus. - Confirm that
$ORACLE_HOME/binis on your PATH:echo $PATH.
ORA-12154: TNS:could not resolve the connect identifier specified
- Check that your alias is defined in tnsnames.ora:
cat $ORACLE_HOME/network/admin/tnsnames.ora. - Confirm that
TNS_ADMINpoints at the network/admin directory:echo $TNS_ADMIN. - Validate that the alias resolves:
tnsping MY_DATABASE. - Check the alias name for typos and case differences.
ORA-12170: TNS:Connect timeout occurred
- Confirm that the target database hostname and port are reachable from the VM:
nc -vz YOUR_DB_HOSTNAME 1521. - Check that the Network Security Group on the target database side allows inbound traffic from your VM.
- Verify the route tables, peering, or VPN from this Azure VM to the target database network.
- If the target is on-premises, confirm the Azure ExpressRoute or site-to-site VPN connectivity.
ORA-12541: TNS:no listener
- The remote database listener may be down. Check with the DBA who manages the target database.
- Confirm that your tnsnames.ora entry uses the correct port number.
- Run
tnsping MY_DATABASEto confirm that the listener responds at the protocol layer.
Security recommendations
- Restrict outbound access. Allow outbound TCP 1521 from this VM only to the specific Oracle Database servers it needs to reach.
- Protect tnsnames.ora. The TNS configuration file can reveal the hostnames and service names of your databases. Keep its file permissions tight and do not share it.
- Use wallets for credentials. Configure Oracle Wallet so that passwords are not stored in plain text in scripts or shell history.
- Encrypt connections. Configure Oracle Net Services to use SSL/TLS encryption for client-to-database traffic.
- Limit OS access. Restrict SSH access to authorized administrators only.
- Enable auditing. Forward shell history and OS audit logs to a central log store.
- Keep the system updated. Apply Oracle Critical Patch Updates and OS security patches regularly.
Support
If you encounter any issues with this product, contact SecureAnyCloud support:
- Email: sales@secureanycloud.com
- Website: secureanycloud.com
- Product catalog: secureanycloud.com/products
- User guides: secureanycloud.com/guides
- Support hours: 24/7, with a guaranteed 24 hour response SLA
SecureAnyCloud provides Oracle expertise and platform engineering support across AWS, Microsoft Azure, and Alibaba Cloud. For Oracle licensing questions, contact your Oracle account manager.
Oracle and Oracle Database are registered trademarks of Oracle Corporation. SecureAnyCloud is an independent provider and is not affiliated with or endorsed by Oracle Corporation.
Deploy on Azure
Launch Oracle Database Client 21c on Oracle Linux 8 on Azure with 24/7 support from SecureAnyCloud.
View on Marketplace
Need Help?
Our support team is available 24/7.
sales@secureanycloud.com
Overview
Oracle Database Client 21c is the client of Oracle Database 21c, an Oracle Innovation Release. This guide covers launching and using the Oracle Database Client 21c on Oracle Linux 8 AMI from SecureAnyCloud on Amazon EC2. It is one version of the SecureAnyCloud Oracle Database Client listing on AWS Marketplace. You select it as the software version when you subscribe and launch.
The image gives an EC2 instance the tools and libraries to connect to Oracle databases that run somewhere else: on Amazon RDS for Oracle, on another EC2 instance, on premises over a VPN or AWS Direct Connect, or in Oracle Cloud. It is the Administrator install type.
Under Oracle's Lifetime Support Policy, 21c is in Premier Support until July 2027. An Innovation Release has no Extended Support, so after July 2027 it is in Sustaining Support only, with no new Oracle patches (step 10). Use this client where your applications or databases are on 21c. For a long-lived deployment, a Long Term Support Release (19c or 26ai, both in this listing) is supported for longer.
Base release only. The client is installed from Oracle's 21c base release media, version 21.3.0.0.0, with no Oracle patch applied. SecureAnyCloud checks the media against the SHA-256 checksum that Oracle publishes before installing it. Oracle provides patches for the client as support content to customers with an Oracle support contract, so you apply them yourself (step 10). The Oracle Linux 8 packages are fully patched when the image is built.
Oracle Linux 8. The 21.3 installer recognizes Oracle Linux 8 and runs its own prerequisite checks on it. The only items it reports as missing are optional ones for a database server (packages such as ksh and sysstat, the graphical installer's X11 libraries and server kernel settings), which a client does not use. SecureAnyCloud installs past them and changes nothing else.
The 21c client links its programs and libraries during installation, and that link runs cleanly with the Oracle Linux 8 toolchain. The compilers are needed for that link only. The build removes gcc and make right after it, so no compiler ships in the image (install them again before you relink, step 10). The first-boot check and the self-test (step 5) prove on your instance that the client runs. If you need a combination that Oracle has certified, check the certification matrix on My Oracle Support.
Bring your own license. This image includes no Oracle license. The Oracle Database Client is used under Oracle's license terms for it, and you need your own Oracle Database license for every database you connect to.
What you get:
- SQL*Plus, SQL*Loader (
sqlldr), tnsping, the Data Pump clients (expdp,impdp), the original export and import clients (expandimp),adrci,orapkiandmkstore - The OCI client library (
libclntsh.so), the OCCI C++ library (libocci.so), the JDBC drivers (ojdbc8.jarandojdbc11.jar) and the ODBC driver (libsqora.so.21.1) for your own applications - Oracle Net, configured through
sqlnet.oraandtnsnames.ora - A verified Oracle home. When the image is built, SecureAnyCloud records the SHA-256 checksum of every file in the Oracle home's bin and lib directories. On the first boot of your instance, sac-oracle-client-firstboot.service checks every file against that record and checks that SQL*Plus is release 21.3.0.0.0. If anything differs, the unit fails, the instance reports a degraded boot, and /root/oracle-client-FIRSTBOOT-FAILED.txt explains why.
- The environment set for you. Every login shell gets
ORACLE_HOME,TNS_ADMIN,PATHandNLS_LANGfrom/etc/profile.d/oracle-client.sh. Thesqlplus,sqlldrandtnspingcommands also work from scripts and cron through small wrappers in/usr/local/bin. The Oracle programs find their own libraries through the library path that Oracle links into them. The Oracle library directory is therefore never added to the system library path or to a login shell'sLD_LIBRARY_PATH, and an Oracle library (the home carries its own older copy of the expat XML library, for example) can never replace a system one. - No listening service but SSH. The image runs no Oracle listener and no other network service. Only SSH listens on port 22, and the client only makes outbound connections to your databases.
- Hardened Oracle Linux 8. Key-only SSH, SELinux enforcing, the host firewall allowing SSH only, no password on any account (root is locked with no password hash at all), no compiler, the IMDSv2-only instance metadata service, and daily automatic Oracle Linux security updates.
- No shared identity. Each instance generates its own SSH host keys and machine identity on first boot, and no build credential, log or key is left in the image. The client needs no secret of its own, so the image creates none. Oracle wallets are yours to create (step 7).
This is a headless image with no web interface. You work over SSH.
Default user: ec2-user. Architecture: x86_64. Recommended instance type: m5.large.
Prerequisites
- An AWS account subscribed to the listing, an EC2 key pair, and a VPC subnet.
- A security group that allows TCP 22 (SSH) from your own networks only. No other inbound port is needed.
- Outbound network access from the instance to each database's listener port (usually TCP 1521), through the security groups, network ACLs and routes between them.
- The host name or address, port and service name of each database you want to reach, and a database account.
- Your own Oracle Database license for the databases you connect to.
Instance type: m5.large (2 vCPU, 8 GiB) suits interactive SQL*Plus work and most batch loads. Choose a larger type for heavy SQL*Loader or Data Pump work.
Launch from AWS Marketplace
Open the listing on AWS Marketplace, choose View purchase options, and select Subscribe. When the subscription is active, choose Launch your software, then in Version pick Oracle Database Client 21c on Oracle Linux 8.
Choose your Region, an instance type (m5.large is recommended), your key pair, and a security group that opens port 22 from your own networks only. Then launch the instance.
The instance is ready about two minutes after launch.
Launch from the AWS CLI
Replace <ami-id> with the AMI ID of this version in your Region, and replace the other bracketed values with your own. The command requires IMDSv2:
aws ec2 run-instances \
--image-id <ami-id> \
--instance-type m5.large \
--key-name <key-name> \
--subnet-id <subnet-id> \
--security-group-ids <security-group-id> \
--metadata-options HttpTokens=required,HttpEndpoint=enabled \
--tag-specifications 'ResourceType=instance,Tags=[{Key=Name,Value=oracle-client-21c}]'Once the instance is running, retrieve its public address:
aws ec2 describe-instances --instance-ids <instance-id> --query "Reservations[].Instances[].PublicIpAddress" --output textConnect over SSH and check first boot
Version SSH user
Oracle Database Client 21c on Oracle Linux 8 ec2-user
ssh -i <your-key.pem> ec2-user@<public-ip>Check that the first-boot verification has run:
systemctl status sac-oracle-client-firstboot.service --no-pager | head -5 sudo cat /var/log/sac/oracle-client-firstboot.logThe unit is active (exited) with status=0/SUCCESS. The log records how many files of the Oracle home were checked:
● sac-oracle-client-firstboot.service - sac: verify the Oracle Database Client home on first boot Loaded: loaded (/etc/systemd/system/sac-oracle-client-firstboot.service; enabled; vendor preset: disabled) Active: active (exited) since Sat 2026-10-24 21:04:12 EDT; 7min ago Process: 658 ExecStart=/usr/local/sbin/sac-oracle-client-firstboot (code=exited, status=0/SUCCESS) Main PID: 658 (code=exited, status=0/SUCCESS) 2026-10-25T01:03:11Z first boot verification started 2026-10-25T01:04:12Z verified 485 files of the Oracle home; SQL*Plus 21.3.0.0.0If the unit failed, read /root/oracle-client-FIRSTBOOT-FAILED.txt and contact support.
Confirm the client release and tools
Your login shell already has the Oracle environment. The command blocks in this guide also source /etc/profile.d/oracle-client.sh first, so they work the same way in a non-login shell:
. /etc/profile.d/oracle-client.sh echo "ORACLE_HOME=$ORACLE_HOME" echo "TNS_ADMIN=$TNS_ADMIN" sqlplus -V ls "$ORACLE_HOME/bin" | grep -xE 'sqlplus|sqlldr|tnsping|exp|imp|expdp|impdp|adrci|orapki|mkstore' | tr '\n' ' '; echoORACLE_HOME=/u01/app/oracle/product/21.3.0/client_1 TNS_ADMIN=/u01/app/oracle/product/21.3.0/client_1/network/admin SQL*Plus: Release 21.0.0.0.0 - Production Version 21.3.0.0.0 adrci exp expdp imp impdp mkstore orapki sqlldr sqlplus tnspingOracle names every 21c release "Release 21.0.0.0.0". The Version line shows the exact release, here the 21.3.0.0.0 base release.
Path Purpose
/u01/app/oracle/product/21.3.0/client_1 ORACLE_HOME
/u01/app/oracle ORACLE_BASE
$ORACLE_HOME/network/admin TNS_ADMIN: sqlnet.ora and tnsnames.ora
$ORACLE_HOME/jdbc/lib/ojdbc8.jar JDBC Thin driver for Java 8 and later
$ORACLE_HOME/jdbc/lib/ojdbc11.jar JDBC Thin driver for Java 11 and later
$ORACLE_HOME/lib/libclntsh.so OCI client library (C, C++, Python python-oracledb thick mode, Perl, PHP OCI8)
$ORACLE_HOME/lib/libocci.so OCCI C++ client library
$ORACLE_HOME/lib/libsqora.so.21.1 ODBC driver
/u01/app/oraInventory Oracle central inventory
/usr/share/doc/sac/oracle-client-21c/README.txt A summary of this image
Run the self-test
The image carries a self-test that repeats the first-boot checks and proves that the client works end to end without a database. It checks Oracle Net name resolution, a connection attempt that reaches the network layer, the exact listening ports, SELinux, every SSH setting, a root login shell that keeps the system libraries, the accounts, and the absence of a compiler:
sudo /usr/local/sbin/sac-oracle-client-selftestPASS: first-boot verification marker present PASS: no first-boot failure note PASS: Oracle home matches the build manifest (485 files) PASS: login shell: sqlplus -V = 21.3.0.0.0 PASS: wrapper (non-login): sqlplus -V = 21.3.0.0.0 PASS: tnsping: unknown alias refused (TNS-03505) PASS: sqlplus: no listener on this instance (ORA-12541) PASS: only TCP 22 listens PASS: no Oracle listener process PASS: SELinux enforcing PASS: sshd -T passwordauthentication no PASS: sshd -T permitrootlogin no PASS: sshd -T pubkeyauthentication yes PASS: sshd -T x11forwarding no PASS: sshd -T kbdinteractiveauthentication no PASS: sshd -T challengeresponseauthentication no PASS: sshd -T permitemptypasswords no PASS: sshd -T allowtcpforwarding yes PASS: sshd -T maxauthtries 4 PASS: sshd -T clientaliveinterval 300 PASS: sshd -T clientalivecountmax 3 PASS: sshd -T logingracetime 60 PASS: root login shell: no LD_LIBRARY_PATH, system libraries not shadowed (python XML parser loads) PASS: no account carries a password hash, locked or not PASS: no compiler (gcc, cc, c++, g++, make) on the PATH PASS: no core dump or crash report ORACLE_CLIENT_SELFTEST_OKTNS-03505 and ORA-12541 are the expected answers here. The self-test asks for an alias that does not exist and connects to port 1521 on the instance itself, where no listener runs.
Add your databases to tnsnames.ora
sqlnet.ora resolves names through tnsnames.ora first and then EZCONNECT (host:port/service). You can therefore connect without any configuration, or give each database a short alias. Look at the shipped files:
. /etc/profile.d/oracle-client.sh grep -v '^#' "$TNS_ADMIN/sqlnet.ora" cat "$TNS_ADMIN/tnsnames.ora"NAMES.DIRECTORY_PATH = (TNSNAMES, EZCONNECT) SQLNET.EXPIRE_TIME = 10 SQLNET.OUTBOUND_CONNECT_TIMEOUT = 60
# sac Oracle Database Client 21c - Oracle Net service names.
# Add one entry per database, for example:
#
# MYDB =
# (DESCRIPTION =
# (ADDRESS = (PROTOCOL = TCP)(HOST = db.example.com)(PORT = 1521))
# (CONNECT_DATA = (SERVER = DEDICATED)(SERVICE_NAME = ORCLPDB1))
# )The files belong to the oracle software owner, so edit them with sudo. To add an alias, append an entry with your database's host, port and service name:
sudo tee -a /u01/app/oracle/product/21.3.0/client_1/network/admin/tnsnames.ora > /dev/null <<'TNS' MYDB = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = <db-host>)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED)(SERVICE_NAME = <service-name>)) ) TNS tnsping MYDBtnsping resolves the alias and contacts the database listener; it ends with OK (<n> msec) when the listener answers. If it reports TNS-12535 or times out, the network path to the database (security groups, network ACLs, routes) does not allow the connection.
To keep your own tnsnames.ora elsewhere, set TNS_ADMIN to that directory in your shell profile.
Connect with SQL*Plus
Connect with the alias, or directly with EZCONNECT. SQL*Plus prompts for the password, which keeps the password out of your shell history and the process list:
sqlplus <db-user>@MYDB sqlplus <db-user>@//<db-host>:1521/<service-name>For Amazon RDS for Oracle, <db-host> is the DB instance endpoint shown in the RDS console and <service-name> is the database name (ORCL by default). Once connected, run:
SELECT banner_full FROM v$version; SELECT sys_context('USERENV', 'SERVICE_NAME') FROM dual;Never put a password on the command line (sqlplus user/password@db). Every user of the instance can see it in the process list.
For unattended scripts, use an Oracle wallet (a secure external password store) instead. Create it with mkstore in a directory that only your account can read, add WALLET_LOCATION and SQLNET.WALLET_OVERRIDE = TRUE to your own sqlnet.ora, and connect with sqlplus /@MYDB. The image ships no wallet, and every wallet you create belongs to your instance alone.
Encrypt the connection to the database
Oracle Net traffic is not encrypted unless the client and the server agree to encrypt it. sqlnet.ora carries commented settings for both methods:
- Oracle Native Network Encryption. Uncomment the
SQLNET.ENCRYPTION_CLIENTandSQLNET.CRYPTO_CHECKSUM_CLIENTlines (REQUIRED, AES256 and SHA256) to refuse any unencrypted session. The database must accept encryption. Amazon RDS for Oracle enables it with theNATIVE_NETWORK_ENCRYPTIONoption. - TLS (TCPS). Create a wallet that holds your database's CA certificate with
orapki, pointWALLET_LOCATIONat the wallet, and use(PROTOCOL = TCPS)and the database's TLS port in the alias. Amazon RDS for Oracle provides TLS with itsSSLoption and publishes its CA certificates.
. /etc/profile.d/oracle-client.sh grep -n 'ENCRYPTION\|CRYPTO\|WALLET' "$TNS_ADMIN/sqlnet.ora"9:# SQLNET.ENCRYPTION_CLIENT = REQUIRED 10:# SQLNET.ENCRYPTION_TYPES_CLIENT = (AES256) 11:# SQLNET.CRYPTO_CHECKSUM_CLIENT = REQUIRED 12:# SQLNET.CRYPTO_CHECKSUM_TYPES_CLIENT = (SHA256) 14:# WALLET_LOCATION = (SOURCE = (METHOD = FILE) (METHOD_DATA = (DIRECTORY = /path/to/your/wallet)))Edit sqlnet.ora with sudo, as in step 6. If the database is reachable only through a bastion, an SSH tunnel also works: ssh -N -L 1521:<db-host>:1521 ec2-user@<bastion> and connect to //localhost:1521/<service-name>.
Use the client from scripts, cron and applications
A login shell has the environment from /etc/profile.d/oracle-client.sh. Scripts and cron jobs do not read it. For that reason, sqlplus, sqlldr and tnsping are also installed as wrappers in /usr/local/bin that set the environment for that one command:
cat /usr/local/bin/sqlplus env -i PATH=/usr/local/bin:/usr/bin:/bin sqlplus -V#!/bin/bash
# sac Oracle Database Client 21c wrapper: sqlplus from any shell (scripts, cron), environment scoped to this call export ORACLE_BASE=/u01/app/oracle export ORACLE_HOME=/u01/app/oracle/product/21.3.0/client_1 export TNS_ADMIN=${TNS_ADMIN:-/u01/app/oracle/product/21.3.0/client_1/network/admin} export NLS_LANG=${NLS_LANG:-AMERICAN_AMERICA.AL32UTF8} export LD_LIBRARY_PATH=/u01/app/oracle/product/21.3.0/client_1/lib${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} exec /u01/app/oracle/product/21.3.0/client_1/bin/sqlplus "$@" SQL*Plus: Release 21.0.0.0.0 - Production Version 21.3.0.0.0For other Oracle tools in a script, source the profile first (. /etc/profile.d/oracle-client.sh). Applications use the libraries directly:
- Java: add
$ORACLE_HOME/jdbc/lib/ojdbc11.jar(Java 11 and later) orojdbc8.jar(Java 8) to the classpath and connect withjdbc:oracle:thin:@//<db-host>:1521/<service-name>orjdbc:oracle:thin:@MYDBwith-Doracle.net.tns_admin=$TNS_ADMIN. - OCI and OCCI (C, C++, python-oracledb thick mode, PHP OCI8, Perl DBD::Oracle): set
ORACLE_HOMEandLD_LIBRARY_PATH=$ORACLE_HOME/libfor the application, as the wrappers do, rather than adding the directory to the system library path. - ODBC: register
$ORACLE_HOME/lib/libsqora.so.21.1as the driver in your unixODBCodbcinst.ini(installunixODBCwithsudo dnf install unixODBC).
Patch the client
This image ships the 21.3.0.0.0 base release. Oracle Database 21c is an Innovation Release. Under Oracle's Lifetime Support Policy (Oracle Technology Products, effective 2 October 2026), Premier Support for 21c runs until July 2027 and Extended Support is not available for it. After July 2027, 21c is in Sustaining Support only, with no new Oracle patches.
Until then, Oracle releases patches for 21c, including the quarterly Release Updates that carry its security fixes, so the base release is well behind the current client patch level. SecureAnyCloud does not apply or redistribute Oracle patches. Customers with an Oracle support contract can download them through My Oracle Support. Apply the current client patches with your own Oracle support entitlement before you run the client in production. These resources help:
- Oracle's Critical Patch Update advisories, which list the security fixes in each quarterly update:
https://www.oracle.com/security-alerts/ - The Oracle Database 21c documentation, including patching and upgrading:
https://docs.oracle.com/en/database/oracle/oracle-database/21/
Oracle's relink, which Oracle patches run, needs the C and C++ compilers and make, which the image does not ship. Install them first with sudo dnf install gcc gcc-c++ make, from the Oracle Linux 8 repositories. With the compilers present, the install-time link ran cleanly when SecureAnyCloud built this release on Oracle Linux 8. Afterwards, you can remove the compilers with sudo dnf remove gcc gcc-c++ make.
The Oracle home includes Oracle's own Java runtime (Java 8 update 291, from the 21c media) and Perl 5.32 ($ORACLE_HOME/jdk and $ORACLE_HOME/perl), which the Oracle installer and tools use. Oracle's patches update them, not dnf. Use your own current Java runtime for your applications rather than the one in the Oracle home.
The Oracle Linux packages update themselves. dnf-automatic applies Oracle Linux security errata every day. Check it and the pending updates with:
grep -E '^(upgrade_type|apply_updates)' /etc/dnf/automatic.conf systemctl is-enabled dnf-automatic.timerupgrade_type = security apply_updates = yes enabledTo apply every available update now, run sudo dnf upgrade. Reboot if it installed a new kernel.
Check the security defaults
sudo ss -tlnp sudo firewall-cmd --list-services getenforce
sudo sshd -T | grep -E '^(passwordauthentication|permitrootlogin|x11forwarding|pubkeyauthentication) 'State Recv-Q Send-Q Local Address:Port Peer Address:PortProcess LISTEN 0 128 0.0.0.0:22 0.0.0.0:* users:(("sshd",pid=1066,fd=3)) LISTEN 0 128 [::]:22 [::]:* users:(("sshd",pid=1066,fd=4)) dhcpv6-client ssh Enforcing permitrootlogin no pubkeyauthentication yes passwordauthentication no x11forwarding no- Only SSH listens. The image never needs an inbound port beyond 22, so keep port 1521 closed on this instance.
- The SSH settings live in
/etc/ssh/sshd_config.d/00-sac.conf, whichsshd_configreads first. Your EC2 key pair is the only way in. Root login and passwords are refused. - SELinux is enforcing and the host firewall (
firewalld) allows SSH only, alongside your security group. - The instance metadata service accepts IMDSv2 requests only (the AMI requires a session token).
Support and licensing
This image is Bring Your Own License and includes no Oracle license. The Oracle Database Client is used under Oracle's license terms. You need your own Oracle Database license for every database you connect to, and Oracle support for Oracle patches. The AMI price covers SecureAnyCloud's hardening, first-boot verification and support for the image.
- Email: sales@secureanycloud.com
- Website: https://secureanycloud.com
- Support: 24/7, with a 24 hour response SLA
- Every version in this listing: Oracle Database Client on AWS
For the client tools, see the Oracle Database 21c documentation at https://docs.oracle.com/en/database/oracle/oracle-database/21/, in particular the SQL*Plus User's Guide, the Database Utilities guide (SQL*Loader and Data Pump) and the Net Services Administrator's Guide.
Oracle and Java are registered trademarks of Oracle and/or its affiliates. SecureAnyCloud is not affiliated with or endorsed by Oracle.
Deploy on AWS
Launch Oracle Database Client 21c on Oracle Linux 8 on AWS with 24/7 support from SecureAnyCloud.
View on Marketplace
Need Help?
Our support team is available 24/7.
sales@secureanycloud.com