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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

168 CHAPTER 4 ■ PERFORMANCE MANAGEMENTWe’ll now review the major new performance-related features in the <strong>Oracle</strong> <strong>Database</strong> <strong>11</strong>grelease, starting with SQL and PL/SQL performance improvements.SQL and PL/SQL Performance Enhancements<strong>Oracle</strong> <strong>Database</strong> <strong>11</strong>g introduces several enhancements in PL/SQL programming and execution.Some of these improvements are transparent, such as the PL/SQL result cache, which cachesexecution results so that frequently executed identical PL/SQL statements can use those resultsinstead of executing the same statement repeatedly.In addition to performance-improving enhancements, several language features improvethe functionality and usability of PL/SQL programming. You’ll learn about these programmingenhancements in Chapter <strong>11</strong>. Let’s turn to a review of the important PL/SQL performanceenhancingnew features.Automatic “Native” PL/SQL CompilationIn previous releases of the database, <strong>Oracle</strong> transformed all PL/SQL code to C code, which inturn was compiled by a third-party C compiler. This posed a problem in organizations thatdidn’t want to or couldn’t install a C compiler on their servers. In <strong>Oracle</strong> <strong>Database</strong> <strong>11</strong>g, <strong>Oracle</strong>directly translates the PL/SQL source code to the DLL for the server. In addition, <strong>Oracle</strong> bypassesthe file system directories by doing the linking and loading itself.Except setting one new initialization parameter, you don’t need to configure anything totake advantage of the PL/SQL native compilation. This parameter is plsql_code type, whichyou can use to turn automatic native PL/SQL compilation on and off. Tests performed by<strong>Oracle</strong> showed a performance improvement of up to 20 times with native PL/SQL compilation.Using Real Native CompilationBy default, the database interprets PL/SQL code instead of directly compiling it. You can usePL/SQL native compilation now without any third-party software such as a C compiler or adynamic link library (DLL) loader. The new initialization parameter plsql_code_type specifiesthe compilation mode for PL/SQL library units and can take one of two values: interpreted orcompiled.• If you set the parameter to interpreted, the database will compile all PL/SQL code to PL/SQL bytecode format, and the PL/SQL interpreter engine will execute them.• If you set the parameter to native, most PL/SQL code will be compiled to machine codeand executed natively without the involvement of an interpreter, thus making executionfaster.The default value of the plsql_code_type parameter is set to interpreted. To turn on nativePL/SQL compilation, set the plsql_code_type initialization parameter as follows:plsql_code_type=nativeYou can change the value of the plsql_code_type parameter dynamically, with either analter system or alter session statement. However, the switch in compilation mode won’taffect the PL/SQL units that have already been compiled. Once the database compiles a PL/SQL

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

Saved successfully!

Ooh no, something went wrong!