行链接和行迁移检测和消除方法
2013-08-09 15:40
483 查看
在官方文档中,翻译Performance Tuning Guide /10.2.4.3 Table Fetch by Continued Row.
You can detect migrated or chained rows by checking the number of tablefetchcontinuedrow statistic in V$SYSSTAT. A small number of chained rows (less than 1%) is unlikely to impact system performance. However, a large
percentage of chained rows can affect performance.
--你可以通过V$SYSSTAT检测到行迁移和行链接.这个链接少(小于1%)是不太可能影响性能.然而,比例占大了就会影响性能。
Chaining on rows larger than the block size is inevitable. You might want to consider using tablespace with larger block size for such data.
However, for smaller rows, you can avoid chaining by using sensible space parameters and good application design. For example, donot insert a row with key values filled in and nulls in most other columns,
then update that row with the real data, causing the row to grow in size. Rather, insert rows filled with data from the start.
--链接行大于block size是不可避免的,对这些数据你可以考虑使用增大block size的表空间。可是,多小的行,你可以用空间参数和好的应用设计避免链接.例如,不要插入一行数据,而一行带有大量NULL的列,更合适的是,从一开始插入数据就要填满行。
If an UPDATE statement increases the amount of data in a row so that the row no longer fits in its data block, then Oracle tries to find another block with enough
free space to hold the entire row. If such a block is available, then Oracle moves the entire row to the new block. This is called migrating a row. If the row is too large to fit into any available block, then Oracle splits the row into multiple pieces and
stores each piece in a separate block. This is called chaining a row. Rows can also be chained when they are inserted.
--如果一个update语句使一行增大而造成数据块不能容纳此行,oracle会找到一个其它块能够容纳整行.如果有这样的空闲块,oracle会移动整行到新的块中,这个叫行迁移。如果行太大以至于不能插入任何块,于是oracle会把这行分裂成不同的片段存储到不同的数据块上,这个叫行链接,这个情况发生在insert.
Migration and chaining are especially detrimental to performance with the following:
UPDATE statements that cause migration and chaining to perform poorly
Queries that select migrated or chained rows because these must perform additional input and output
The definition of a sample output table namedCHAINED_ROWS appears in a SQL script available on your distribution medium. The common name of this script isUTLCHN1.SQL,
although its exact name and location varies depending on your platform. Your output table must have the same column names, datatypes, and sizes as the CHAINED_ROWS table.
--以下是特别对性能有害的行链接和行迁移:
Update语句引起的行迁移导致性能不佳;对查询行迁移和行链接的行必须执行额外的输出、输入.检测行链接:
SQL> @?\RDBMS\ADMIN\utlchain.sql
SQL> analyze table 【table_name】 list chained rows into chained_rows;
SQL> select owner_name,table_name,head_rowid from chained_rows;
Increasing PCTFREE can help to avoid migrated rows. If you leave more free space available in the block, then the row has room to grow. You can also reorganize
or re-create tables and indexes that have high deletion rates. If tables frequently have rows deleted, then data blocks can have partially free space in them. If rows are inserted and later expanded, then the inserted rows might land in blocks with deleted
rows but still not have enough room to expand. Reorganizing the table ensures that the main free space is totally empty blocks.
--增大pctfree可以帮组避免行迁移.如果你在块中预留更多空余空间,因而行有更多的空间增长.你也可以重建表和删除率高的索引.如果表频繁的有行删除,那么数据块能够有部分的空余空间.如果行插入然后扩大,插入的行占用删除行的空间但是依然没有足够的空间去扩展.重新组织表确保主要的空余空间是空块.
那么可以消除行迁移和行链接
1.不要插入一行数据,而一行带有大量NULL的列,更合适的是,从一开始插入数据就要填满行。
2.使用增大block size的表空间。
3.增大pctfree。
4.重建表或索引。
You can detect migrated or chained rows by checking the number of tablefetchcontinuedrow statistic in V$SYSSTAT. A small number of chained rows (less than 1%) is unlikely to impact system performance. However, a large
percentage of chained rows can affect performance.
--你可以通过V$SYSSTAT检测到行迁移和行链接.这个链接少(小于1%)是不太可能影响性能.然而,比例占大了就会影响性能。
Chaining on rows larger than the block size is inevitable. You might want to consider using tablespace with larger block size for such data.
However, for smaller rows, you can avoid chaining by using sensible space parameters and good application design. For example, donot insert a row with key values filled in and nulls in most other columns,
then update that row with the real data, causing the row to grow in size. Rather, insert rows filled with data from the start.
--链接行大于block size是不可避免的,对这些数据你可以考虑使用增大block size的表空间。可是,多小的行,你可以用空间参数和好的应用设计避免链接.例如,不要插入一行数据,而一行带有大量NULL的列,更合适的是,从一开始插入数据就要填满行。
If an UPDATE statement increases the amount of data in a row so that the row no longer fits in its data block, then Oracle tries to find another block with enough
free space to hold the entire row. If such a block is available, then Oracle moves the entire row to the new block. This is called migrating a row. If the row is too large to fit into any available block, then Oracle splits the row into multiple pieces and
stores each piece in a separate block. This is called chaining a row. Rows can also be chained when they are inserted.
--如果一个update语句使一行增大而造成数据块不能容纳此行,oracle会找到一个其它块能够容纳整行.如果有这样的空闲块,oracle会移动整行到新的块中,这个叫行迁移。如果行太大以至于不能插入任何块,于是oracle会把这行分裂成不同的片段存储到不同的数据块上,这个叫行链接,这个情况发生在insert.
Migration and chaining are especially detrimental to performance with the following:
UPDATE statements that cause migration and chaining to perform poorly
Queries that select migrated or chained rows because these must perform additional input and output
The definition of a sample output table namedCHAINED_ROWS appears in a SQL script available on your distribution medium. The common name of this script isUTLCHN1.SQL,
although its exact name and location varies depending on your platform. Your output table must have the same column names, datatypes, and sizes as the CHAINED_ROWS table.
--以下是特别对性能有害的行链接和行迁移:
Update语句引起的行迁移导致性能不佳;对查询行迁移和行链接的行必须执行额外的输出、输入.检测行链接:
SQL> @?\RDBMS\ADMIN\utlchain.sql
SQL> analyze table 【table_name】 list chained rows into chained_rows;
SQL> select owner_name,table_name,head_rowid from chained_rows;
Increasing PCTFREE can help to avoid migrated rows. If you leave more free space available in the block, then the row has room to grow. You can also reorganize
or re-create tables and indexes that have high deletion rates. If tables frequently have rows deleted, then data blocks can have partially free space in them. If rows are inserted and later expanded, then the inserted rows might land in blocks with deleted
rows but still not have enough room to expand. Reorganizing the table ensures that the main free space is totally empty blocks.
--增大pctfree可以帮组避免行迁移.如果你在块中预留更多空余空间,因而行有更多的空间增长.你也可以重建表和删除率高的索引.如果表频繁的有行删除,那么数据块能够有部分的空余空间.如果行插入然后扩大,插入的行占用删除行的空间但是依然没有足够的空间去扩展.重新组织表确保主要的空余空间是空块.
那么可以消除行迁移和行链接
1.不要插入一行数据,而一行带有大量NULL的列,更合适的是,从一开始插入数据就要填满行。
2.使用增大block size的表空间。
3.增大pctfree。
4.重建表或索引。
相关文章推荐
- 行链接和行迁移检测和消除方法
- Oracle 行迁移 & 行链接的检测与消除
- 行链接 行迁移的消除
- oracle 关于行链接和行迁移和消除
- 消除行链接、行迁移
- 从vs2005或者vs2008迁移到vs2010链接错误: fatal RC1106: invalid option: -ologo 修正方法
- 行链接和行迁移的检测和防止
- TCP Socket链接检测方法
- 检查行链接和行迁移的方法
- 动态链接库内检测自己dll文件存放目录的方法
- SOCKET 检测链接是否断线的三种方法(转载)
- Oracle中行迁移和行链接的清除及检测
- Oracle中行迁移和行链接的清除及检测
- SOCKET 检测链接是否断线的三种方法
- 物体检测及分类方法总结(提供了很多论文和代码链接)
- 微软CRM 3.0迁移后”报表”链接打开报错解决方法!
- 刚进入win7系统就提示检测到一个硬盘问题的解决方法
- 2017/03/14 海洋内波和另外关于opencv中的椭圆检测方法
- PHP Action中跳转到别的方法、页面中点击链接跳转到ACtion中方法、AJAX提交传参给ACTION
- 人脸特征点检测(二)参数化模型方法