1. Trang chủ
  2. » Công Nghệ Thông Tin

Sams oracle perfomance tuning and optimization apr 1996 ISBN 067230886x

1K 40 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 1.022
Dung lượng 3,61 MB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

A large amount of binary data stored within an Oracle database.. In Oracle, the block buffers and shared pool are considered caches becausethey are used to store data and instructions fo

Trang 1

Sams, Macmillan Computer Publishing

ISBN: 067230886x Pub Date: 04/01/96

Table of Contents

Trang 2

Glossary

I have always thought that a glossary and an index greatly enhance the value of abook I have made it a priority to have a complete and accurate glossary andindex Enjoy

ad-hoc.

From the Latin this is This term is used to describe an impromptu or

spontaneous action Most commonly used in terms of an ad-hoc query to mean an impromptu, simple query.

batch processing system.

Used to perform large background jobs, usually within a certain specifiedtime window

BLOB (Binary Large Data).

A large amount of binary data stored within an Oracle database BLOB datacan consist of audio, video, images, documents, and so on; it is usuallystored as LONG data

block.

The smallest unit of storage in an Oracle database The database blockcontains header information concerning the block itself as well as the data

buffer.

An amount of memory used to store data A buffer stores data that is about

to be used or that has just been used In many cases, buffers are in-memory

Trang 3

be created in memory as temporary storage

In Oracle, the database buffers of the SGA store the most recently usedblocks of database data The set of database block buffers is known as the

database buffer cache The buffers used to temporarily store redo entries until they can be written to disk are known as the redo log buffers

themselves contain small amounts of memory built in as a cache

In Oracle, the block buffers and shared pool are considered caches becausethey are used to store data and instructions for quick access Caching is veryeffective in reducing the time it takes to retrieve frequently used data

Caching usually works using a least recently used algorithm Data that has

not been used for a while is eventually released from the cache to makeroom for new data If data is requested and is in the cache (a phenomenon

called a cache hit), the data is retrieved from the cache, avoiding having to

retrieve it from memory or disk Once the data has been accessed again, it ismarked as recently used and put on the top of the cache list

Cartesian products.

The result of a join with no join condition Each row in a table is matchedwith every row of another table

checksum.

A number calculated from the contents of a storage unit such as a file ordata block Using a mathematical formula, the checksum number is

generated from data Because it is highly unlikely that data corruption canoccur in such a way that the checksum would remain the same, checksumsare used to verify data integrity Beginning with Oracle version 7.2,

checksums can be enabled on both data blocks and redo blocks

cluster (machine).

A group of computers that together form a larger logical machine Oracleclusters computers with the Oracle Parallel Server option

Trang 4

The common column in the set of tables built into a cluster The cluster keymust be indexed

cold data.

This term typically refers to infrequently used data Cold data is rarely incache because it is infrequently accessed

cold database.

This term typically refers to a database that is currently closed and notmounted No users can connect to the database and no data files can beaccessed

collision.

Typically refers to a network collision A network collision occurs whentwo or more NICs try to use the network at the same time When this

happens, all the NICs must resend their data

complex statements.

An SQL statement that contains a subquery The subquery is a query within the SQL statement used to determine values in the main or parent

concurrency.

The ability to perform concurrency defined many functions at the sametime Oracle provides for concurrency by allowing many users to access thedatabase simultaneously

Trang 5

constraint.

The mechanism that ensures that certain conditions relating columns andtables are maintained

contention.

A term usually used to describe a condition that occurs when two or moreprocesses or threads attempt to obtain the same resource The results ofcontention can vary depending on the resource in question

cost-based optimizer.

The Oracle optimizer that chooses an execution plan based on informationand statistics that it has for tables, indexes, and clusters

data warehouse.

An extremely large warehouses, see data warehouses database made up ofdata from many sources to provide an information pool for business

queries

DBA (database administrator).

The person responsible for the operation and configuration of the database.The DBA is the person responsible for the performance of the database TheDBA is charged with keeping the database operating smoothly, ensuringthat backups are done on a regular basis (and that the backups work), andinstalling new software Other responsibilities may include planning forfuture expansion and disk space needs; creating databases and tablespaces;adding users and maintaining security; and monitoring the database andretuning it as necessary Large installations may have teams of DBAs tokeep the system running smoothly; alternatively, the tasks may be

segmented among the DBAs

Trang 6

The commands used in the creation and modification of schema objects.These commands include the ability to create, alter, and drop objects; grantand revoke privileges and roles; establish auditing options; and add

comments to the data dictionary These commands are all related to themanagement and administration of the Oracle database Before and aftereach DDL statement, Oracle implicitly commits the current transaction

deadlock.

Deadlocks occur when two or more processes hold a resource that the otherone needs Neither of the processes will release its resource until it hasreceived the other’s resource; therefore, neither process can proceed

decision support system.

Characterized by large business queries designed to provide valuable datathat is used to make sound business decisions

EXPLAIN PLAN statements; and LOCK TABLE statements

dynamic performance tables.

Tables created at instance startup and used to store information about theperformance of the instance This information include connection

information, I/Os, initialization parameter values, and so on

Ethernet.

A network hardware standard Ethernet is probably the most-used networktype in the world

equijoin.

A join statement that uses an equivalency operation The converse of this is

Trang 7

extent.

A group of contiguous data blocks allocated for a table, index, or cluster.Extents are added dynamically as needed

always return a value (procedures do not) By processing the SQL code onthe database server, you can reduce the amount of instructions sent acrossthe network and returned from the SQL statements

HAL (Hardware Abstraction Layer).

A software layer closest to the hardware that performs all hardware-specificfunctions The HAL layer includes the device drivers

hot data.

This term typically refers to frequently accessed data Hot data typicallygets a good cache-hit rate

hot database.

This term typically refers to a database that is currently mounted, open, andservicing transactions The instance is up and users are accessing data

index.

A device designed to give you faster access to your data An index lets youavoid reading through data sequentially in order to find the item you areseeking

initialization parameter.

A parameter read by Oracle at instance startup These parameters affect theOracle configuration

Trang 8

A query that selects data from more than one table The data selected fromthe different tables is determined by conditions specified within the FROM

main memory.

A term often used to describe RAM (Random Access Memory) This is thepart of the computer system used to store data being processed or data thathas recently been accessed RAM is volatile and is not saved when thesystem is powered off

microkernel.

The core component of a microkernel operating system The microkernelcontains the base components of the operating system In a microkernelarchitecture, OS functions usually done in the kernel (such as I/O and

device driver support) are moved out of the kernel

MPP (Massively Parallel Processor) system.

A multiprocessor computer consisting of many independent processors thatcommunicate through a complex, high-speed bus

multiprocessor system.

A computer that has two or more CPUs A multiprocessor can be an SMP(Symmetric Multiprocessor) or an MPP (Massively Parallel Processor)system

network frame.

The structure sent across the network which contains user data as well as

network control information The terms network frame and network packet

Trang 9

network packet.

The structure built by the Network Protocol layer This structure includesuser data as well as network and routing information

offline.

This term typically refers to a database that is currently closed and notmounted No users can connect to the database and no data files can beaccessed

OLTP (OnLine Transaction Processing).

An OLTP system is characterized by large numbers of users inserting andretrieving data in a somewhat unstructured manner

online.

This term typically refers to a database that is currently mounted, open, andservicing transactions The instance is up and users are accessing data

optimizer.

A component of the Oracle RDBMS used to select SQL execution plans inthe most efficient and cost-effective manner There are two optimizers: acost-based optimizer and a rule-based optimizer Each determines the bestexecution plan based on different criteria

Trang 10

always return a value (procedures do not) By processing the SQL code onthe database server, you can reduce the amount of instructions sent acrossthe network and returned from the SQL statements

program unit.

In Oracle, the term used to describe a package, a stored procedure, or asequence

read consistency.

An attribute used to ensure that, during a SQL statement, data returned fromOracle is consistent Oracle uses the rollback segments to ensure read

Trang 11

recursive call.

A set of SQL statements generated by Oracle in response to some action orevent

redo log file.

The file that contains a copy of all data blocks that have been modified asthe result of a database transaction In the event of a system failure, anytransaction can be recovered with these redo blocks Oracle requires at leasttwo redo log files that are written to in a round-robin fashion

referential integrity.

A constraint on a column in a table that references another column Theconstraint can be used to guarantee that the referenced value exists

scalability.

Typically used in association with multiprocessor or cluster configurations.The scalability of the additional component refers to the performance gainobtained by adding that component A perfectly scaleable solution givesdouble the performance when you add a second component

For example, if you have an SMP machine with a measured performance of1.0 (normalized), add a second CPU, and get a performance of 1.9, thescalability of adding the second CPU is 1.9 or 90 percent This term is usedquite frequently in hardware and software manufacturer’s literature whenmarketing multiprocessor or clustered solutions

schema.

A collection of objects associated with the database

schema objects.

Abstractions or logical structures that refer to database objects or structures.Schema objects consist of such things as clusters, indexes, packages,

sequences, stored procedures, synonyms, tables, views, and so on

Trang 12

The set of extents that have been allocated to a specific object Segmenttypes consist of data, index, cluster, hash, and rollback types

snapshot.

A copy of a database or table This term is used in relation to databasereplication

SPX/IPX.

A network protocol developed for the NetWare operating system Today,SPX/IPX runs on many operating systems

SQL*DBA.

The Oracle database administration tool SQL*DBA is being made obsolete

by Server Manager

SQL*Loader.

Trang 13

SQL*Net.

The Oracle component that allows connections from a network into theOracle RDBMS SQL*Net supports many protocols; SQL*Net on any

Swapping is used when the amount of virtual memory in use has exceededthe amount of physical memory available Swapping is quite expensive interms of performance and should be avoided if possible

synonym.

An alias for a table, view, sequence, or program unit

System Global Area.

A shared memory region Oracle uses to store data and control informationfor one Oracle instance The SGA is allocated when the Oracle instancestarts; it is deallocated when the Oracle instance shuts down Each Oracleinstance that starts has its own SGA The information in the SGA is made

up of the database buffers, the redo log buffer, and the shared pool; each has

a fixed size and is created at instance startup

table.

The basic unit of storage in the Oracle database Users store their data intables

Trang 14

A logical structure that consists of one or more data files A tablespace isused to logically contain tables, clusters, and indexes

TCP/IP (Transmission Control Protocol/Internet Protocol).

A network protocol TCP/IP is probably the most used network protocol inthe world

trigger.

A mechanism that allows you to write procedures that are automaticallyexecuted whenever an INSERT, UPDATE, or DELETE statement is executed on

a table or view Triggers can be used to enforce integrity constraints orautomate some other custom function

two-phase commit.

The process by which distributed transactions occur In a two-phase

commit, each node commits its changes and signals that it has completed.When all nodes have successfully committed, the distributed transaction hascommitted

The SQL statement used to change rows in a table

view.

A window into a table or set of tables A view is a way for a table or set oftables to be seen A view, like a table, can be queried, updated, inserted into,and deleted from The data, however, is actually stored in the tables to

which the view refers

virtual memory.

Trang 15

in the system, these programs are copied from RAM to a disk file called a

paging or swap file This arrangement allows small systems to run many

programs There is a performance penalty you pay when the computerpages or swaps

Table of Contents

Copyright © Macmillan Computer Publishing, Inc.

Trang 16

The Oracle Memory Structure System Global Area (SGA) Program Global Area (PGA) Processes

How Transactions Work

Oracle Products

Oracle RDBMS Products Oracle Workgroup Server Personal Oracle for Windows Oracle Development Tools Oracle Applications

Oracle Services Summary

Chapter 2—Understanding Terms

Terms

RDBMS Functionality

Checkpoint Logging and Archiving Business Models

OnLine Transaction Processing (OLTP) Batch Processing

Decision Support Data Warehousing Binary Large Objects (BLOBs)

Trang 18

TPC Rules and Regulations Results

Benchmarks Publication Benchmarks

Custom Benchmarks

Writing Your Own Benchmark Summary

Chapter 6—Performance Monitoring Tools

Oracle Tools

SQL*DBA Monitor Server Manager Oracle SNMP Agents SQL Trace

EXPLAIN PLAN

OS Tools

Third-Party Tools

Real-Time Monitors Threshold Monitors Summary

Chapter 7—Performance Engineering Starts at the Design Stage

Design Stage

Database Layout Indexes and Clusters Application Design Hardware Sizing Network Considerations Performance Tuning after the System Is Built

Tuning the Client Tuning the Server Tuning the Network Summary

Part II—Tuning the Server

Chapter 8—What Affects Oracle Server Performance?

System Bottlenecks

Finding the Bottleneck Removing the Bottleneck

Trang 22

RAID-2 RAID-3 RAID-4 RAID-5 Fault-Tolerance Concerns

No Data Protection Full Data Protection Partial Data Protection Configuring RAID for RDBMS Performance Isolate Sequential I/Os

Distribute Random I/Os Size the Volume Properly Configure for the Disk Array RAID Comparison

Goals Design Considerations

Physical Data Layout Hardware Considerations Tuning Considerations

Oracle Tuning Server OS Tuning Enhancements

Oracle Parallel Server Option Hardware Enhancements Performance Verification What To Test in the RDBMS What To Test in the OS Benchmarks

Summary

Chapter 17—Batch Processing System

Characteristics of the Batch Processing System

Trang 24

Characteristics of a Data Warehouse Data Access Patterns

Trang 26

Design and Tuning Hints Distributed Systems

System Characteristics Design and Tuning Hints TextServer 3.0 Systems

System Characteristics Design and Tuning Hints Enhancements

Oracle Office Systems

System Characteristics Design and Tuning Hints WebServer Systems

System Characteristics Design and Tuning Hints Enhancements

Fetch Rows To Be Returned Summary

Chapter 25—Using EXPLAIN PLAN and SQL Trace

SQL Trace

SQL Trace Initialization Controlling SQL Trace SQL Trace Functionality TKPROF Functionality Interpreting SQL Trace The EXPLAIN PLAN Command

Trang 27

Summary

Trang 29

Using Sequences Using Cached Sequences for Primary Key Values Join Performance

Equijoin Self Join Cartesian Product Outer Join

Tuning Joins for Throughput Tuning Joins for Response Time Locking

What Is Locking?

Serializable Reads Using Locks

The Client/Server Model Two-Tiered and Three-Tiered Models

Two-Tiered System Three-Tiered System Client Bottlenecks

Network Performance Application Performance Presentation Performance Client Hardware Performance Summary

Chapter 34—Tuning the Client System

Windows NT

Tuning Memory 16-bit Applications I/O Performance

Trang 30

Microsoft Windows 3.1 and Windows for Workgroups 3.11 Memory

Modern Graphical Application Development Tools

How To Test and Improve Automatically Generated SQL Statements

Trang 31

Tuning the TM and System Summary

Part VI—Tuning the Network

Chapter 37—What Affects Network Performance?

Network Architecture

Hardware Components Summary

Chapter 38—Tuning the Network Components

Software Tuning

NetWare Windows NT OS/2

UNIX Oracle Tuning Network Design

Bandwidth Considerations Segmenting the Network Bridges, Routers, and Hubs Summary

Part VII—References

Appendix A—Review of Tuning Guidelines

RDBMS Tuning

SGA Performance Enhancements

OS Tuning

OS Tuning Goals

OS Features I/O Tuning

Trang 32

Appendix F

Index

Copyright © Macmillan Computer Publishing, Inc.

Trang 33

Sams, Macmillan Computer Publishing

ISBN: 067230886x Pub Date: 04/01/96

Table of Contents

Trang 34

Database management software and the manipulation of data has evolved towhere it touches every aspect of our lives A day doesn’t go by in which wedon’t access a database Whether we are withdrawing money from an ATMmachine, opening a checking account, or purchasing groceries, every aspect ofour lives is affected by databases Hand in hand with the new power of

information comes the frustration of having to wait for data to be retrieved I’msure there isn’t a person today who hasn’t had to wait for a credit card to beapproved Although the speed of computers has been increasing every year, sohas the amount of data being manipulated Amounts of data that several yearsago were unheard of are now a daily part of many companies In years past,databases were used strictly in the realm of big business because large

mainframes cost millions of dollars; today, gigabytes of data are being

manipulated on the same types of computer you may have in your own home

No matter how fast new generations of computers get, applications will always

be written to take advantage of them As the cost of storage continues to drop,the amount of data stored will continue to increase A perfect example of this isthe CD-ROM The advent of the CD-ROM allowed large amounts of data to beinexpensively stored; predictably, many new applications have arisen to takeadvantage of that technology These applications are now augmenting writtentext with video and audio clips The same type of information revolution is alsohappening in the database industry

Oracle already has the capability to store video, documents, and large binaryobjects in the database and allow quick access to this data Oracle databases canstore hundreds of gigabytes of data and can easily retrieve it; Oracle has the

potential of storing terabytes of data in a single database in the near future.

What is needed to store this kind of data? You must have a Relational DatabaseManagement System (RDBMS) with the following attributes:

Trang 35

What’s in this Book?

In this book, I help you build a foundation of understanding When you finishreading this book, you should have not only an understanding about how todesign high-performance applications but also the knowledge about how thesystem operates and how each component contributes to the performance of thewhole With this philosophy in mind, the book was designed with six parts, each

means

Trang 36

Chapter 6, “Performance Monitoring Tools,” gives an overview of some of theperformance monitoring tools available from Oracle and third-party vendors anddescribes how they can help you in investigating performance problems

Chapter 7, “Performance Engineering Starts at the Design Stage,” explains theholistic approach to performance engineering Performance should be

engineered into every aspect of the system, from hardware selection and networkconfiguration to database design and application development

Part II, “Tuning the Server,” focuses on tuning the RDBMS server The

performance of the system depends on a number of factors By analyzing eachcomponent individually, you can determine where performance can be enhanced

Chapter 8, “What Affects Oracle Server Performance?” is an overview of whatcan effect the server performance and where bottlenecks can occur

Chapter 9, “Oracle Instance Tuning,” reviews the bulk of instance tuning Itemssuch as memory, I/O, and CPU usage are discussed here You also get a more in-depth look at some internal Oracle structures

Chapter 10, Performance Enhancements,” looks at some of the things you can do

in the RDBMS server to improve performance Some examples are the use ofclusters and indexes as well as some of Oracle’s parallel features

Chapter 11, “Tuning the Server Operating System,” discusses the OS parametersyou can tune Chapter 12, “Operating System-Specific Tuning,” focuses on a few

of the 90 platforms Oracle supports

Chapter 13, System Processors,” Chapter 14, “Advanced Disk I/O Concepts,”and Chapter 15, “Disk Arrays,” describe some specifics concerning hardwareand include detailed explanations about why different hardware features affectRDBMS performance

Part III, “Configuring the System,” looks at differences in design, tuning, and

Trang 37

Part IV, “Tuning SQL,” and Part V, “Tuning the Client,” explore the client.

Here, the focus is on the application and the front-end pieces and how to

improve the client’s performance Part IV focuses on the SQL statements used inyour application; Part V looks more at the client machines themselves and howyou can tune them

Chapter 24, “What Is a Well-Tuned SQL Statement?” introduces the concept ofbadly tuned SQL statements and how they can affect the performance of theclient and the server It is here that the importance of a well-tuned SQL statement

is discussed The remainder of Part IV looks at various topics relating to howyour SQL statements can be improved and tuned Included are many tips andhints on features and techniques that can improve your SQL statements

Part V focuses on the client OS and improvements you can make to streamlinethe system The goal of tuning the client OS is to get it out of the way of theclient application so that the client application can be more efficient Chapter 34,

“Using GUI Builders,” examines the popular GUI builder products available onthe market and how you can tune the resulting application to improve

experimentation can be very satisfying when everything works well; it can befrustrating when it doesn’t

Trang 38

to look for and what the possible solutions are

To me, performance is one of the most exciting areas of computing Personalcomputers now have the computing power reserved for mainframes just a fewyears ago Gigabyte hard disks for less than $300 now make it possible for us tohave huge stores of information in our home computers But performance doesnot mean buying the biggest and the fastest; you have to get the most out of whatyou’ve got Buying a bigger or a faster server may be a waste if, in fact, theproblem is the client machine or the network: a 10-second response time to aquery could be caused by a 1-second response from the server and a 9-secondwait for the information to be processed in the GUI

If I have done my job correctly, you should finish this book with the ability toanalyze the problem, hypothesize a solution, test that solution, and understandthe result I hope this book gives novices an idea of what performance

engineering is all about; seasoned professionals should receive some new insightand ideas

Table of Contents

Copyright © Macmillan Computer Publishing, Inc.

Trang 39

Sams, Macmillan Computer Publishing

ISBN: 067230886x Pub Date: 04/01/96

Table of Contents

Trang 40

With the explosion of the Internet phenomena, tens of millions of individualstoday get access to and retrieve multimedia data through the World Wide Web.The ease of locating information is provided by sophisticated search

mechanisms; the appliance-style interfaces on Web pages is fueling the desire formore data at one’s fingertips And although the personal computer users of todayhave caught onto online services, the billions of users who can’t afford PCs orfind them too hard to use will be able to afford and use the next generation ofWeb appliances These appliances will offer an even richer multimedia

environment than today’s PCs for a fraction of the price

As the Web becomes the next generation “killer app” for the desktop, billions ofpeople who want and need access to data will both increase the amount of data

in databases and the number of users on the supporting systems The result ofthis increased demand for information is that database server system tuning isincreasingly important

Because relational databases have become the mainstream data storage “vehicle”for modern applications, the flexibility in design and implementation of the

underlying database structure, physical file layouts, and tuning parameters cangenerate wide variations in performance Although throwing hardware at theproblem is often the easy solution, tuning the database application first is usuallymuch more cost effective Although many books have been written on this

subject, you’ll find this one to be complete and thorough in its methodologiesand execution steps for tuning your Oracle database

In the time I’ve known Ed Whalen, he’s been extremely thorough and

professional with regard to system performance and tuning—and the followingpages are pure Ed I congratulate him on this accomplishment—particularlybecause he was somehow able to create this volume and work 110 percent on hisday job

Bonnie Crater

Vice President

Oracle Corporation

Ngày đăng: 26/03/2019, 17:09

🧩 Sản phẩm bạn có thể quan tâm