Reader small image

You're reading from  Oracle Advanced PL/SQL Developer Professional Guide

Product typeBook
Published inMay 2012
Reading LevelExpert
PublisherPackt
ISBN-139781849687225
Edition1st Edition
Languages
Right arrow
Author (1)
Saurabh K. Gupta
Saurabh K. Gupta
author image
Saurabh K. Gupta

Saurabh K. Gupta is a seasoned database technologist with extensive experience in designing high performance and highly available database applications. His technology focus has been centered around Oracle Database architecture, Oracle Cloud platform, Database In-Memory, Database Consolidation, Multitenant, Exadata, Big Data, and Hadoop. He has authored the first edition of this book. He is an active speaker at technical conferences from Oracle Technology Network, IOUG Collaborate'15, AIOUG Sangam, and Tech Days. Connect with him on his twitter handle (or SAURABHKG) or through his technical blog www.sbhoracle. wordpress.com, with comments, suggestions, and feedback regarding this book.
Read more about Saurabh K. Gupta

Right arrow

Chapter 8, Compiling and Tuning to Improve Performance


Question No.

Answer

Explanation

1

a and b

Interpreted compilation mode is preferred when a program unit is in development stage and involves SQL statement processing.

2

c and d

The Real Native compilation method removes the dependency on C compiler to generate DLL for the program unit. Instead, the native DLLs are stored in the database dictionary itself. As the DLLs are stored in the dictionary, they can be a part of the normal backup and recovery.

3

b

The PLSQL_OPTIMIZE_LEVEL value set to 3 strictly inlines all the subprograms at high priority.

4

b and c

The PLSQL_CODE_TYPE value specified during recompilation of a program overrides the current system or session settings. Its default value is INTERPRETED and it must be updated in the spfile instance after the database upgrade process. In real native mode, the libraries are stored in the SYSTEM tablespace.

5

a and c

Usage of BULK COLLECT can pull multi-row data from the database in a single attempt, thus reducing context switches. PLS_INTEGER is a preferred data type in arithmetic calculations.

6

d

Inlining of subprograms is only supported at optimization level greater than one.

7

b and c

The F_ADD local function would be called inline because its call has been marked inline using PRAGMA INLINE. It might also be considered for inlining as the PLSQL_OPTIMIZE_LEVEL value is 2.

8

b

The DLLs generated from the Real Native compilation are stored in the SYSTEM tablespace.

9

a and d

The NOT NULL data types add overhead to check every assignment for nullity. L_SUM must be declared as

L_SUM NATURAL;

Usage of appropriate data types to avoid implicit typecasting improves performance. L_ID must be declared as NUMBER.

10

a, c, and d

PRAGMA INLINE works for PLSQL_OPTIMIZE_LEVEL values 2 and 3. At level 1, the Oracle optimizer doesn't consider any subprogram for inlining. At level 3, all subprograms are strictly called for inline. However, inlining of a subprogram can be set off by specifying PRAGMA INLINE (<Function name>,'NO').

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Oracle Advanced PL/SQL Developer Professional Guide
Published in: May 2012Publisher: PacktISBN-13: 9781849687225

Author (1)

author image
Saurabh K. Gupta

Saurabh K. Gupta is a seasoned database technologist with extensive experience in designing high performance and highly available database applications. His technology focus has been centered around Oracle Database architecture, Oracle Cloud platform, Database In-Memory, Database Consolidation, Multitenant, Exadata, Big Data, and Hadoop. He has authored the first edition of this book. He is an active speaker at technical conferences from Oracle Technology Network, IOUG Collaborate'15, AIOUG Sangam, and Tech Days. Connect with him on his twitter handle (or SAURABHKG) or through his technical blog www.sbhoracle. wordpress.com, with comments, suggestions, and feedback regarding this book.
Read more about Saurabh K. Gupta