oci_set_db_operation

Sets the database operation

&reftitle.description; `bool` `oci_set_db_operation` `resource` `connection` `string` `action`

Sets the DBOP for Oracle tracing.

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

The database operation can subsequently be queried from database administration views such as `V$SQL_MONITOR`.

The `oci_set_db_operation` function is available when OCI8 uses Oracle 12 (or later) Client libraries and Oracle Database 12 (or later).

&reftitle.parameters;

`connection`

- &oci.parameter.connection;

`action`

- User chosen string.

&reftitle.returnvalues;

&return.success;

&reftitle.examples;

### Setting the DBOP

    <?php

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

    // Record the operation
    oci_set_db_operation($c, 'main query');

    // 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 database operations
    // being performed:

    sqlplus system/welcome
    SQL> select dbop_name from v$sql_monitor;

&reftitle.notes; &oci.roundtrip.caution;
&reftitle.seealso;

- `oci_set_action`
- `oci_set_module_name`
- `oci_set_client_info`
- `oci_set_client_identifier`