分享
 
 
 

数据库性能调整专家必读

王朝other·作者佚名  2006-11-24
窄屏简体版  字體: |||超大  

Deploying, Managing, and Administering the Oracle Internet Platform

Paper #224/ Page 1

DBA PERFORMANCE TUNING FOR THE EXPERT ONLY:

BEGINNERS WILL BE SMOKED!

Richard J. Niemiec, TUSC

ABSTRACT

Version8 of the Oracle database has brought on a whole new level of issues for the DBA. While the queries for

tuning the database and individual queries has not changed much, the data retrieved by these queries has changed and

must be analyzed for partitioned tables and other cost-based optimizer functions. This paper will serve to give you

the individual queries to be successful.

WHAT WILL BE COVERED (GOALS FOR TUNING)

Goal#1: Have enough memory allocated to Oracle - The first goal should be to get enough memory (from your

physical hardware) allocated to “key” Oracle parameters. We will look at how to see what the current settings of a

given system are set to and also look at the “key” parameters: DB_BLOCK_BUFFERS, SHARED_POOL_SIZE,

and SORT_AREA_SIZE.

Goal#2: Get the data loaded into memory - Once you have enough memory allocated to Oracle, the focus must shift

to ensuring that the most important information is getting into memory and staying there. We will look at using x$bh

and using the ‘cache’ parameter of ‘alter table……’ to investigate this area.

Goal#3: Find queries that are clogging memory and causing I/O - Finding problem areas is, at times, the most

difficult problem. We will investigate a method for easily identifying the bottlenecks by using v$sqlarea.

Goal#4: Tune the Problem Queries - Tuning the problem queries could easily encompass an entire training course. I

will focus on a couple of key areas: What you need to know before you tune my system, using the Parallel Query

Option and general tuning tips.

Function Based Indexes - This new feature in Oracle8.1 can be a big help.

Materialized Views - This feature in Oracle8.1 can help with large tables.

GOAL#1: HAVE ENOUGH MEMORY ALLOCATED TO ORACLE

Even if the system that you are working on has 10 Gig of memory available, this doesn‘t help much if only a small

portion of it is allocated to Oracle. We allocate memory to Oracle through the INITsid.ORA file. Some of the key

parameters are listed below. We will cover each of these parameters in the following sections. By going to

“v$parameter” or by using the either Server Manager or Oracle Enterprise Manager, we can find the parameters that

affect Oracle‘s performance.

A. FINDING THE VALUES OF ‘KEY’ INIT.ORA PARAMETERS

select name, value

from v$parameter

where name in (‘db_block_buffers’,……etc);

NAME VALUE

-------------------------------------------------- ----------------

db_block_buffers 4000

db_block_size 4096

shared_pool_size 7000000

sort_area_size 262144 .

You can also view the init.ora parameters in Oracle‘s Enterprise Manager as shown below:

Deploying, Managing, and Administering the Oracle Internet Platform

Paper #224/ Page 2

B. LOOK AT DB_BLOCK_BUFFERS

The first parameter to look at is the INITsid.ORA parameter: DB_BLOCK_BUFFERS. This is the area of the SGA

that is used for the storage and processing of data in memory. As users request information, the information is put

into memory. If the DB_BLOCK_BUFFERS parameter is set too low, then the least recently used data will be

flushed from memory. If the data flushed is recalled with a query, it must be re-read from disk (causing I/O and

CPU resources to be used)。 If DB_BLOCK_BUFFERS is too low, users will not have enough memory to operate

efficiently. If DB_BLOCK_BUFFERS is too high, your system may begin to swap and may come to a halt.

DETERMINE IF THE DATA BLOCK BUFFERS IS SET HIGH ENOUGH

select 1-(sum(decode(name, 'physical reads', value,0))/

(sum(decode(name, 'db block gets', value,0)) +

(sum(decode(name, 'consistent gets', value,0))))) * 100

"Read Hit Ratio"

from v$sysstat;

Read Hit Ratio

98.415926

Although hit ratios below 90-95% are usually a sign of poor indexing; Distortion of the hit ration numbers is possible.

See the next section for more information.

Response Time in Minutes

Buffers at

200% of

Optimum

Buffers at

Optimum

Buffers at

50% of

Optimum

Buffers at

20% of

Optimum

Buffers at

5% of

Optimum

0

100

200

300

400

Figure 1: Response Time for a Memory Intensive Report with given SGA (Buffer) settings

HIT RATIO DISTORTION

Even though the equations for finding a problems seems easy, sometimes the results are not accurate. Many third

party products also receive this misinformation, yet some go to other areas to get the correct information. Below, I

show one such case where misinformation is returned.

Deploying, Managing, and Administering the Oracle Internet Platform

Paper #224/ Page 3

There are also false hit ratio distortions. SQL*Forms can cause a false high hit ratio, rollback segments can cause a

false high hit ratio impact and indexes can have hit ratios as high as 86% when none of the blocks were cached prior

to the query executing.

C. IT IS IMPORTANT TO LOOK AT THE SHARED_POOL_SIZE FOR PROPER SIZING

With a greater amount of procedures, packages and triggers being utilized with Oracle, the SHARED_POOL_SIZE

makes up a much greater portion of the Oracle SGA. This is the memory allocated for the library and data dictionary

cache. If the SHARED_POOL_SIZE is set too low then you will not get the full advantage of your

DB_BLOCK_BUFFERS.

DETERMINE DICTIONARY CACHE MISS RATIO

select sum(gets) “Gets”, sum(getmisses) “Misses”,

(1 - (sum(getmisses) / (sum(gets) +

sum(getmisses))))*100 “HitRate”

from v$rowcache;

Gets Misses HitRate

10233 508 95.270459

This would be a good Ratio and would probably not require action in this area.

DETERMINE LIBRARY CACHE HIT RATIO

select sum(pins) Executions, sum(pinhits) “Execution Hits”,

((sum(pinhits) / sum(pins)) * 100) phitrat,

sum(reloads) Misses,

((sum(pins) / (sum(pins) + sum(reloads))) * 100) hitrat

from v$librarycache;

Executions Execution Hits PHITRAT Misses HITRAT

3,582 3,454 96.43 6 99.83

If the hit ratio or reloads is high, increase the shared_pool_size INIT.ora parameter.

HOW MUCH MEMORY IS LEFT FOR SHARED_POOL_SIZE

col value for 999,999,999,999 heading “Shared Pool Size”

col bytes for 999,999,999,999 heading “Free Bytes”

select to_number(v$parameter.value) value, v$sgastat.bytes,

(v$sgastat.bytes/v$parameter.value)*100 “Percent Free”

from v$sgastat, v$parameter

where v$sgastat.name = 'free memory'

and v$ parameter .name = ‘shared_pool_size;

Shared Pool Size Free Bytes Percent Free

100,000,000 82,278,960 82.27896

Deploying, Managing, and Administering the Oracle Internet Platform

Pa

[1] [2] [3] [4] [5] 下一页

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
2023年上半年GDP全球前十五强
 百态   2023-10-24
美众议院议长启动对拜登的弹劾调查
 百态   2023-09-13
上海、济南、武汉等多地出现不明坠落物
 探索   2023-09-06
印度或要将国名改为“巴拉特”
 百态   2023-09-06
男子为女友送行,买票不登机被捕
 百态   2023-08-20
手机地震预警功能怎么开?
 干货   2023-08-06
女子4年卖2套房花700多万做美容:不但没变美脸,面部还出现变形
 百态   2023-08-04
住户一楼被水淹 还冲来8头猪
 百态   2023-07-31
女子体内爬出大量瓜子状活虫
 百态   2023-07-25
地球连续35年收到神秘规律性信号,网友:不要回答!
 探索   2023-07-21
全球镓价格本周大涨27%
 探索   2023-07-09
钱都流向了那些不缺钱的人,苦都留给了能吃苦的人
 探索   2023-07-02
倩女手游刀客魅者强控制(强混乱强眩晕强睡眠)和对应控制抗性的关系
 百态   2020-08-20
美国5月9日最新疫情:美国确诊人数突破131万
 百态   2020-05-09
荷兰政府宣布将集体辞职
 干货   2020-04-30
倩女幽魂手游师徒任务情义春秋猜成语答案逍遥观:鹏程万里
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案神机营:射石饮羽
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案昆仑山:拔刀相助
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案天工阁:鬼斧神工
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案丝路古道:单枪匹马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:与虎谋皮
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:李代桃僵
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:指鹿为马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:小鸟依人
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:千金买邻
 干货   2019-11-12
 
推荐阅读
 
 
 
>>返回首頁<<
 
靜靜地坐在廢墟上,四周的荒凉一望無際,忽然覺得,淒涼也很美
© 2005- 王朝網路 版權所有