Chapter 23. Inside PL/SQL

I am fascinated by, though generally ignorant of, what happens under the hood of my car. Most of the time, my ignorance isn’t a problem; if something breaks, I take it to the shop and pay someone else who compensates for my ignorance. Unlike the average repair shop customer, though, I like to go out on the shop floor and, um, “interview” the mechanics while they are working. “What’s that thing? How come they designed it like this? What will happen if we just leave this thing alone?” That sort of thing. They love to see me coming.

As an application developer, your knowledge of PL/SQL and Oracle internals is probably similar to my knowledge of internal combustion engines. You may have a curiosity about the subject, but you’re generally too busy driving to much care about it ... that is, until something breaks.

This is definitely the chapter for people who like to hassle the mechanics.

Just to be clear, I’m not an expert on Oracle or PL/SQL internals, but I’ve bugged quite a few of them, and they’ve generally been kind enough to answer my questions. In this chapter, you will find the fruit of my bugging, including a study of the following questions:

  • What’s better: an anonymous block, a top-level procedure, or a package?

  • Should server-side code use conventional compilation or native compilation?

  • Is there any way to reduce the ripple effect when recompiling a stored program?

  • Should my program run with the privileges of its owner (the definer rights model) or of the ...

Get Oracle PL/SQL Programming, 4th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.