没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
ST E V E N F E UE R S TE I N
CH A R LE S D YE
J O H N B E R ES N I EW I C Z
Editor
D E B B Y R U S S E LL
Copyright © 2010 O'Reilly Media, Inc.
!"#
Click herefor more information on this offer!
Please note that upgrade offers are not available from samplecontent.
$ %
Supplemental files and examples for this book can be found athttp://examples.oreilly.com/9781565923751/.
Please use a standard desktop web browser to access these files, as they may not be accessible from all ereader
devices.
All code files or examples referenced in the book will be available online. For physical books that ship with an
accompanying disc, whenever possible, we’ve posted all CD/DVD content. Note that while we provide as much of
the media content as we are able via free download, we are sometimes limited by licensingrestrictions. Please
direct any questions or concerns tobooktech@oreilly.com.
&
To Veva Silva, the woman who brought me to life.
--Steven Feuerstein
To Natalie.
--Charles Dye
To Arlene.
--John Beresniewicz
'
After publishing more than 1,600 pages on Oracle PL /SQL in two previous books, I marvel at the existence now
of this third book covering yet other aspects of the PL /SQL language. I can still remember quite distinctly a
moment in September, 1994, when I embarked on writing the first draft ofOracle PL /SQL Programmingand
wondered: are there really 400 pages worth of material on that much-used and often-maligned procedural language
from a nonprocedural (SQL) company? If the answer to that question was a resounding “yes” in 1994, then the
answer is a deafening roar today!
Maybe PL /SQL isn’t the answer to every object-oriented programmer’s deepest desires. Maybe developers are
badly in need of—and unreservedly deserve—better tools with which to write, debug, and reuse PL /SQL
programs. Maybe PL /SQL isn’t perfect, but the reality is that hundreds of thousands of people around the world
work (and struggle) with PL /SQL on a daily basis. We all need as much information as possible about how we can
make the best possible use of Oracle PL /SQL.
And that is the objective ofOracle Built-in Packages. If you are going to build complex applications using PL
/SQL, you will not succeed unless you learn about and figure out how to utilize many of the packages described in
this book. Packages are the method of choice for Oracle and third parties like RevealNet, Inc., toextendthe base
PL /SQL language, to improve ease of use, and to provide brand-new functionality in the language. Writing PL
/SQL code without knowing about or using built-in packages is akin to building an automobile and ignoring the
last 20 years of technological advances. The resulting machine will run more slowly, use more gas, and be harder
to repair.
Oracle Built-in Packagesgrew out of Chapter 15 of the first edition ofOracle PL /SQL Programming. When
Oracle released Oracle8, it was time to update that book to include the wide-ranging new PL /SQL8 functionality.
It was clear from the start that this second edition, if organized like the first, would have been well over 1,500
pages in length—a totally impractical size for a developer’s handbook.
What to do? Based on feedback from developers aboutOracle PL/SQL Programming, there was an enormous
amount of interest in, and often confusion surrounding, the built-in packages. These Oracle-provided “add-ons” to
PL /SQL clearly needed more detailed coverage, more examples, more tips, more of just about everything. My
single chapter of 100 pages was woefully inadequate. We made the decision to move that single chapter out
ofOracle PL /SQL Programmingand expand it into a book all its own. You are holding the result.
I recognized early in the process that I couldn’t personally cover all of the Oracle built-in packages discussed in
this book. I didn’t have the necessary expertise, nor the time to learn, nor the time to write it all. So I sought and
received the help of two excellent Oracle technologists: John Beresniewicz and Charles Dye.
Over the past six months, John, Charles, and I have researched the packages provided by Oracle in the database,
verified the documentation, uncovered aberrant behavior, and discovered neat tricks. We also made it a priority to
construct package-based utilities that you will be able to put to immediate use.
WhileOracle Built-in Packagesis a collaborative effort, it is also a combination of very individual efforts. As
such, you will find differences in coding styles and philosophies. Rather than try to enforce a single standard
throughout, I welcomed the variations (as long as all contributed in their own way to a deeper, clearer
understanding of the PL /SQL technology). There is rarely a single right way to do anything, and there is an
enormous amount we can learn from the different journeys each of us takes to a solution.
For purposes of directing feedback and questions, you may find it useful to know who wrote each of the chapters.
In the next section, “Structure of this Book,” you will find the names of the authors listed with their chapters. You
will also see that there are two other names: Chuck Sisk and Chip Dawes. While many people helped in many
ways to produceOracle Built-in Packages(see the “Acknowledgements” for details), Chuck and Chip actually
contributed entire chapters.
'(
This book is divided into four parts:
Part I
Chapter 1, introduces you to PL /SQL packages generally and built-in packages specifically. It shows you how to
call packaged code from your own programs and includes tips for handling the exceptions raised when you call a
packaged program. (Steven)
Part II
Chapter 2, shows you how to use the DBMS_SQL package to construct and execute SQL statements and PL /SQL
blocks at run-time. (Steven)
Chapter 3, shows you how to use DBMS_PIPE and DBMS_ALERT to communicate information between
different Oracle sessions. You can also use DBMS_PIPE to communicate with processes external to Oracle. (John)
Chapter 4, introduces DBMS_LOCK, a handy but rarely used package that provides an interface to the Oracle lock
manager, and DBMS_TRANSACTION, which offers several programs that affect transaction behavior in your
PL /SQL program. (DBMS_LOCK—John; DBMS_TRANSACTION—Steven)
Chapter 5, contains an extensive treatment of Oracle Advanced Queuing, a powerful queuing mechanism available
with Oracle8. You’ll use this mechanism through the DBMS_AQ and DBMS_AQADM packages. (Steven)
Chapter 6, shows you how to send information from your program either to the screen , using DBMS_OUTPUT,
or to a server-side file, using UTL_FILE. (Steven)
Chapter 7, familiarizes you with a handy package, DBMS_APPLICATION_INFO. You’ll use it to “register” the
current execution status of your application with the Oracle database. (John)
Chapter 8, shows you how Oracle8 provides robust support for large objects (sometimes known as “BLOBs” or
“LOBs”), and how the DBMS_LOB built-in package allows you to access and manipulate these LOBs from within
a PL /SQL program. (Chuck)
Chapter 9, collects together several packages that specialize in manipulating different types of data.
DBMS_ROWID makes it easy to work with the two different ROWID formats available in Oracle8. UTL_RAW
allows you to work with raw data. UTL_REF, new in Oracle8 Release 8.1, provides a PL /SQL interface to select
and modify objects (instances of an object type) in an object table without having to specify or know about the
underlying database table. (DBMS_ROWID—Steven; UTL_RAW—Chip; UTL_REF—Steven)
Chapter 10, contains coverage of a number of packages: DBMS_UTILITY (the actual “miscellaneous” package),
DBMS_DDL (contains programs to recompile stored code, analyze objects in your schema, and modify how
object identifiers may be referenced in Oracle8), DBMS_RANDOM (a random number generator), and
DBMS_DESCRIBE (use it to get information about the parameters of a stored program). (Steven)
Part III
Chapter 11, introduces you to DBMS_SESSION and DBMS_SYSTEM, two packages that help you analyze and
manage information about your current session. (John)
Chapter 12, presents DBMS_SPACE and DBMS_SHARED_POOL, which contain handy tools for database
administrators to help them manage database-related resources on the server. (John)
Chapter 13, shows you how to use DBMS_ JOB to schedule the execution of stored procedures without the use of
operating system-specific schedulers, such as UNIX’scron. (John)
Part IV
Chapter 14, explores the packages, DBMS_SNAPSHOT, DBMS_REFRESH, and
DBMS_OFFLINE_SNAPSHOT, and some programs in DBMS_REPCAT, showing how to maintain snapshots,
snapshot groups, and snapshot logs. (Charles)
Chapter 15, explains how to use DBMS_REPCAT, DBMS_REPUTIL, DBMS_OFFLINE_OG,
DBMS_REPCAT_ADMIN, DBMS_REPCAT_AUTH, and DBMS_RECTIFIER_DIFF to create and administer
your replicated databases. (Charles)
Chapter 16, shows you how to configure Oracle to automatically detect, correct, and report many forseeable
conflicts by using procedures in DBMS_REPCAT to create and maintain custom resolution methods. (Charles)
Chapter 17, introduces the DBMS_DEFER package and shows you how to queue deferred remote procedure calls
(RPCs) and use DBMS_DEFER_QUERY and DBMS_DEFER_SYS to perform administrative and diagnostic
activities. (Charles)
Appendix A, explains how to install and use the software on the companion diskette. (A group effort)
) (
The following conventions are used in this book:
Italic
Used for file and directory names and URLs.
Constant width
Used for code examples.
Constant width bold
In some code examples, highlights the statements being discussed.
Constant width italic
In some code examples, indicates an element (e.g., a filename) that you supply.
UPPERCASE
In code examples, indicates PL /SQL keywords.
lowercase
In code examples, indicates user-defined items such as variables, parameters, etc.
Punctuation
In code examples, enter exactly as shown.
Indentation
In code examples, helps to show structure (but is not required).
--
In code examples, a double hyphen begins a single-line comment, which extends to the end of a line.
/*and*/
In code examples, these characters delimit a multiline comment, which can extend from one line to
another.
.
In code examples and related discussions, a dot qualifies a reference by separating an object name from a
component name. For example, dot notation is used to select fields in a record and to specify
declarations within a package.
<>
In syntax descriptions, angle brackets enclose the name of a syntactic element.
[ ]
In syntax descriptions, square brackets enclose optional items.
{ }
In syntax descriptions, curly brackets enclose a set of items; you must choose only one of them.
|
In syntax descriptions, a vertical bar separates the items enclosed in curly brackets, as in
{VARCHAR2 | DATE | NUMBER }.
* '
The built-in packages of Oracle PL /SQL discussed in this book are installed in the Oracle database. Each version
of the Oracle database comes with its corresponding version of PL /SQL and its set of built-in packages. Most of
the built-in packages became available with Oracle Release 7.1. A number of new packages were provided with
Oracle8. The text describes which packages are available only with specific versions of Oracle.
&
You’ll find a high-density Windows disk included with this book. This disk contains theCompanion Utilities
Guide forOracle Built-in Packages, an online tool developed by RevealNet, Inc., that gives you point-and-click
access to more than 175 files of source code and documentation that we developed. Many of the code examples are
also printed in the book. We’ve included these to give you a jump-start on writing your own PL /SQL code and to
keep you from having to type many pages of PL /SQL statements from printed text.
Throughout the book, disk icons (see the earlierSection -1.2section) will indicate where a code example shown or
mentioned in the text is included on the disk.Appendix A, describes how to install the Windows-based interface.
You can run the software in any Microsoft Windows environment (3.1, 95, NT 3.5, NT 4.0). If you are working in
a non-Windows environment, you can obtain a compressed file containing the utilities on the desk from
theRevealNet PL /SQL Pipeline Archives athttp://www.revealnet.com/plsql-pipeline.
+*
剩余63页未读,继续阅读
资源评论
微尘丶霖
- 粉丝: 0
- 资源: 3
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功