您的位置:首页 > 数据库 > Oracle

DSI405中关于smon和空间回收的内容

2016-07-07 17:27 393 查看

1.SMON Functions

SMON is implemented by ktmmon().      smon是用ktmmon()来实现的

The main functions of SMON are:

Merging or coalescing free extents          联合、合并空闲区

Cleaning up temporary segments           清理临时段

Cleaning up nonexistent objects in OBJ$       从obj$清理不存在的对象

Cleaning up IND$ if online builder crashes    如果在线建索引失败,清理ind$

Shrinking undo segments                                  收缩undo段

Transaction recovery on startup                        数据库startup的时候做事务恢复

Transaction rollback (when posted by PMON)   事务回滚(通过pmon)

2.Coalescing Free Space

SMON performs tablespace coalescing every 5minutes.            smon每5分钟执行表空间的合并

It calls ktsclsb() to coalesce five groupsof extents.                        调用ktsclsb()去合并5组区

The function merges extents insystem-managed tablespaces and where PCTINCREASE > 0     函数合并系统管理表空间并且pctincrease>0的表空间的区

The ST enqueue is held during each merge.  每次联合都需要持有ST队列(spacemanagement enqueue)

To identify if SMON has coalesced, thefollowing query displays a summary by tablespace:    查询smon是否执行了合并

SELECT count(*) FROMdba_free_space_coalesced;

3.Disabling Background Coalescing   禁止后台合并

Background coalescing should not be aproblem.

It can be reduced by: 

Using locally managed tablespaces                                              使用本地管理表空间

Setting PCTINCREASE to 0 as the default fortablespaces        设置表空间的pctincrease默认值为0

It can be disabled completely by settingevent 10269.                 通过设置事件10269来禁止

4.Temporary Segment Cleanup   临时段的清理

SMON performs this task every two hours.                                                                                                                   smon每两个小时执行临时段的清理任务

It calls the function ktssdt_segs() to dropall the stray temporary segments.                                                        调用ktssdt_segs()去删除所有的零散的临时段

If many processes are aborted while holdingtemporary segments, then the work is considerable.           如果很多持有临时段的进程意外终止了,那么这个工作应该引起注意

The TS (temporary segment) enqueue isacquired each time SMON finds a segment to be dropped.      每次smon去查找需要删除的段时,都需要获得TS队列

To identify if SMON is doing the cleanup,check the number of temporary segments.  通过下面的查询,确定smon是否正在做清理,检查临时段的数量:

SELECT count(*) FROM dba_extents WHEREsegment_type = 'TEMPORARY';

5.Disabling Temporary Segment Cleanup   禁止临时段清理

Temporary segment cleanup should not be aproblem.

It can be reduced by: 

Using sort segments in temporarytablespaces       在临时表空间使用排序段

Encouraging users not to abort processes              鼓励用户不要是进程意外终止

It can be disabled completely by settingevent 10061.   设置事件10061去完全禁止
http://blog.csdn.net/nanaranran/article/details/51852622
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  oracle