11.07.2015 Views

Oracle Database 11 g - Online Public Access Catalog

Oracle Database 11 g - Online Public Access Catalog

Oracle Database 11 g - Online Public Access Catalog

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

190 CHAPTER 4 ■ PERFORMANCE MANAGEMENTconfiguration file will have OCI client caching enabled for it. You can set the following optionalparameters for clients in the client configuration file.• oci_result_cache_max_size: Sets the maximum size of the query cache for a process (inbytes). This parameter overrides the value set for the client_result_cache_size initializationparameter on the server.• oci_result_cache_max_rset_size: Sets the maximum size (in bytes) of a single queryresult in the query cache for a process.• oci_result_cache_max_rset_rows: Sets the maximum size of a query result set (in rows)for a process.Enabling and Disabling Client CachingOCI applications enable and disable client result caching by using OCIStmtExecute() modewith the mode values OCI_RESULT_CACHE and OCI_NO_RESULT_CACHE to override the SQL hintsno_result_cache and result_cache.Intra Unit InliningIntra unit inlining, also called procedure inlining when applied to PL/SQL procedures, is another<strong>Oracle</strong> <strong>Database</strong> <strong>11</strong>g new feature that promises tremendous gains in PL/SQL performance. <strong>Oracle</strong>claims that by using this new feature appropriately, you could achieve performance gains bya factor of two to ten times. Intra unit inlining is a process that replaces a call to a procedure,function, subroutine, or method with a copy of the body of that object, which always runsmuch faster than the actual procedure, function, or subroutine. The database automaticallyfinds candidates for inlining, but you can influence the process with the initialization parameterplsql_optimization_level and the pragma inline directive. <strong>Oracle</strong> suggests you inlineonly small, frequently run procedures. The PL/SQL performance tool plstimer can help youidentify procedures that may benefit from inlining.By setting the initialization parameter plsql_optimize_level to a value of 3, you can makethe PL/SQL complier search for PL/SQL calls that are candidates for inlining and inline themost promising of those calls. You can also specify the plsql_optimization_level parameterdynamically inside a procedure, as shown here:SQL> alter procedure test compileplsql_optimize_level = 3reuse settings;You can also use the pragma inline directive inside a subroutine to direct the database toinline the subroutine. Please see Chapter <strong>11</strong> for more details on the intra unit inlining feature.Automatic SQL TuningAlthough a DBA could manually tune poorly performing SQL statements, the large number ofdistinct SQL statements in any real-life production database and the expertise it requires towrite good SQL code, design fast data access, and work with explain plans and trace outputmakes manual tuning quite a daunting task, besides being extremely time consuming.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!