ORACLE rowID slicing Large tables

Source: Internet
Author: User

Get the rowID shard range with the following SQL

SELECTRowNum|| ', ' || 'rowID between' ||Chr the)||Dbms_rowid.rowid_create (1, DOI, Lo_fno, Lo_block,0)||Chr the)||       ' and' ||Chr the)||Dbms_rowid.rowid_create (1, DOI, Hi_fno, Hi_block,1000000)||Chr ( the) Data from(SELECT DISTINCTDOI, GRP, First_value (RELATIVE_FNO) Over(PARTITION byDOI, GRPORDER  byRELATIVE_FNO, block_id rowsbetweenunbounded preceding andunbounded following) Lo_fno, First_value (block_id) Over(PARTITION byDOI, GRPORDER  byRELATIVE_FNO, block_id rowsbetweenunbounded preceding andunbounded following) Lo_block, Last_value (RELATIVE_FNO) Over(PARTITION byDOI, GRPORDER  byRELATIVE_FNO, block_id rowsbetweenunbounded preceding andunbounded following) Hi_fno, Last_value (block_id+Blocks- 1) Over(PARTITION byDOI, GRPORDER  byRELATIVE_FNO, block_id rowsbetweenunbounded preceding andunbounded following) Hi_block,SUM(blocks) Over(PARTITION byDOI, GRP) sum_blocks, Subobject_name from(SELECTObj.object_id, obj. Subobject_name, obj. data_object_id asDOI, Ext.relative_fno, ext.block_id,SUM(blocks) Over()SUM,                       SUM(blocks) Over(ORDER  bydata_object_id, RELATIVE_FNO, block_id)- 0.01Sum_fno, TRUNC ((SUM(blocks) Over(ORDER  bydata_object_id, Relative_fno, BLOCK_ID)- 0.01)/                             (SUM(blocks) Over()/ &CNT)) GRP, Ext.blocks fromdba_extents ext, dba_objects objWHEREExt.segment_name= '&object_name'                    andExt.owner= '&owner'                    andObj.owner=Ext.owner andObj.object_name =Ext.segment_name andObj. data_object_id is  not NULL                 ORDER  bydata_object_id, Relative_fno, block_id)ORDER  byDOI, GRP);

ORACLE rowID slicing Large tables

Related Article

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.