最新文章专题视频专题问答1问答10问答100问答1000问答2000关键字专题1关键字专题50关键字专题500关键字专题1500TAG最新视频文章推荐1 推荐3 推荐5 推荐7 推荐9 推荐11 推荐13 推荐15 推荐17 推荐19 推荐21 推荐23 推荐25 推荐27 推荐29 推荐31 推荐33 推荐35 推荐37视频文章20视频文章30视频文章40视频文章50视频文章60 视频文章70视频文章80视频文章90视频文章100视频文章120视频文章140 视频2关键字专题关键字专题tag2tag3文章专题文章专题2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章专题3
问答文章1 问答文章501 问答文章1001 问答文章1501 问答文章2001 问答文章2501 问答文章3001 问答文章3501 问答文章4001 问答文章4501 问答文章5001 问答文章5501 问答文章6001 问答文章6501 问答文章7001 问答文章7501 问答文章8001 问答文章8501 问答文章9001 问答文章9501
当前位置: 首页 - 科技 - 知识百科 - 正文

11g以后的spacepreallocation特性和SMCO/W00N

来源:懂视网 责编:小采 时间:2020-11-09 13:03:59
文档

11g以后的spacepreallocation特性和SMCO/W00N

11g以后的spacepreallocation特性和SMCO/W00N:11g以后oracle引入了智能空间预分配space preallocation的新特性,该新特性涉及3个领域: 表空间的预分配和扩展 数据段segment的预分配和扩展 LOB chunk的预分配和扩展 以下是一个tablespace 预分配和扩展的例子,可以看到某个表空间对应的FILE#=3的数
推荐度:
导读11g以后的spacepreallocation特性和SMCO/W00N:11g以后oracle引入了智能空间预分配space preallocation的新特性,该新特性涉及3个领域: 表空间的预分配和扩展 数据段segment的预分配和扩展 LOB chunk的预分配和扩展 以下是一个tablespace 预分配和扩展的例子,可以看到某个表空间对应的FILE#=3的数

11g以后oracle引入了智能空间预分配space preallocation的新特性,该新特性涉及3个领域: 表空间的预分配和扩展 数据段segment的预分配和扩展 LOB chunk的预分配和扩展 以下是一个tablespace 预分配和扩展的例子,可以看到某个表空间对应的FILE#=3的数据文件

11g以后oracle引入了智能空间预分配space preallocation的新特性,该新特性涉及3个领域:

  • 表空间的预分配和扩展
  • 数据段segment的预分配和扩展
  • LOB chunk的预分配和扩展
  • 以下是一个tablespace 预分配和扩展的例子,可以看到某个表空间对应的FILE#=3的数据文件,由于在一段时间内的空间使用情况预估,所以在几个小时内扩展了不少的空间:

    Sat Oct 04 06:07:46 2014
    Resize operation completed for file# 3, old size 706560K, new size 716800K
    Sat Oct 04 08:00:03 2014
    www.askmaclean.com
    Thread 1 advanced to log sequence 60 (LGWR switch)
     Current log# 2 seq# 60 mem# 0: /s01/oradata/PDPROD/onlinelog/o1_mf_2_b2wgc3rf_.log
     Current log# 2 seq# 60 mem# 1: /s01/fast_recovery_area/PDPROD/onlinelog/o1_mf_2_b2wgc4mf_.log
    Sat Oct 04 08:00:05 2014
    TT00: Standby redo logfile selected for thread 1 sequence 60 for destination LOG_ARCHIVE_DEST_2
    Sat Oct 04 08:00:06 2014
    Archived Log entry 79 added for thread 1 sequence 59 ID 0xe5f08f5 dest 1:
    Sat Oct 04 08:08:00 2014
    www.askmaclean.com
    Resize operation completed for file# 3, old size 716800K, new size 727040K
    Sat Oct 04 10:08:37 2014
    Thread 1 advanced to log sequence 61 (LGWR switch)
     Current log# 3 seq# 61 mem# 0: /s01/oradata/PDPROD/onlinelog/o1_mf_3_b2wgc6ol_.log
     Current log# 3 seq# 61 mem# 1: /s01/fast_recovery_area/PDPROD/onlinelog/o1_mf_3_b2wgc70g_.log
    Sat Oct 04 10:08:37 2014
    TT00: Standby redo logfile selected for thread 1 sequence 61 for destination LOG_ARCHIVE_DEST_2
    Sat Oct 04 10:08:40 2014
    Archived Log entry 81 added for thread 1 sequence 60 ID 0xe5f08f5 dest 1:
    Sat Oct 04 13:08:34 2014
    Resize operation completed for file# 3, old size 727040K, new size 737280K
    Sat Oct 04 14:04:39 2014
    Resize operation completed for file# 3, old size 747520K, new size 757760K

    以上这种扩展受到Oracle内部预定义的参数TBS_EXTENSION_MAX_STEP_SIZE(64MB)的限制,即最大一次扩展是64MB,可以从上述日志看到大多数扩展在这里是一次10MB。

    对于表空间预分配,?space preallocation特性会基于过去6个小时内的表空间使用情况,每隔10分钟分析一次,基于以下的数据分析:

  • Database id – Database identifier
  • Tablespace id – Tablespace identifier number
  • Creation SCN (wrap, base) [NEW] – SCN when the tablespace is created. This is for tablespace sanity check in case that the tablespace is?dropped or recreated after the statistics is collected.
  • Allocated space – Space allocated to the tablespace
  • Used space – Space currently used in the tablespace. For permanent tablespace, it is represented by the used extents. For temporary?tablespace, this should be the space used by active sorts, hash joins and other transient objects.
  • Max size – Maximum size of the tablespace
  • Flag – Tablespace flag (e.g. perm/temp/undo)
  • Stat-collection Timestamp [NEW] – The time when the statistics is collected
  • 对于数据段segment预分配,数据段的统计信息会每半个小时flush到AWR中(WRH$_SEG_STAT),Segment growth trend数据段的增长趋势也会每半个小时完成一次, 基于以下的数据分析:

  • Tablespace id
  • Tablespace creation SCN (wrap, base) [NEW]
  • Segment obj#
  • Segment dataobj#
  • Number of allocated blocks
  • Number of used blocks
  • Stat-collect Timestamp [NEW] – The time when the statistics is collected
  • Last-analysis timestamp [NEW] – The time when the segment is analyzed the last time
  • Number of forecasted used blocks [NEW]
  • LOB chunk的使用情况 会每10分钟记录在内存中,也会定期flush到AWR中,基于以下的数据分析:

  • Instance id
  • Tablespace id
  • Tablespace creation SCN (wrap, base)
  • Segment obj#
  • Segment dataobj#
  • Number of estimated optimal allocation for each chunk size (Ne) – One occurrence of an allocation for a chunk size refers to a planned
  • allocation of the optimal chunk size that is calculated by the space layer when receiving a chunk allocation request from the data layer.
  • Number of allocations for each chunk size (Na)
  • Number of deallocation for each chunk size (Nd)
  • Number of under-allocation for each chunk size (Nu)
  • Number of split for each chunk size (Ns)
  • Number of projected allocations for each chunk size (Np)
  • Timestamp – The time when the statistics is collected
  • 这些预分配和扩展任务主要由SMCO(Space Management Coordinator Process)和其小工进程W00n(slave )一起完成。 SMCO和W00n是基于任务task驱动的后台任务Framework。这个后台任务体系是基于实例的,而非基于数据库的。每一个实例instance有其自己的后台任务服务体系,运行和处理在本实例发起的任务。RAC的不同实例之间不会交互来负责此种任务的负载。

    Task coordinator ( SMCO ) ,SMCO充当调度进程以便管理任务队列和slave进程池。其主要任务是在几个task queue之间移动任务,清理过期任务,基于任务需要来动态分配新的slave(W00n)进程,并监控slave进程。 一个实例只有一个SMCO进程,且SMCO进程不是fatal进程,kill了一般也没事。

    部分12c新特性?Policy Driven Data Movement and ILM(Information Lifecycle Management) Project 数据生命周期管理也依赖于SMCO后台进程。

    SMON,SMON是老牌后台进程 已经负责了一系列任务。其现在也负载动态启动SMCO进程。SMON现在会定期检查SMCO是否启动着,SMON也会当有任务提交时启动SMCO。

    W00n等一组Slave Process,Slave进程总是实际干活的人。Salve process由SMCO这个调度器动态分配。一旦启动后,slave 进程将自主工作,其自动从ready-task队列中找寻任务并执行。如果空闲了过长时间,那么W00n也会自行终止。

    其大致的工作流程如下:

  • The foreground system/user session submits a task through ktsjCreateTask.
  • The task is created. If the task is planned to start right away, it is inserted into one of the ready-task queue directly, otherwise, it isinserted into the not-ready-task queue.
  • If SMCO does not exist, post SMON to start SMCO .
  • If SMCO is available, post SMCO that a new task is available.
  • SMCO knows that there is a task that needs to be run in the near future. It starts a slave process.
  • SMCO moves the task from the not-ready queue to the ready queue and posts any waiting slave.
  • The slave process picks up the task from the ready queue and invokes the task’s callback function.
  • The task is done. The slave process executes the completion call back of the task.
  • The slave process post SMCO that a task is finished. askmaclean.com
  • SMCO updates task execution statistics and may choose to free the task if there is no enough memory for task cache.
  • The slave process periodically checks if there is any task in the ready-task queue.
  • 与该11g以后的space preallocation特性相关的参数如下:

    _enable_space_background_task/_enable_spacebg – This parameter specifies whether the background task support is enabled.

    _max_ smco _slaves – This parameter specifies the maximum number of active slave process that can be spawned at a time. Ideally, the number
    of slave processes should be decided by the system workload and the availability of system resources.
    _max_ smco _tasks – This parameter specifies the maximum number of tasks that can be stored in memory. Ideally, the number of tasks should be
    decided by the availability of SGA memory and the efficiency of task maintenance. Too many cached tasks will simply increase the burden of
    task maintenance.

    _enable_space_background_task
    Parameter Name: _enable_space_background_task
    Parameter Type: boolean
    Allowable Values: TRUE to enable the feature, and FALSE to disable the feature
    Default Value: TRUE. The space management background task support will be enabled by default.
    Description: This parameter allows the user to choose whether to enable the space management background task support feature.
    Dynamic: The parameter is dynamic and the scope is ALTER SYSTEM.
    Example: alter system set “_enable_space_background_task ” = TRUE

    _enable_space_preallocation
    Parameter Name: _enable_space_preallocation
    Parameter Type: integer
    Allowable Values:
    0x00: disable all levels of space preallocation
    0x01: enable tablespace extension ahead of time
    0x02: enable segment growth ahead of time
    0x04: enable chunk allocation ahead of time
    Combination of any of the above 3 levels of space preallocation?Default Value: 0x07. The space preallocation at all levels will be enabled by default. However, whether the space preallocation will be done and how much?space will be allocated relies on the system monitor analysis result.

    Description: This parameter allows the user to enable different levels of space preallocation.
    Dynamic: The parameter is dynamic and the scope is ALTER SYSTEM.
    Example: alter system set “_enable_space_prealloaction ” = 1
    _max_spacebg_slaves
    the parameter that allows user to set maximum number of space BG slaves

    _minmax_spacebg_slaves
    the parameter that allows user to set min-max number of space BG slaves

    _min_spacebg_slaves

    the parameter that allows user to set minimum number of space BG slaves

    _max_spacebg_tasks

    the parameter that specifies the maximum number of space BG tasks
    _max_spacebg_msgs_percentage

    the parameter that specifies percentage of _messages (ksaxxm) before KTSJ
    throttling occurs. Default level is 50%. When throttle level is reached,
    interrupt messages are not sent (thus avoiding _messages queue).

    _enable_space_preallocation 3 enable space pre-allocation
    _enable_spacebg TRUE enable space management background task
    _max_spacebg_slaves 1024 maximum space management background slaves
    _minmax_spacebg_slaves 8 min-max space management background slaves
    _min_spacebg_slaves 2 minimum space management background slaves
    _max_spacebg_tasks 8192 maximum space management background tasks
    _max_spacebg_msgs_percentage 50 maximum space management interrupt message throttling

    对于由于SMCO 或W00n在完成space preallocation过程中遇到的问题时,可以考虑禁用该特性,具体方法为:

    SQL> alter system set "_enable_spacebg"=false;
    System altered.
    SQL> alter system set "_enable_space_preallocation"=0;
    System altered.
    

    SMCO/Wnnn

    Short Description: The space management coordinator (SMCO) process coordinates the execution of
    various space management related tasks, such as proactive space allocation and space reclamation. It
    dynamically spawns slave processes (Wnnn) to implement the task.
    Detailed Description: The space management coordinator (SMCO) and slave (Wnnn) processes work
    cooperatively on various background space management tasks in a database instance. The coordinator
    is responsible for maintaining the tasks and dispatching tasks. It dynamically spawns new slaves based
    on task needs. The slave process performs the actual space management task, including space preallocation
    and space reclamation. Once started, the slave process acts as an autonomous agent. After
    it finishes execution of the task, it automatically pick up another one from the task queue. It terminates
    itself after being idle for a long time. SMCO and Wnnn are optional non-fatal background processes.
    There is at most one SMCO process per instance. There can be several Wnnn processes at a time. The
    failure of these processes does not cause instance to fail.
    Properties: Optional, non-fatal, database instance only

    Related posts:

    1. enq: HW – contention等待事件
    2. Learning 11g New Background Processes
    3. 【12c新特性】dbms_stats report_gather_auto_stats统计信息报告特性
    4. x$ksusecst 内部视图详解
    5. Oracle Streams流复制性能优化脚本

    声明:本网页内容旨在传播知识,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。TEL:177 7030 7066 E-MAIL:11247931@qq.com

    文档

    11g以后的spacepreallocation特性和SMCO/W00N

    11g以后的spacepreallocation特性和SMCO/W00N:11g以后oracle引入了智能空间预分配space preallocation的新特性,该新特性涉及3个领域: 表空间的预分配和扩展 数据段segment的预分配和扩展 LOB chunk的预分配和扩展 以下是一个tablespace 预分配和扩展的例子,可以看到某个表空间对应的FILE#=3的数
    推荐度:
    标签: pre 后的 特性
    • 热门焦点

    最新推荐

    猜你喜欢

    热门推荐

    专题
    Top