Database Reference
In-Depth Information
ODP.NET
To set the four attributes, you use the
ClientId
,
ClientInfo
,
ModuleName
, and
ActionName
properties of the
OracleConnection
class. Note that except for the
ClientId
property, the others are available only from
version 11.1.0.6.20 onward. In order to prevent pooled connections from taking over settings, the properties are
set to
null
when the
Close
or
Dispose
method of the
OracleConnection
class is called. The following code snippet,
which is an excerpt of the
SessionAttributes.cs
file, shows how to set the properties:
connection.ClientId = "helicon.antognini.ch";
connection.ClientInfo = "Linux x86_64";
connection ModuleName = "SessionAttributes.cs";
connection.ActionName = "test session information";
PHP
To set the four attributes, you use functions provided in the PECL OCI8 extension. Each function takes two parameters
as input (a connection and the attribute's value) and returns a Boolean value (
TRUE
on success and
FALSE
on failure).
The four functions are:
oci_set_client_identifier
•
oci_set_client_info
•
oci_set_module_name
•
oci_set_action
The following code snippet, which is an excerpt of the
session_attributes.php
script, shows how to set all
attributes:
•
oci_set_client_identifier($connection, "helicon.antognini.ch");
oci_set_client_info($connection, "Linux x86_64");
oci_set_module_name($connection, "session_attributes.php");
oci_set_action($connection, "test session information");
Note that these functions are only available as of OCI8 version 1.4 and when OCI8 is linked with client libraries of
version 10.1 or newer.
On to Part 2
This chapter describes the operations carried out by the database engine when parsing and executing SQL statements.
Particular attention is given to the pros and cons related to using bind variables. In addition, the chapter introduces
some frequently used terms and describes how to instrument the application code and the database calls.
Part 2 is devoted to answering the first two questions posed in Figure 1-4:
•
Where is the time spent?
•
How is the time spent?
Simply put, the three chapters in Part 2 describe approaches to finding out where the problem is and what's
causing it. Because failing to fix a performance problem is usually not an option, failing to correctly answer these
questions isn't an option either. Naturally, if you don't know what's causing a problem, you'll find it impossible to fix.