为了正常的体验网站,请在浏览器设置里面开启Javascript功能!

oracle碎片整理方法

2018-04-29 3页 doc 15KB 5阅读

用户头像

is_562397

暂无简介

举报
oracle碎片整理方法oracle碎片整理方法 extent autoallocate uniform Starting with Oracle 9i, DBAs can now create locally managed tablespaces. A Locally Managed TBS manages its own list of free extents in a bitmap block placed inside the header of the first data file of the tablespace. Insi...
oracle碎片整理方法
oracle碎片整理方法 extent autoallocate uniform Starting with Oracle 9i, DBAs can now create locally managed tablespaces. A Locally Managed TBS manages its own list of free extents in a bitmap block placed inside the header of the first data file of the tablespace. Inside the bitmap block, each bit maps to a free block in the tablespace. When creating a locally managed tablespace, you can specify the extent allocation method to be used. AUTOALLOCATE - means that the extent sizes are managed by Oracle. Oracle will choose the optimal next size for the extents starting with 64KB . As the segments grow and more extents are needed, Oracle will start allocating larger and larger sizes ranging from 1Mb to eventually 64Mb extents. This might help conserve space but will lead to fragmentation. This is usually recommended for small tables or in low managed systems. UNIFORM - specifies that the extent allocation in the tablespace is in a fixed uniform size. The extent size can be specified in M or K. The default size for UNIFORM extent allocation is 1M . Using uniform extents usually minimizes fragmentation and leads to better overall performance. SQL>CREATE TABLESPACE test_tablespcae DATAFILE '/emc/oradata/test_tablespace1.dbf' SIZE 50M EXTENT MANAGEMENT LOCAL AUTOALLOCATE; SQL>CREATE TABLESPACE test_tablespcae DATAFILE '/emc/oradata/test_tablespace1.dbf' SIZE 50M EXTENT MANAGEMENT LOCAL UNIFORM SIZE 512K; I usually prefer to keep large production-grade tables in UNIFORM sized tablespaces and smaller tables or tables in unmanaged environments in AUTOALLOCATE tablespaces. 上文提到“自动分配”方式extent的尺寸是从64kb开始,这就说明 segment的storage的initial参数必须大于64k,否则无效并使用 64k。 在“自动分配”方式下,建的参数:pctincrease、next extent、 Max extents pctused 等参数无效 理解: 1 插入数据到表的时候(表和段就是同义词),先申请自由空间放数 据,会在HWM以上去寻找自由空间: ->如果是采取AUTOALLOCATE,则自己找合适的空间64K-64M oracle 自己决定因此当oracle希望找到20M空间时候又没有而且碎片也很 难找到适合大小的空间,则会报错。 ->如果是uniform则每次分配指定的大小,没有了会在碎片里面去 找,因此碎片会较少; 2 ->oracle SMON会自动合并些碎片; ->大表建议用uniform size,小表可以用autoallocate 3 碎片整理: ->exp-truncate-imp:delete不会reset HWM,只有truncate; ->rename old_tab to new_tab create old_tab imp old_tab rebuild index drop new_tab ->alter table name move tablespace_new truncate rebuild index 4 ->dba_segments ->dba_extents ->dba_tablespaces ->dba_free_space ->dba_free_extens
/
本文档为【oracle碎片整理方法】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑, 图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。 本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。 网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。

历史搜索

    清空历史搜索