Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

dba_extents slow workaround

955 views
Skip to first unread message

HansP

unread,
Apr 29, 2009, 3:49:55 AM4/29/09
to
On some large 10.2.0... databases dba_extents can be very slow.

Like

select *
from
dba_extents where file_id = 87 and 253384 between block_id and
block_id +
blocks - 1

call count cpu elapsed disk query
current rows
------- ------ -------- ---------- ---------- ---------- ----------
----------
Parse 2 0.80 0.79 0 0
0 0
Execute 2 0.01 0.00 0 0
0 0
Fetch 4 506.72 9529.81 1058790 22323409
639 2
------- ------ -------- ---------- ---------- ---------- ----------
----------
total 8 507.53 9530.61 1058790 22323409
639 2

So 2.6 hours elapsed time.

Metalink gives 2 workarounds with bug 5259025:
1.DBMS_STATS.GATHER_TABLE_STATS ('SYS', 'X$KTFBUE')
2.DBMS_STATS.SET_TABLE_STATS ('SYS', 'X$KTFBUE', NUMROWS => 100000,
NUMBLOCKS => 10000)

#1 did not work for me since it gave an error ORA-01422
#2 did not work either for me.

What works for me is:
1. create table <someuser>.ktfbue as select * from x$ktfbue;
2. gather stats on table created in step 1.
3. export the statistics of table created in step 1 to a stats table
exec dbms_stats.EXPORT_TABLE_STATS
('SOMEUSER,'KTFBUE',null,'STATS','KTF',true,'SOMEUSER')
3. update the data in the stats table so that the
update stats set C1='X$KTFBUE', c5='SYS' where STATID='KTF';
4. import the statistics in the stats table
exec dbms_stats.IMPORT_TABLE_STATS('SYS','X
$KTFBUE',null,'STATS','KTF',TRUE,'SOMEUSER',FALSE);

Michael Austin

unread,
Apr 29, 2009, 8:06:15 PM4/29/09
to


Are you using DMT or LMT?
ASM? Raw? Cooked?

ddf

unread,
Apr 30, 2009, 8:22:29 AM4/30/09
to

Mladen Gogala

unread,
May 1, 2009, 7:11:39 AM5/1/09
to
On Wed, 29 Apr 2009 19:06:15 -0500, Michael Austin wrote:


> Are you using DMT or LMT?
> ASM? Raw? Cooked?

Probably not DMT in 10.2.

--
http://mgogala.freehostia.com

Mladen Gogala

unread,
May 1, 2009, 7:19:47 AM5/1/09
to

Hans, thanks for bringing this up. This is precious, because the
"Fixed in Product Version" information for the bug 7430745, related
to bug 5259025 says "11.2". When will the version 11.2 be out, anybody?

--
http://mgogala.freehostia.com

johnb...@sbcglobal.net

unread,
May 1, 2009, 11:30:28 AM5/1/09
to
On May 1, 7:19 am, Mladen Gogala <mla...@bogus.email.com> wrote:

snip

> Hans, thanks for bringing this up. This is precious, because the
> "Fixed in Product Version" information for the bug 7430745, related
> to bug 5259025 says "11.2". When will the version 11.2 be out, anybody?

OOW 2009 or just before ... is the rumour.

Michael Austin

unread,
May 1, 2009, 11:40:04 AM5/1/09
to
Mladen Gogala wrote:
> On Wed, 29 Apr 2009 19:06:15 -0500, Michael Austin wrote:
>
>
>> Are you using DMT or LMT?
>> ASM? Raw? Cooked?
>
> Probably not DMT in 10.2.
>
Ya never know... I had systems at my previous gig that were upgraded
from 8i->9i->10.2.0.4 and was still using DMT even though I all but beat
them up to get it updated.

>
>

HansPeter

unread,
May 4, 2009, 3:57:34 AM5/4/09
to
> - Tekst uit oorspronkelijk bericht niet weergeven -
>
> - Tekst uit oorspronkelijk bericht weergeven -

All tablespaces are locally managed on ASM.

Michael Austin

unread,
May 4, 2009, 5:39:04 PM5/4/09
to


This is the real question I should have asked... what problem are you
really trying to solve because while LMT uses an "extent" term, its
definition and usage is very different from that of the traditional
Oracle definition. The way the Area BitMap and SPAceManagement pages
work, worrying about extent coalescing is a moot point. Which is one
reason why some of those traditional tablespace qualifiers are ignored.

HansPeter

unread,
May 5, 2009, 8:51:18 AM5/5/09
to
> reason why some of those traditional tablespace qualifiers are ignored.- Tekst uit oorspronkelijk bericht niet weergeven -

>
> - Tekst uit oorspronkelijk bericht weergeven -

Well, have you never had to query dba_extents to see in what extent
and what segment a corrupted block belong?
I had to do a block dump to get the object id and then search
dba_objects.
But it is much easier to see how the extents are allocated using
dba_extents.

Michael Austin

unread,
May 5, 2009, 5:43:29 PM5/5/09
to


Not sure why you would really need to do this... unless you are trying
to restore an entire file. I prefer to just get the block from corrupt
blocks, feed it into RMAN and let it restore just the corrupt block. It
will then perform a recovery to ensure that block had not been updated
since last backup. This feature is one of the reasons why coalescing
extents is no longer necessary and could potentially screw your backup
methods. ie if the blocks were coalesced and moved, they are no longer
the same blocks - and redo does not cache this sort of ddl.

0 new messages