Oracle Database Client 18c on Oracle Linux 8
Overview
Oracle Database Client 18c (version 18.3.0.0.0) provides the tools and libraries to connect to and manage legacy Oracle 18c, 12.x and earlier database instances. It includes SQL*Plus, sqlldr, tnsping, expdp, impdp, the full Oracle Net client utility set, and OCI and JDBC drivers, and it needs no database server on the same VM.
This guide shows how to deploy and configure it on Oracle Linux 8 on Microsoft Azure, from SecureAnyCloud's preconfigured virtual machine image on the Azure Marketplace.
What you get:
- Oracle Database Client 18c 18.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, exp, imp, tkprof, rman, adrci, 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
- A libnsl shim and OEL8 compatibility layer, so 18c binaries link cleanly on Oracle Linux 8
- The bundled Oracle JDK replaced with the system OpenJDK, so security patches arrive via dnf
- An OS package update script for keeping the system current
- Azure Linux Agent (waagent) for Azure integration
- cloud-init for automated provisioning
- 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/18c/client_1 TNS Admin: /u01/app/oracle/product/18c/client_1/network/admin
Compatibility Note
Oracle originally certified Oracle Database Client 18c on Oracle Linux 5, 6 and 7. SecureAnyCloud packages 18c on Oracle Linux 8 by installing the equivalent compatibility libraries (libnsl, libxcrypt-compat, libstdc++ 32-bit) and relinking the client binaries against the OL 8 system libraries.
The result is functionally equivalent to a certified install for the customer-facing tooling (SQL*Plus, Oracle Net, sqlldr, expdp, impdp). For Oracle support questions about this combination, contact your Oracle account manager. SecureAnyCloud provides 24/7 support for the platform integration.
Prerequisites
Before you deploy the 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 (or SID) 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 of disk space.
Deploy the Virtual Machine
Option A: Azure Portal
- Open the Azure Marketplace and search for "Oracle Database Client 18c Oracle Linux 8 SecureAnyCloud"
- Select the image and click Create
- Configure the basics as follows:
- Subscription: Select your Azure subscription
- Resource Group: Create new or select existing
- Virtual Machine Name: Enter a name for your VM
- Region: Select your preferred Azure region
- Size:
Standard_B2srecommended - 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-18c-client-oel8:default:latest
az vm create \
--resource-group myResourceGroup \
--name my-oracle-client-18c-vm \
--image sac1647283583153:oracle-db-18c-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. Review your Network Security Group and route table to confirm that the VM can reach your target Oracle Database server on the listener port.
Connect via SSH
When your VM is running, connect over SSH:
ssh azureuser@<public-ip-address>Find your VM's public IP:
az vm show --resource-group myResourceGroup --name my-oracle-client-18c-vm --show-details --query publicIps -o tsvSwitch to the root user:
sudo su -Important: Wait for the VM to reach a running state before you connect. Early connection attempts can fail with permission denied errors while cloud-init completes initial provisioning.
Switch to the Oracle User and Set Environment
The dedicated oracle OS user owns the Oracle Client software. Switch to this user and source the environment. Type this command rather than copying and pasting it:
sudo su - oracle cd $HOME . ./setEnv.sh sqlplus -VExpected output:
The 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/18c/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.AL32UTF8The image also installs a system-wide hook at /etc/profile.d/oracle-client.sh, so any future Linux user on the VM picks up the same environment automatically on login.
Explore the Client Tooling
sqlplus -H prints a usage summary of every command-line option that the SQL*Plus binary understands. It is the fastest way to confirm that the client is fully functional and to look up an option without leaving the shell:
sqlplus -H | head -28Expected output:
Browse the install tree to see the full set of binaries shipped with the Administrator install set:
ls $ORACLE_HOME/
ls $ORACLE_HOME/bin/ | grep -E "sqlplus|sqlldr|tnsping|exp|imp|rman"Expected output:
Configure tnsnames.ora
Before you connect to a remote Oracle Database, add an entry for it to tnsnames.ora. As the oracle user, run these commands 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 these values:
- YOUR_DB_HOSTNAME with the IP address or DNS name of your Oracle Database server
- 1521 with the port number if different from the default
- YOUR_SERVICE_NAME with the service name of the target database
Verify that Oracle Net loads correctly and your environment is set:
env | grep -E "^(ORACLE_|TNS_|LD_LIBRARY)" tnsping invalid_aliasExpected output:
The TNS Ping Utility for Linux: Version 18.3.0.0.0 banner confirms the Oracle Net layer loads. The TNS-03505: Failed to resolve name error against the example alias is expected. To test against your real database, use the alias you just added to tnsnames.ora:
tnsping MY_DATABASEThe command returns one of these results:
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 unresolvable. The TNS layer is loading correctly. Replace the example host.TNS-12541: TNS:no listenerif the hostname resolves but nothing is listening on port 1521. Check that the target listener is up and reachable from this VM.
Connect to a Remote Database via 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_DATABASEAlternatively, use the EZCONNECT syntax, which needs no tnsnames.ora entry:
sqlplus 'system/your_password@//your-db-host:1521/your-service-name'Expected output:
SQL*Plus: Release 18.3.0.0.0 Production Copyright (c) 1982, 2009, Oracle. All rights reserved. Connected to: Oracle Database ... SQL>Type EXIT to leave the SQL*Plus session.
Server Components
Component Version Install Path
Oracle Database Client 18c (Administrator) 18.3.0.0.0 /u01/app/oracle/product/18c/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/18c/client_1 Oracle Client home directory
/u01/app/oracle/product/18c/client_1/bin Client binaries (sqlplus, sqlldr, tnsping, expdp, impdp, exp, imp, tkprof, rman, adrci)
/u01/app/oracle/product/18c/client_1/lib Oracle Net libraries (libclntsh.so)
/u01/app/oracle/product/18c/client_1/network/admin TNS configuration files (tnsnames.ora, sqlnet.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 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.shVerify the client is ready:
sqlplus -V which 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 as of first boot. 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 via SSH
- Verify the VM is in Running state in the Azure Portal
- Check that port 22 is allowed in the Network Security Group
- Ensure you are using the correct username:
azureuser - Verify your SSH key matches the one configured during deployment
sqlplus: command not found
- Confirm you switched to the oracle user:
sudo su - oracle - Source the environment script:
. ~/setEnv.sh - Verify the install path exists:
ls /u01/app/oracle/product/18c/client_1/bin/sqlplus - Confirm
$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
TNS_ADMINpoints at the network/admin directory:echo $TNS_ADMIN - Validate the alias resolves:
tnsping MY_DATABASE - Watch for typos and case sensitivity in the alias name
ORA-12170: TNS:Connect timeout occurred
- Confirm the target database hostname and port are reachable from the VM:
nc -vz YOUR_DB_HOSTNAME 1521 - Check the Network Security Group on the target database side allows inbound from your VM
- Verify route tables, peering, or VPN from this Azure VM to the target database network
- If the target is on-premises, confirm Azure ExpressRoute or site-to-site VPN connectivity
ORA-12541: TNS:no listener
- The remote database listener may be down. Check with the DBA managing the target database
- Confirm you are using the correct port number in your tnsnames.ora entry
- Run
tnsping MY_DATABASEto confirm the listener responds at the protocol layer
Security Recommendations
- Restrict outbound access: Only allow outbound TCP 1521 from this VM 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 private databases. Keep file permissions tight and do not share the file
- Use wallets for credentials: Configure Oracle Wallet so 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 18c on Oracle Linux 8 on Azure with 24/7 support from SecureAnyCloud.
View this image
Need Help?
Our support team is available 24/7.
sales@secureanycloud.com
Overview
This guide shows how to launch and use the Oracle Database Client 18c 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 pick 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.
Oracle Database Client 18c is the client of Oracle Database 18c, which is past Premier Support and never had Extended Support. It is in Sustaining Support only, with no new Oracle patches (step 10). Use this version for connecting to legacy databases, where an application has to stay on the 18c client or where your databases still run older releases. For new work, choose a current client release from the same listing.
The image is the Administrator install type, which includes:
- SQL*Plus, SQL*Loader (
sqlldr), tnsping, the Data Pump clients (expdp,impdp), the original export and import clients (exp,imp),adrci,orapkiandmkstore - The OCI client library (
libclntsh.so), the OCCI C++ library (libocci.so), the JDBC driver (ojdbc8.jar) and the ODBC driver (libsqora.so.18.1) for your own applications - Oracle Net, configured through
sqlnet.oraandtnsnames.ora
Base release only. The client is installed from Oracle's 18c base release media, version 18.3.0.0.0, with no Oracle patch applied. SecureAnyCloud checks the media against the SHA-256 checksum that Oracle published for it 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. Oracle certified Database 18c on Oracle Linux 7, before Oracle Linux 8 existed, and the 18c installer's supported-OS check stops on Oracle Linux 8. SecureAnyCloud runs the installer with CV_ASSUME_DISTID=OEL7.6, which skips that check. Nothing else is changed.
The 18c client links its programs during installation, and that link runs cleanly with the Oracle Linux 8 toolchain, as does Oracle's relink, which Oracle patches run. 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 client installs and runs on Oracle Linux 8, which the first-boot check and the self-test (step 5) prove on your instance. 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.
The SecureAnyCloud image adds:
- 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 18.3.0.0.0. If anything differs, the unit fails, so 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, andsqlplus,sqlldrandtnspingalso 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 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. 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 then Subscribe. When the subscription is active, choose Launch your software. In Version, pick Oracle Database Client 18c 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 values in angle brackets 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-18c}]'When 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 18c 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, and 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 15:41:33 EDT; 3min 35s ago Process: 652 ExecStart=/usr/local/sbin/sac-oracle-client-firstboot (code=exited, status=0/SUCCESS) Main PID: 652 (code=exited, status=0/SUCCESS) 2026-10-24T19:40:54Z first boot verification started 2026-10-24T19:41:33Z verified 463 files of the Oracle home; SQL*Plus 18.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 commands in this guide also source /etc/profile.d/oracle-client.sh first, so they work the same 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/18.3.0/client_1 TNS_ADMIN=/u01/app/oracle/product/18.3.0/client_1/network/admin SQL*Plus: Release 18.0.0.0.0 - Production Version 18.3.0.0.0 adrci exp expdp imp impdp mkstore orapki sqlldr sqlplus tnspingOracle names every 18c release "Release 18.0.0.0.0"; the Version line is the exact release, here the 18.3.0.0.0 base release.
Path Purpose
/u01/app/oracle/product/18.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/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.18.1 ODBC driver
/u01/app/oraInventory Oracle central inventory
/usr/share/doc/sac/oracle-client-18c/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 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. Run it:
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 (463 files) PASS: login shell: sqlplus -V = 18.3.0.0.0 PASS: wrapper (non-login): sqlplus -V = 18.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), so you can connect without any configuration, or give each database a short alias. Read 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 18c - 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 oracle software owner owns the files, 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/18.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 connect directly with EZCONNECT. SQL*Plus prompts for the password, which keeps it 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). When you are 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 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. Every wallet you create is your instance's own.
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 holding your database's CA certificate with
orapki, pointWALLET_LOCATIONat it 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 that file, so 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 18c 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/18.3.0/client_1 export TNS_ADMIN=${TNS_ADMIN:-/u01/app/oracle/product/18.3.0/client_1/network/admin} export NLS_LANG=${NLS_LANG:-AMERICAN_AMERICA.AL32UTF8} export LD_LIBRARY_PATH=/u01/app/oracle/product/18.3.0/client_1/lib${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} exec /u01/app/oracle/product/18.3.0/client_1/bin/sqlplus "$@" SQL*Plus: Release 18.0.0.0.0 - Production Version 18.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/ojdbc8.jar(Java 8 and later) 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.18.1as the driver in your unixODBCodbcinst.ini(installunixODBCwithsudo dnf install unixODBC).
Patching
This image ships the 18.3.0.0.0 base release. Under Oracle's Lifetime Support Policy, Premier Support for Oracle Database 18c ended in June 2021 (Oracle's last 18c patch bundles were released in April 2021). Oracle offers no Extended Support for 18c, so it is past Premier and Extended Support. It is in Sustaining Support only, with no new Oracle patches. Check what Oracle provides for it under your support contract.
SecureAnyCloud does not apply or redistribute Oracle patches. They are available to customers with an Oracle support contract through My Oracle Support. Apply the current client patches with your own Oracle support entitlement before you run the client in production:
- Oracle's Critical Patch Update advisories, which list the security fixes in each quarterly update:
https://www.oracle.com/security-alerts/ - The Oracle Database 18c documentation, including patching and upgrading:
https://docs.oracle.com/en/database/oracle/oracle-database/18/
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 and relink as_installed ran cleanly when SecureAnyCloud tested 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 171, from the 18c media) and Perl 5.22 ($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 and reboot if a new kernel was installed.
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=1054,fd=3)) LISTEN 0 128 [::]:22 [::]:* users:(("sshd",pid=1054,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 18c documentation at https://docs.oracle.com/en/database/oracle/oracle-database/18/, 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 18c 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