Datafile HWM without querying dba_extents

  • From: "Deepak Sharma" <dmarc-noreply@xxxxxxxxxxxxx> (Redacted sender "sharmakdeep_oracle@xxxxxxxxx" for DMARC)
  • To: "oracle-l@xxxxxxxxxxxxx" <oracle-l@xxxxxxxxxxxxx>
  • Date: Sat, 31 Jan 2015 05:57:38 +0000 (UTC)

In order to resize a datafile to release space at the end, we need to find 
whatever the last block_id that is at the start of that free contiguous space. 

Problem is that we have a very large database such that querying dba_extents to 
find the last block is probably not an option. The standard query(ies) that 
make use of dba_extents runs for hours at stretch and also  sometimes fails 
with a 'snapshot too old' (just gives up).
Is there an alternative to using dba_extents?
For example, if the datafile size is 100mb and the last 10mb is vacant, I want 
to know the block_id of where that 10mb begins.

Other related posts: