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

[笔记] 有谁注意到LAST_ANALYZED这个值的?

[复制链接]
论坛徽章:
71
2015年新春福章
日期:2015-03-06 11:57:312013年新春福章
日期:2013-02-25 14:51:24双黄蛋
日期:2013-01-06 13:31:18蜘蛛蛋
日期:2013-01-06 10:26:08茶鸡蛋
日期:2012-11-21 19:35:23ITPUB 11周年纪念徽章
日期:2012-10-09 18:05:07版主2段
日期:2012-05-15 15:24:11铁扇公主
日期:2012-02-21 15:02:402012新春纪念徽章
日期:2012-02-13 15:13:512012新春纪念徽章
日期:2012-02-13 15:13:51
11#
发表于 2008-3-12 18:11 | 只看该作者
The date of the most recent time this table was analyzed   

应该是完成时间

使用道具 举报

回复
论坛徽章:
122
现任管理团队成员
日期:2011-05-07 01:45:08
12#
发表于 2008-3-12 18:43 | 只看该作者
我这里每天11:00分析一个大的分区表的所有分区~

以前就查看过,每个分区的这个last_analyzed 从来都是11:00以后,我肯定是结束时间~

使用道具 举报

回复
论坛徽章:
91
乌索普
日期:2017-09-18 17:30:37鲜花蛋
日期:2012-12-21 19:41:32ITPUB 11周年纪念徽章
日期:2012-10-09 18:06:20奥运会纪念徽章:网球
日期:2012-07-05 15:32:53奥运会纪念徽章:垒球
日期:2012-06-30 09:56:29紫蛋头
日期:2012-03-24 14:38:25咸鸭蛋
日期:2012-03-22 16:53:432012新春纪念徽章
日期:2012-02-13 15:12:092012新春纪念徽章
日期:2012-02-13 15:12:092012新春纪念徽章
日期:2012-02-13 15:12:09
13#
发表于 2008-3-12 19:05 | 只看该作者
注意过,应该是结束时间。

使用道具 举报

回复
论坛徽章:
314
行业板块每日发贴之星
日期:2012-07-12 18:47:29双黄蛋
日期:2011-08-12 17:31:04咸鸭蛋
日期:2011-08-18 15:13:51迷宫蛋
日期:2011-08-18 16:58:25紫蛋头
日期:2011-08-31 10:57:28ITPUB十周年纪念徽章
日期:2011-09-27 16:30:47蜘蛛蛋
日期:2011-10-20 15:51:25迷宫蛋
日期:2011-10-29 11:12:59ITPUB十周年纪念徽章
日期:2011-11-01 16:19:41鲜花蛋
日期:2011-11-09 20:33:30
14#
 楼主| 发表于 2008-3-13 22:01 | 只看该作者

看看我的这次的观察结果,分区表的

SESSION -1 执行分析脚本,执行后到会话2查询当前时间,之后作了一些查询操作(中途等了几回),我相信
这段时间肯定超过1 分钟.但PART_2005分区分析结束后,发现last_analyzed 时间却比一开始在会话2查询的
时间少不了多少,在1分钟内.这很让我纳闷,若说LAST_ANALYZED 是分析结束后的时间,其在1分钟内已经结束,
为什么分区PART_2006在21:52:58 还为分析结束?难道多出了这么多的数据(730-260=)470M就让系统多运行
那么长时间?

有两种解释:
1  对于分区表,LAST_ANALYZED 是分析起始时间.
2  若是分析结束时间,则ORACLE还要花很长的一段时间去干XXX?

[php]

session-1

begin
   for i in (select table_name, partition_name from user_tab_partitions where table_name='IC_GENERAL_B' order by 2) loop
     dbms_stats.gather_table_stats(ownname=>user,tabname=>i.table_name,partname=>i.partition_name,estimate_percent=>100,cascade=>false,method_opt=>'for all indexed columns size 254');
   end loop;
   for i in (select index_name, partition_name from user_ind_partitions where index_name in
             (select index_name from user_indexes where table_name='IC_GENERAL_B') order by 1,2) loop
     dbms_stats.gather_index_stats(ownname=>user,indname=>i.index_name,partname=>i.partition_name,estimate_percent=>100);
   end loop;
end;


session-2


NCBI@REPORT>select sysdate from dual;

SYSDATE
-------------------
2008-03-13 21:23:09

Elapsed: 00:00:00.01
NCBI@REPORT>select partition_name, last_analyzed from user_tab_partitions where table_name='IC_GENERAL_B'
  2  order by partition_name;

PARTITION_NAME                 LAST_ANALYZED
------------------------------ -------------------
PART_2005
PART_2006
PART_200706
PART_200707
PART_200708
PART_200709
PART_200710
PART_200711
PART_200712
PART_200801
PART_200802
PART_200803
PART_200804
PART_200805
PART_200806
PART_200807
PART_200808
PART_200809
PART_200810
PART_200811
PART_200812
PART_MAX

22 rows selected.

Elapsed: 00:00:00.09
NCBI@REPORT>set line 999;
NCBI@REPORT>set pagesize 203;
NCBI@REPORT>col owner for a10;
NCBI@REPORT>col job_name for a30;
NCBI@REPORT>col last_start_date for a20;
NCBI@REPORT>col next_run_date for a20;
NCBI@REPORT>col failure_count for 999999;
NCBI@REPORT>select owner,job_name,failure_count failure,last_start_date,next_run_date,state,run_count
  2  from dba_scheduler_jobs where state<>'DISABLED' and state<>'COMPLETED'
  3  and owner not in ('EXFSYS');

OWNER      JOB_NAME                          FAILURE LAST_START_DATE      NEXT_RUN_DATE        STATE            R
---------- ------------------------------ ---------- -------------------- -------------------- --------------- --
SYS        PURGE_LOG                               0 2008-03-13 03:00:00  2008-03-14 03:00:00  SCHEDULED         
SYS        GATHER_STATS_JOB                        0 2008-03-12 22:00:01                       SCHEDULED         
SYS        AUTO_SPACE_ADVISOR_JOB                  0 2008-03-12 22:00:01                       SCHEDULED         

Elapsed: 00:00:00.01
NCBI@REPORT>set line 999;
NCBI@REPORT>set pagesize 203;
NCBI@REPORT>col owner for a10;
NCBI@REPORT>col job_name for a30;
NCBI@REPORT>col last_start_date for a20;
NCBI@REPORT>col next_run_date for a20;
NCBI@REPORT>col failure_count for 999999;
NCBI@REPORT>select owner,job_name,failure_count failure,last_start_date,next_run_date,state,run_count
  2  from dba_scheduler_jobs where state<>'COMPLETED' and owner not in ('EXFSYS');

OWNER      JOB_NAME                          FAILURE LAST_START_DATE      NEXT_RUN_DATE        STATE            R
---------- ------------------------------ ---------- -------------------- -------------------- --------------- --
SYS        PURGE_LOG                               0 2008-03-13 03:00:00  2008-03-14 03:00:00  SCHEDULED         
SYS        FGR$AUTOPURGE_JOB                       0                                           DISABLED                 
SYS        GATHER_STATS_JOB                        0 2008-03-12 22:00:01                       SCHEDULED         
SYS        AUTO_SPACE_ADVISOR_JOB                  0 2008-03-12 22:00:01                       SCHEDULED         
NCBI       J_TYREPORTIC                            0 2008-03-13 20:00:10  2008-03-13 20:10:10  DISABLED         
NCBI       J_ANALYZE_JXC                           0 2008-03-13 01:00:00  2008-03-14 01:00:00  DISABLED         
NCBI       JOB_IMPORT_STAT_FROM_52                 0 2008-02-29 06:30:00  2008-03-01 06:30:00  DISABLED         
NCBI       J_TYREPORT                              1 2008-03-13 19:57:08  2008-03-13 20:07:08  DISABLED         
NCBI       J_TYREPORTBBC                           1 2008-03-13 20:04:00  2008-03-13 20:14:00  DISABLED         

9 rows selected.

Elapsed: 00:00:00.07
NCBI@REPORT>EXEC DBMS_SCHEDULER.ENABLE('J_TYREPORTIC');

PL/SQL procedure successfully completed.

Elapsed: 00:00:03.42
NCBI@REPORT>EXEC DBMS_SCHEDULER.ENABLE('J_TYREPORT');

PL/SQL procedure successfully completed.

Elapsed: 00:00:00.01
NCBI@REPORT>EXEC DBMS_SCHEDULER.ENABLE('J_TYREPORTBBC');

PL/SQL procedure successfully completed.

Elapsed: 00:00:00.00
NCBI@REPORT>select partition_name, last_analyzed from user_tab_partitions where table_name='IC_GENERAL_B'
  2  order by partition_name;

PARTITION_NAME                 LAST_ANALYZED
------------------------------ -------------------
PART_2005
PART_2006
PART_200706
PART_200707
PART_200708
PART_200709
PART_200710
PART_200711
PART_200712
PART_200801
PART_200802
PART_200803
PART_200804
PART_200805
PART_200806
PART_200807
PART_200808
PART_200809
PART_200810
PART_200811
PART_200812
PART_MAX

22 rows selected.

Elapsed: 00:00:00.07
NCBI@REPORT>/

PARTITION_NAME                 LAST_ANALYZED
------------------------------ -------------------
PART_2005
PART_2006
PART_200706
PART_200707
PART_200708
PART_200709
PART_200710
PART_200711
PART_200712
PART_200801
PART_200802
PART_200803
PART_200804
PART_200805
PART_200806
PART_200807
PART_200808
PART_200809
PART_200810
PART_200811
PART_200812
PART_MAX

22 rows selected.

Elapsed: 00:00:00.07
NCBI@REPORT>/

PARTITION_NAME                 LAST_ANALYZED
------------------------------ -------------------
PART_2005                      2008-03-13 21:23:54
PART_2006
PART_200706
PART_200707
PART_200708
PART_200709
PART_200710
PART_200711
PART_200712
PART_200801
PART_200802
PART_200803
PART_200804
PART_200805
PART_200806
PART_200807
PART_200808
PART_200809
PART_200810
PART_200811
PART_200812
PART_MAX

22 rows selected.

Elapsed: 00:00:00.06
NCBI@REPORT>
NCBI@REPORT>select sysdate from dual;

SYSDATE
-------------------
2008-03-13 21:52:58

Elapsed: 00:00:00.01
NCBI@REPORT>select partition_name, bytes/1024/1024 from user_segments where segment_name='IC_GENERAL_B'
  2  ORDER BY 1;

PARTITION_NAME                 BYTES/1024/1024
------------------------------ ---------------
PART_2005                                  260
PART_2006                                  730
PART_200706                                380
PART_200707                                 60
PART_200708                                 80
PART_200709                                 80
PART_200710                                 50
PART_200711                                 60
PART_200712                                 80
PART_200801                                160
PART_200802                                130
PART_200803                                 70
PART_200804                                 10
PART_200805                                 10
PART_200806                                 10
PART_200807                                 10
PART_200808                                 10
PART_200809                                 10
PART_200810                                 10
PART_200811                                 10
PART_200812                                 10
PART_MAX                                    10

22 rows selected.

Elapsed: 00:00:00.12
[/php]

使用道具 举报

回复

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

本版积分规则 发表回复

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