12
返回列表 发新帖
楼主: quckros

[讨论] iowait 过高,怀疑大量row migration导致碎片过多,请教~~

[复制链接]
论坛徽章:
1
ITPUB9周年纪念徽章
日期:2010-10-08 09:32:25
11#
 楼主| 发表于 2010-10-9 14:27 | 只看该作者
原帖由 sundog315 于 2010-10-9 13:14 发表
可以考虑在线重定义



感谢sundog315提供宝贵意见。

使用道具 举报

回复
论坛徽章:
47
蒙奇·D·路飞
日期:2017-03-27 08:04:23马上有车
日期:2014-02-18 16:41:112014年新春福章
日期:2014-02-18 16:41:11一汽
日期:2013-09-01 20:46:27复活蛋
日期:2013-03-13 07:55:232013年新春福章
日期:2013-02-25 14:51:24ITPUB 11周年纪念徽章
日期:2012-10-09 18:03:322012新春纪念徽章
日期:2012-02-13 15:13:202012新春纪念徽章
日期:2012-02-13 15:13:202012新春纪念徽章
日期:2012-02-13 15:13:20
12#
发表于 2010-10-10 23:27 | 只看该作者
A few days ago I emailed one of my developers. I said performance gain goes up in this order, difference between every two is in the order of 10 to 10000: instance or database tuning < SQL tuning < business logic tuning. For a DBA, practically speaking, business logic is not something we can control. So we need to focus on SQLs before making a big effort on anything else.

quckros, did you check to see if there's any SQL having too many buffer gets?

Also, as cc59 said, "sysstat只是一个total的值而已". Does "table fetch continued row" change a lot within some period of time?

Yong Huang

使用道具 举报

回复
论坛徽章:
1
ITPUB9周年纪念徽章
日期:2010-10-08 09:32:25
13#
 楼主| 发表于 2010-10-11 15:26 | 只看该作者
原帖由 Yong Huang 于 2010-10-10 23:27 发表
----A few days ago I emailed one of my developers. I said performance gain goes up in this order, difference between every two is in the order of 10 to 10000: instance or database tuning < SQL tuning < business logic tuning. For a DBA, practically speaking, business logic is not something we can control. So we need to focus on SQLs before making a big effort on anything else.


谢谢你的建议。

----quckros, did you check to see if there's any SQL having too many buffer gets?


有看到Top 10 SQLs by buffer gets ,貌似都是oracle自己产生的,能解释下吗
语句一,在Top 10中出现了5次,buffer gets都在621973255左右
SELECT   procedure_catalog, procedure_schema, procedure_name, parameter_name,
         ordinal_position, parameter_type, parameter_hasdefault,
         parameter_default, is_nullable, data_type, character_maximum_length,
         character_maximum_length character_octet_length, numeric_precision,
         numeric_scale, description, type_name, type_name, overload
    FROM (SELECT NULL procedure_catalog, owner procedure_schema,
                 DECODE (package_name,
                         NULL, object_name,
                         package_name || '.' || object_name
                        ) procedure_name,
                 DECODE (POSITION,
                         0, 'RETURN_VALUE',
                         NVL (argument_name, CHR (0))
                        ) parameter_name,
                 POSITION ordinal_position,
                 DECODE (in_out,
                         'IN', 1,
                         'IN/OUT', 2,
                         'OUT', DECODE (argument_name, NULL, 4, 3),
                         NULL
                        ) parameter_type,
                 NULL parameter_hasdefault, NULL parameter_default,
                 NULL is_nullable,
                 DECODE (data_type,
                         'CHAR', 129,
                         'NCHAR', 129,
                         'DATE', 135,
                         'FLOAT', 139,
                         'LONG', 129,
                         'LONG RAW', 128,
                         'NUMBER', 139,
                         'RAW', 128,
                         'ROWID', 129,
                         'VARCHAR2', 129,
                         'NVARCHAR2', 129,
                         13
                        ) data_type,
                 DECODE (data_type,
                         'CHAR', DECODE (data_length, NULL, 255, data_length),
                         'LONG', 2147483647,
                         'LONG RAW', 2147483647,
                         'ROWID', 18,
                         'RAW', DECODE (data_length, NULL, 255, data_length),
                         'VARCHAR2', DECODE (data_length,
                                             NULL, 2000,
                                             data_length
                                            ),
                         'DATE', NULL,
                         'FLOAT', NULL,
                         'NUMBER', NULL,
                         NULL
                        ) character_maximum_length,
                 DECODE (data_type,
                         'DATE', 19,
                         'FLOAT', 15,
                         'NUMBER', DECODE (data_precision,
                                           NULL, 0,
                                           data_precision
                                          ),
                         'CHAR', NULL,
                         'NCHAR', NULL,
                         'LONG', NULL,
                         'LONG RAW', NULL,
                         'RAW', NULL,
                         'VARCHAR2', NULL,
                         'NVARCHAR2', NULL,
                         NULL
                        ) numeric_precision,
                 DECODE (data_type,
                         'DATE', 0,
                         'NUMBER', DECODE (data_scale, NULL, 0, data_scale),
                         'CHAR', NULL,
                         'NCHAR', NULL,
                         'FLOAT', NULL,
                         'LONG', NULL,
                         'LONG RAW', NULL,
                         'RAW', NULL,
                         'VARCHAR2', NULL,
                         'NVARCHAR2', NULL,
                         NULL
                        ) numeric_scale,
                 NULL description, data_type type_name, overload
            FROM all_arguments
           WHERE data_level = 0 AND data_type IS NOT NULL) procedure_parameters
   WHERE procedure_name = 'CMC_PASSSTATION_CENTER'
ORDER BY 1, 2, 3, 5

语句二,还有一些跟它类似都是查ALL_SYNONYMS 表的,buffer gets都在135578628左右
SELECT /*+ RULE */ TABLE_OWNER, TABLE_NAME FROM ALL_SYNONYMS WHERE OWNER='PUBLIC' AND SYNONYM_NAME='CMC_PASSSTATION_CENTER'

[ 本帖最后由 quckros 于 2010-10-11 15:33 编辑 ]

使用道具 举报

回复
论坛徽章:
47
蒙奇·D·路飞
日期:2017-03-27 08:04:23马上有车
日期:2014-02-18 16:41:112014年新春福章
日期:2014-02-18 16:41:11一汽
日期:2013-09-01 20:46:27复活蛋
日期:2013-03-13 07:55:232013年新春福章
日期:2013-02-25 14:51:24ITPUB 11周年纪念徽章
日期:2012-10-09 18:03:322012新春纪念徽章
日期:2012-02-13 15:13:202012新春纪念徽章
日期:2012-02-13 15:13:202012新春纪念徽章
日期:2012-02-13 15:13:20
14#
发表于 2010-10-12 06:00 | 只看该作者
Those SQLs are Oracle's, as you expected. But the important thing is *delta* of buffer gets within a period of time, not the absolute value.

Yong Huang

使用道具 举报

回复
论坛徽章:
1
ITPUB9周年纪念徽章
日期:2010-10-08 09:32:25
15#
 楼主| 发表于 2010-10-12 10:27 | 只看该作者
原帖由 sundog315 于 2010-10-9 13:14 发表
可以考虑在线重定义


在线重定义表有诸多条件限制,比如说一定要有主键等,因不满足条件,我准备找个合适的时间,对CHAIN_CNT值较高的做enable row movement 和shrink space动作

使用道具 举报

回复
论坛徽章:
1
ITPUB9周年纪念徽章
日期:2010-10-08 09:32:25
16#
 楼主| 发表于 2010-10-12 13:51 | 只看该作者
原帖由 Yong Huang 于 2010-10-12 06:00 发表
Those SQLs are Oracle's, as you expected. But the important thing is *delta* of buffer gets within a period of time, not the absolute value.

Yong Huang


怎样得到“*delta* of buffer gets within a period of time”,做AWR还是?

使用道具 举报

回复
论坛徽章:
47
蒙奇·D·路飞
日期:2017-03-27 08:04:23马上有车
日期:2014-02-18 16:41:112014年新春福章
日期:2014-02-18 16:41:11一汽
日期:2013-09-01 20:46:27复活蛋
日期:2013-03-13 07:55:232013年新春福章
日期:2013-02-25 14:51:24ITPUB 11周年纪念徽章
日期:2012-10-09 18:03:322012新春纪念徽章
日期:2012-02-13 15:13:202012新春纪念徽章
日期:2012-02-13 15:13:202012新春纪念徽章
日期:2012-02-13 15:13:20
17#
发表于 2010-10-12 23:47 | 只看该作者
> 怎样得到“*delta* of buffer gets within a period of time”,做AWR还是?

I don't remember if AWR does it. It probably does. I think EM (enterprise manager) can do that automatically and graphically. Otherwise, write your own monitoring tool. Pseudo code like this:

select sysdate from dual; --and store it somewhere, in a table, a file, or a shell script variable
select buffer_gets, sql_id from v$sql where buffer_gets > &somevalue; --if it's below this threshold, there's not much use to monitor; also store these values somewhere

Repeat the above and do math to substract on buffer_gets.

Yong Huang

使用道具 举报

回复
论坛徽章:
63
19周年集字徽章-19
日期:2020-09-23 02:43:002012新春纪念徽章
日期:2012-02-13 15:12:092012新春纪念徽章
日期:2012-01-04 11:49:54ITPUB十周年纪念徽章
日期:2011-11-01 16:20:28现任管理团队成员
日期:2011-05-07 01:45:082011新春纪念徽章
日期:2011-02-18 11:42:472011新春纪念徽章
日期:2011-01-25 15:42:562011新春纪念徽章
日期:2011-01-25 15:42:332011新春纪念徽章
日期:2011-01-25 15:42:152011新春纪念徽章
日期:2011-01-25 15:41:50
18#
发表于 2010-10-13 21:13 | 只看该作者
shrink space也要注意,表大的话会异常慢。会生成N多的log

使用道具 举报

回复
论坛徽章:
47
蒙奇·D·路飞
日期:2017-03-27 08:04:23马上有车
日期:2014-02-18 16:41:112014年新春福章
日期:2014-02-18 16:41:11一汽
日期:2013-09-01 20:46:27复活蛋
日期:2013-03-13 07:55:232013年新春福章
日期:2013-02-25 14:51:24ITPUB 11周年纪念徽章
日期:2012-10-09 18:03:322012新春纪念徽章
日期:2012-02-13 15:13:202012新春纪念徽章
日期:2012-02-13 15:13:202012新春纪念徽章
日期:2012-02-13 15:13:20
19#
发表于 2010-10-14 01:20 | 只看该作者
> shrink space也要注意,表大的话会异常慢。会生成N多的log

In that case, it may be better to shrink compact first. Then do a full shrink later. It won't reduce redo. But it has less impact on a production database because you have better control over timing.

Yong Huang

使用道具 举报

回复
论坛徽章:
1
ITPUB9周年纪念徽章
日期:2010-10-08 09:32:25
20#
 楼主| 发表于 2010-10-14 15:00 | 只看该作者
感谢cc59 & Yong Huang。
sfclockproduct shrink之前:BLOCKS 1882      CHAIN_CNT   17657     USER_BLOCKS   1607
1.alter table sfclockproduct shrink space compact;
2.alter table sfclockproduct shrink space cascade;
3.dbms_stats.gather_table_stats('...',tabname=>'SFCLOCKPRODUCT,...);
sfclockproduct shrink之后:BLOCKS 1855      CHAIN_CNT   17657     USER_BLOCKS   1607
问题来拉,CHAIN_CNT根本没有变化?HWM也才降了1882-1855=27?而真正使用的blocks才1607。

目前大的表还不敢做,刚刚中午吃饭时对这张相对小点的表做动作时,发生RX锁及5支function与20多支procedure INVALID~~还好提前知道有这些影响动作还是比较快的,呵呵

[ 本帖最后由 quckros 于 2010-10-14 16:06 编辑 ]

使用道具 举报

回复

您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

TOP技术积分榜 社区积分榜 徽章 团队 统计 知识索引树 积分竞拍 文本模式 帮助
  ITPUB首页 | ITPUB论坛 | 数据库技术 | 企业信息化 | 开发技术 | 微软技术 | 软件工程与项目管理 | IBM技术园地 | 行业纵向讨论 | IT招聘 | IT文档
  ChinaUnix | ChinaUnix博客 | ChinaUnix论坛
CopyRight 1999-2011 itpub.net All Right Reserved. 北京盛拓优讯信息技术有限公司版权所有 联系我们 未成年人举报专区 
京ICP备16024965号-8  北京市公安局海淀分局网监中心备案编号:11010802021510 广播电视节目制作经营许可证:编号(京)字第1149号
  
快速回复 返回顶部 返回列表