oci_server_version

(PHP 5, PECL OCI8 >= 1.1.0)

oci_server_versionReturns the Oracle Database version

Description

string oci_server_version ( resource $connection )

Returns a string with the Oracle Database version and available options

Parameters

connection

Return Values

Returns the version information as a string or FALSE on error.

Examples

Example #1 oci_server_version() example

<?php

$conn 
oci_connect("hr""hrpwd""localhost/XE");
echo 
"Server Version: " oci_server_version($conn);

// Displays:
// Server Version: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
// With the Partitioning, OLAP, Data Mining and Real Application Testing option

oci_close($conn);

?>

Notes

Note:

In PHP versions before 5.0.0 you must use ociserverversion() instead. This old name still can be used. However it is deprecated and not recommended.

See Also

Коментарии

Автор:
Here's now to extract just the major.minor version number:

<?php
$link 
oci_new_connect($username$password$server"AL32UTF8");
$server_info oci_server_version($link);
$version preg_replace('~^.* (\d+\.\d+)\.\d+\.\d+\.\d+.*~s''\1'$server_info);

echo 
"$server_info<br>";
// Oracle Database 11g Release 11.2.0.4.0 - 64bit Production
echo "$version<br>";
// 11.2
?>

And here's how to look up version via SQL:

https://www.oracle.com/pls/topic/lookup?ctx=db122&id=ADMIN11039

SELECT * FROM PRODUCT_COMPONENT_VERSION;

PRODUCT                                  VERSION     STATUS
---------------------------------------- ----------- -----------
NLSRTL                                   12.1.0.0.1  Production
Oracle Database 12c Enterprise Edition   12.1.0.0.1  Production
PL/SQL                                   12.1.0.0.1  Production
?>
2019-08-27 15:25:49
http://php5.kiev.ua/manual/ru/function.oci-server-version.html

    Поддержать сайт на родительском проекте КГБ