Re: Block question

  • From: MARK BRINSMEAD <mark.brinsmead@xxxxxxxxx>
  • To: cure@xxxxxxxxxxxxx
  • Date: Fri, 27 Feb 2015 15:30:17 -0500

No.

The purpose of this query is (appears to be) to identify the segment (or
the extent of the segment) containing a particular block.  This is
something you would probable want to do, for example, when your alertlog
reports that block #12345 in file #7 has been corrupted.

In order for *&block_value = blockid*  to work (with any reliability),
DBA_EXTENTS would need have a row for each and every block in each and
every extent in the entire database.  Not only would that not be proper
normalization of the data, it would be incredibly wasteful of storage.

DBA_EXTENTS reports only the first block and the number of blocks in the
extent (recall that extents are always a contiguous range of blocks within
a single datafile).  To find the extent (or object) containing a block that
interests you, you need check whether it is within a range.

On Fri, Feb 27, 2015 at 3:21 PM, Paul Harrison <cure@xxxxxxxxxxxxx> wrote:

> Hi Team,
>
>
>
>
>
> I came upon the below on the internet.
>
> " ( &block_value BETWEEN block_id AND ( block_id + blocks ) )"    <-- I
> don't understand how this comes into the equation.  Shouldn't it just be
> &block_value = <value> ?
>
>
>
>
>
>
>
>
>
> List an Object and Object Type via a Given File and Block ID.
>
>
>
> --
>
> -- List an Object and Object Type via a Given File and Block ID.
>
> --
>
> SET PAUSE ON
>
> SET PAUSE 'Press Return to Continue'
>
> SET PAGESIZE 60
>
> SET LINESIZE 300
>
> COLUMN segment_name FORMAT A24
>
> COLUMN segment_type FORMAT A24
>
> SELECT segment_name, segment_type, block_id, blocks
>
>    FROM   dba_extents
>
>    WHERE
>
>           file_id = &file_no
>
>    AND
>
>           ( &block_value BETWEEN block_id AND ( block_id + blocks ) )
>
> /
>
>
>
>
>
>
>
> Thanks,
>
> Paul
>

Other related posts: