To check the version of the Oracle Database you are connected to, query PRODUCT_COMPONENT_VERSION and read VERSION_FULL for the Oracle Database row. The terminal command sqlplus -version reports the local SQL*Plus client version, even when no database connection is open.
Before you start
This read-only procedure covers an Oracle Database 19c pluggable database (PDB) and SQL*Plus 19c on Linux or Windows. Use an approved account that can connect to the target PDB service and select from PRODUCT_COMPONENT_VERSION. The examples are untested. If you need a client, see how to install Instant Client and SQL*Plus.
1. Identify the local SQL*Plus version
Run this in your system terminal, not at the SQL*Plus prompt:
sqlplus -version
The SQL*Plus 19c user guide documents that this option prints the client version and returns control to the operating system. If you are comparing a legacy installation with a newer client, the site’s Oracle 12c full-client installation article provides background on the older package. Its release does not identify the connected database.
2. Verify the target PDB in your SQL session
Connect to the PDB service using your approved connection procedure. In the same session you will use for the version check, run:
SELECT SYS_CONTEXT('USERENV', 'CON_NAME') AS container_name,
SYS_CONTEXT('USERENV', 'SERVICE_NAME') AS service_name
FROM dual;
Compare both values with the intended target. CDB$ROOT means the session is in the container database root, not the application PDB. If the target is wrong, reconnect using the correct service and check again. See Oracle’s 19c USERENV parameter reference for the meaning of each value.
3. Read the server version
SELECT product, version, version_full
FROM product_component_version;
Find the row for Oracle Database. Record VERSION_FULL as the server version reported by that session. Oracle’s 19c view reference distinguishes VERSION from the fuller version format introduced in 18c. Other components return a null VERSION_FULL; that is expected and does not mean the database version is missing.
If the query fails or the versions differ
If the view is inaccessible, ask the DBA to run the check for the same service or confirm your read access. If the full-version column is not recognized, verify that the connection actually goes to a 19c server before changing the query. A difference between the local and server versions is not, by itself, a compatibility assessment.
For a patch audit, do not treat the version string as proof that all patch SQL ran successfully. Have the DBA review the SQL patch history in DBA_REGISTRY_SQLPATCH, which records individual apply and rollback attempts.
If your lab keeps the SQL*Plus client and database server on two separate machines, a KVM switch lets you compare the outputs at one desk. Label each capture with the host name so the client version and server release stay easy to tell apart.

