The spacepreallocation feature after 11 GB and SMCO/W00N

Source: Internet
Author: User
Oracle introduced a new feature of Smart Space pre-allocated spacepreallocation after 11 GB. This feature involves three fields: table space pre-allocation and Extended Data segment pre-allocation and extended LOBchunk pre-allocation and extended the following is an example of tablespace pre-allocation and expansion. You can see the data FILE #3 corresponding to a table space.

After 11g, oracle introduced a new feature of Smart space pre-allocation space preallocation, which involves three fields: table space pre-allocation and Extended Data segment pre-allocation and extended LOB chunk pre-allocation and extended the following is an example of tablespace pre-allocation and expansion. You can see the data FILE corresponding to a table space # = 3

After 11g, oracle introduced a new feature of Smart space pre-allocation space preallocation, which involves three fields:

  • Table space pre-allocation and Expansion
  • Pre-allocation and expansion of Data segment
  • Pre-allocation and expansion of LOB chunk

The following is an example of table space pre-allocation and expansion. We can see the data FILE # = 3 corresponding to a tablespace. Due to the estimated space usage in a period of time, therefore, we have extended a lot of space in a few hours:

Sat Oct 04 06:07:46 2014Resize operation completed for file# 3, old size 706560K, new size 716800KSat Oct 04 08:00:03 2014www.askmaclean.comThread 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_.logSat Oct 04 08:00:05 2014TT00: Standby redo logfile selected for thread 1 sequence 60 for destination LOG_ARCHIVE_DEST_2Sat Oct 04 08:00:06 2014Archived Log entry 79 added for thread 1 sequence 59 ID 0xe5f08f5 dest 1:Sat Oct 04 08:08:00 2014www.askmaclean.comResize operation completed for file# 3, old size 716800K, new size 727040KSat Oct 04 10:08:37 2014Thread 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_.logSat Oct 04 10:08:37 2014TT00: Standby redo logfile selected for thread 1 sequence 61 for destination LOG_ARCHIVE_DEST_2Sat Oct 04 10:08:40 2014Archived Log entry 81 added for thread 1 sequence 60 ID 0xe5f08f5 dest 1:Sat Oct 04 13:08:34 2014Resize operation completed for file# 3, old size 727040K, new size 737280KSat Oct 04 14:04:39 2014Resize operation completed for file# 3, old size 747520K, new size 757760K

The preceding expansion is limited by the predefined parameter TBS_EXTENSION_MAX_STEP_SIZE (64 MB) in Oracle, that is, the maximum one expansion is 64 MB. You can see from the above logs that most of the expansion is 10 MB at a time.

For tablespace pre-allocation ,? The space preallocation feature is analyzed every 10 minutes based on the table space usage in the past six hours. It is based on the following data analysis:

  • 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 shoshould 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

For segment pre-allocation, the statistical information of the segment is flushed to AWR every half an hour (WRH $ _ SEG_STAT ), the growth trend of the Segment growth trend data Segment is also completed every half an hour, based on the following data analysis:

  • 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]

The usage of the LOB chunk is recorded in the memory every 10 minutes. It is also flushed to AWR periodically and analyzed based on the following data:

  • 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 processing ing 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

These pre-allocation and expansion tasks are mainly completed by SMCO (Space Management Coordinator Process) and its worker Process W00n (slave. SMCO and W00n are background task frameworks driven by task. This background task system is instance-based, not database-based. Each instance has its own background Task Service System to run and process tasks initiated in this instance. Different RAC instances do not interact with each other to handle the load of such tasks.

Task coordinator (SMCO), SMCO acts as a scheduling process to manage Task queues and slave process pools. The main task is to move tasks among several task queue, clear expired tasks, dynamically allocate new slave (W00n) processes based on the task needs, and monitor the slave process. An instance has only one SMCO process, and the SMCO process is not a fatal process. It is generally okay to kill it.

What are some new features of 12c? Policy Driven Data Movement and ILM (Information Lifecycle Management) Project Data Lifecycle Management also relies on SMCO background processes.

SMON and SMON are the old background processes that are already responsible for a series of tasks. It also dynamically starts the SMCO process. SMON will now regularly check whether SMCO is started, and SMON will also start SMCO when a task is submitted.

W00n and other groups of Slave processes, the Slave Process is always the actual working people. The Salve process is dynamically allocated by the SMCO scheduler. Once started, the slave process will work independently, and it will automatically search for and execute tasks from the ready-task queue. If the idle time is too long, the W00n will be terminated by itself.

The general workflow is as follows:

  • 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.

Parameters related to the space preallocation feature after the 11g are as follows:

_ 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 shocould 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 shoshould be
Decided by the availability of SGA memory and the efficiency of task maintenance. Too your cached tasks will simply increase the burden
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

When SMCO or W00n encounters problems in completing space preallocation, you can disable this feature:

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
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.
Failure of these processes does not cause instance to fail.
Properties: Optional, non-fatal, database instance only

Related posts:

  1. Enq: HW-contention wait event
  2. Learning 11g New Background Processes
  3. [New 12c features] dbms_stats report_gather_auto_stats statistical information report features
  4. X $ explanation of ksusecst internal view
  5. Oracle Streams streaming replication performance optimization script

Original article address: space preallocation features and SMCO/W00N after 11 GB, thanks to the original author for sharing.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.