Show installed version and patch level
Oracle
SELECT * FROM v$version;
-- Registered RU/patch history (SQL layer):
SELECT patch_id, action, status, action_time
FROM dba_registry_sqlpatch ORDER BY action_time;
-- From the OS shell (patches installed in ORACLE_HOME):
-- $ORACLE_HOME/OPatch/opatch lspatchesThe v$version banner gives the version. dba_registry_sqlpatch shows whether applied Release Updates (RU) and one-off patches have been registered in the SQL layer, while 'opatch lspatches' shows the binary patches in the home.
PostgreSQL
SELECT version();
-- Numeric version only:
SHOW server_version;
SELECT current_setting('server_version_num');version() returns the full text including build information. PostgreSQL has no separate patch number; the minor version (e.g. 16.3) represents the fix level.
MySQL
SELECT VERSION();
-- Detailed build information:
SHOW VARIABLES LIKE 'version%';VERSION() returns e.g. '8.0.36'; the last component is the patch (release) level. The version_comment variable indicates whether the build is Community/Enterprise or MariaDB.
SQL Server
SELECT @@VERSION;
-- Structured version fields:
SELECT SERVERPROPERTY('ProductVersion') AS version,
SERVERPROPERTY('ProductLevel') AS service_pack,
SERVERPROPERTY('ProductUpdateLevel') AS cu_level,
SERVERPROPERTY('ProductUpdateReference') AS kb_number,
SERVERPROPERTY('Edition') AS edition;ProductUpdateLevel gives the applied Cumulative Update (e.g. CU12), and ProductUpdateReference gives the related KB number. ProductLevel shows 'RTM' or, on older versions, 'SP'.
MongoDB
db.version()
// Detailed build information:
db.serverBuildInfo()
// or: db.adminCommand({ buildInfo: 1 })db.version() returns the version string (e.g. '7.0.11'). In MongoDB, fixes are released as a new patch version; there is no separate 'patch level' concept.
Redis
INFO server
# redis-cli one-liner: redis-cli INFO server | grep redis_versionThe redis_version field in the INFO server output gives the installed version. In Redis, fixes ship as a new patch version (e.g. 7.2.5); the redis_git_sha1 field also shows the build identifier.
Elasticsearch
GET /
# curl: curl -s http://localhost:9200/The root endpoint returns version.number (e.g. '8.14.1'), lucene_version, and build_flavor. To see the versions of all nodes: GET _cat/nodes?v&h=name,version