oci_set_module_name

(PHP 5 >= 5.3.2, PHP 7, PECL OCI8 >= 1.4.0)

oci_set_module_nameSets the module name

Opis

oci_set_module_name ( resource $connection , string $module_name ) : bool

Sets the module name for Oracle tracing.

The module name is registered with the database when the next 'round-trip' from PHP to the database occurs, typically when an SQL statement is executed.

The name can subsequently be queried from database administration views such as V$SESSION. It can be used for tracing and monitoring such as with V$SQLAREA and DBMS_MONITOR.SERV_MOD_ACT_STAT_ENABLE.

The value may be retained across persistent connections.

Parametry

connection

Identyfikator połączenia Oracle, zwrócony przez oci_connect(), oci_pconnect(), lub oci_new_connect().

module_name

User chosen string up to 48 bytes long.

Zwracane wartości

Zwraca TRUE w przypadku powodzenia, FALSE w przypadku błędu.

Notatki

Informacja: Wymóg wersji Oracle

Ta funkcja jest dostępna gdy PHP jest połączony z bibliotekami Oracle Database w wersji 10g lub nowszej.

Wskazówka

Wydajność

W starszych wersjach OCI8 lub Oracle Database, informacja kliencka może być ustawiona przy użyciu paczki DBMS_APPLICATION_INFO Oracle. Jest to mniej wydajne niż użycie oci_set_client_info().

Uwaga

Roundtrip Gotcha

Some but not all OCI8 functions cause roundtrips. Roundtrips to the database may not occur with queries when result caching is enabled.

Przykłady

Przykład #1 Setting the module name

<?php

$c 
oci_connect('hr''welcome''localhost/XE');

// Record the module
oci_set_module_name($c'Home Page');

// Code that causes a round-trip, for example a query:
$s oci_parse($c'select * from dual');
oci_execute($s);
oci_fetch_all($s$res);

sleep(30);
?>
// While the script is running, the administrator can see the
// modules in use:

sqlplus system/welcome
SQL> select module from v$session;

Zobacz też:

add a note add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top