DBAsupport.com Forums - Powered by vBulletin
Results 1 to 2 of 2

Thread: Finding blocks with rows query

  1. #1
    Join Date
    Oct 2000
    Posts
    80
    The following query is used to find the number of blocks that contain rows:
    SELECT COUNT(DISTINCTSUBST(ROWID,15,4)||SUBSTR(ROWID,1,8))
    FROM owner.tablename.

    I have run this and do not understand how the two substring arguments detect occupancy.

    Can somebody help me to understand this?
    Thanks in advance.
    John Doyle

  2. #2
    Join Date
    Feb 2000
    Location
    Singapore
    Posts
    1,758
    Below is the ROWID format fro Oracle7

    'BBBBBBBB.RRRR.FFFF'

    where
    BBBBBBBB is the block number,
    RRRR is the slot(row) number, and
    FFFF is a file number.

    So in yur query you are counting the no. of occupied blocks in all the files.

    However the ROWID format has been changed in Oracle8

    Sanjay

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width