Unix Technical Forum

SEO

vBulletin Search Engine Optimization


Go Back   Unix Technical Forum > Database Server Software > Oracle Database

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-25-2008, 03:23 AM
Ben
 
Posts: n/a
Default how to get correct info on freelists?

running 9.2.0.5 on AIX5 with compatible parameter set to 8.1.7 and
using DMT.
Everything I've read so far was that dbms_stats was the best thing next
to sliced bread. I just read in a manual though that it doesn't update
freelist block information. So what do you do? revert back to analyze
until you can start using LMT? I know that I have a large amount of
blocks on the freelist and I suspect that we have a bad freelist
contention problem with all of our tables set to 1 freelist with 1
group on an system that is a combination oltp with large batch jobs. Is
there a better way to get freelist block information? Is it true that
dbms_stats doesn't gather freelist info?

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-25-2008, 03:23 AM
Jonathan Lewis
 
Posts: n/a
Default Re: how to get correct info on freelists?


For accurate freelist block counts,
you can use the dbms_space package
There is an example of this on my website

http://www.jlcomp.demon.co.uk/freespac.html

However I note that the script was written in 1998,
and the article was last updated in 2001, with references
to "new" types appearing in 8.0. The package may
have been enhanced since then. Note that in the
example there is an explicit limit on any freelist walk
that might take place, and the scripts only addresses
the first freelist group.

If you think you have trouble with freelists, then you
can check v$waitstat for waits for class "segment header"
(if you had multiple freelist groups, you would also
have to check for waits for class "free list")
and then cross check with v$segstat to see
which segments are responsible for most of
them (there is a statistic in v$segstat called
"buffer busy waits" - do not use v$segment_statistics
as it is an expensive way to get the name, owner
and tablespace of the object).


--
Regards

Jonathan Lewis
http://www.oracle.com/technology/com...ce1.html#lewis

The Co-operative Oracle Users' FAQ
http://www.jlcomp.demon.co.uk/faq/ind_faq.html

Cost Based Oracle: Fundamentals
http://www.jlcomp.demon.co.uk/cbo_book/ind_book.html


"Ben" <balvey@comcast.net> wrote in message
news:1143691305.349112.299420@i39g2000cwa.googlegr oups.com...
> running 9.2.0.5 on AIX5 with compatible parameter set to 8.1.7 and
> using DMT.
> Everything I've read so far was that dbms_stats was the best thing next
> to sliced bread. I just read in a manual though that it doesn't update
> freelist block information. So what do you do? revert back to analyze
> until you can start using LMT? I know that I have a large amount of
> blocks on the freelist and I suspect that we have a bad freelist
> contention problem with all of our tables set to 1 freelist with 1
> group on an system that is a combination oltp with large batch jobs. Is
> there a better way to get freelist block information? Is it true that
> dbms_stats doesn't gather freelist info?
>



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-25-2008, 03:24 AM
Ben
 
Posts: n/a
Default Re: how to get correct info on freelists?

Jonathan, Thank you for the information. I have used the dbms_space
package before. I just wondered if there was a way to gather info for
the entire schema all at once instead of table by table.

I do suspect that we have serious performance problems and I think some
of it is due to freelist contention. I checked out the stats tables
that you mention above. Here is what I found from the v$segstat. What
does the value column quantify? milliseconds or number of waits? This
is just the first three, there were over 600 total lines.
TbspName, ObjName, STATISTIC_NAME, VALUE
PRODDTAT, F55PTRQ, buffer busy waits, 10647244
PRODDTAT, F4801, buffer busy waits, 9479677
PRODDTAT, F31122, buffer busy waits, 7851222

also in looking at the v$waitstat this is what I found
CLASS, COUNT, TIME
data block, 42546555, 65329459
undo header, 13182, 35959
undo block, 12464, 11769
extent map, 1675, 2441
segment header, 1646, 3796

definitely some segment header contention there, but quite a lot more
data block. What does that tell me other than I've got some serious
work cut out for me?
Thanks again for the help..

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-25-2008, 03:24 AM
Jonathan Lewis
 
Posts: n/a
Default Re: how to get correct info on freelists?

"Ben" <balvey@comcast.net> wrote in message
news:1143734489.205450.222610@i40g2000cwc.googlegr oups.com...
> Jonathan, Thank you for the information. I have used the dbms_space
> package before. I just wondered if there was a way to gather info for
> the entire schema all at once instead of table by table.
>
> I do suspect that we have serious performance problems and I think some
> of it is due to freelist contention. I checked out the stats tables
> that you mention above. Here is what I found from the v$segstat. What
> does the value column quantify? milliseconds or number of waits? This
> is just the first three, there were over 600 total lines.
> TbspName, ObjName, STATISTIC_NAME, VALUE
> PRODDTAT, F55PTRQ, buffer busy waits, 10647244
> PRODDTAT, F4801, buffer busy waits, 9479677
> PRODDTAT, F31122, buffer busy waits, 7851222
>
> also in looking at the v$waitstat this is what I found
> CLASS, COUNT, TIME
> data block, 42546555, 65329459
> undo header, 13182, 35959
> undo block, 12464, 11769
> extent map, 1675, 2441
> segment header, 1646, 3796
>
> definitely some segment header contention there, but quite a lot more
> data block. What does that tell me other than I've got some serious
> work cut out for me?
> Thanks again for the help..
>



The figures may well be confirming your
suspicion that you have a contention problem
due to having one freelist per object for some
very busy objects.

The counts you see in v$segstat are number of
waits for each segment. Technically you ought
to spend a little time checking that the specific
reason for the wait (p3 in v$session_wait) is
an update collision - but your knowledge of the
application suggests that this is highly probable,
so you might want to address the issue it straight
away.

For each table that is reporting a large fraction
of the waits, anything over 500,000, say, change
the table to multiple freelists, which is easy in
your version of Oracle e.g.
alter table t1 storage (freelists 5)

Before making the change, look for the
most popular SQL statements, and take
a note of their execution paths as you
may find that as time passes, the execution
plans change as a side-effect of the
multiple freelists. This is low probability
in an OLTP system, but one you want to
watch out for.

You may find that increasing the number of
freelists allows data insertion to progress
more rapidly - which MAY lead to contention
appearing in other places - for example in
redo log allocation requests and log buffer
space requests. The problem is that if you
can insert data faster, you generate redo and
undo faster - so you may simply move the
critical point of contention.


Unless you are doing lots of updates that
affect indexes, you probably shouldn't be
seeing the same problem with indexes
apart from indexes which cover sequence-
based primary keys. If you see lots of waits
from those, you may have to rebuild them as
reverse key indexes - but I would postpone
that for the moment as it does have some
side-effects and can take some time to do.


You do have some other contention issues -
for example, the undo segment and undo
block waits might suggest that you need more
undo segments. The segment header and
extent map waits might suggest you have
a problem with tablescans, object growth
and related issues on tables (or indexes)
with lots of very small extents. But at the
moment I'd address the very large time
loss, and worry about the rest later.


Just before you do anything else, though,
take a few statspack snapshots to check
that this lost time (over a fifteen minute period,
say) really accounts for a significant fraction
of your time. Possibly your are burning vast
amounts of CPU doing lots of tablescans and
it is those that are the underlying cause of the
buffer busy waits.



I had jumped the gun slightly with my comment
about "segment header" waits being a symptom of
freelist contention.

The first contention point appears as "data block"
waits when you don't have enough freelists -
(although there are other reasons for "data
block" waits).

The second contention point appears if you
have multiple freelists in the segment header,
but they are still under too much pressure,
demanding a switch to multiple freelist groups.


--
Regards

Jonathan Lewis
http://www.oracle.com/technology/com...ce1.html#lewis

The Co-operative Oracle Users' FAQ
http://www.jlcomp.demon.co.uk/faq/ind_faq.html

Cost Based Oracle: Fundamentals
http://www.jlcomp.demon.co.uk/cbo_book/ind_book.html



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-25-2008, 03:24 AM
Ben
 
Posts: n/a
Default Re: how to get correct info on freelists?

Once again, Jonathan, thank you for the information. I appreciate the
fact that you pointed out that there could be repercussions from adding
the freelists.

After looking at the p3 values in v$session_wait, they are all 0. What
would they be if there was update collision? The majority of the events
are "SQL*Net message from client".

The most popular SQL statement from looking at several statspack
snapshots is a statement that executes every few seconds and monitors
the table that is listed at the top of my v$segstat snippet above,
(F55PTRQ). The script that executes that sql looks for a column to be
of a certain value and updates it to a different value when finding
one. We use it as a label printing queue table, so it probably has over
7000 or so records pass through it per day. By pass through I mean
inserted, updated, and deleted.

As far as the extent map and segment header waits. I could see that
this could be caused by the fact that we do have a LOT of small
extents. The previous dba didn't really do much to keep the extent
sizes uniform. We are using DMT and some the tables (and indexes for
that matter) within the tablespaces have large, 200M, initial and next
extents, and others have 56K extents. So our maps don't really have any
kind of uniformity to them.

With the snapshots, what can I look at to determine if these waits are
a significant fraction of our time? What values should I compare?

Finally, I know that this is such a broad span of things that could be
wrong or could not be wrong. When it comes to tuning, I don't really
have any experience. I am waiting on my copy of Cary Milsap's book on
Tuning, are there any other resources that I should be looking at to
teach myself how to get through these problems?

Thanks,

Ben

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 02-25-2008, 03:24 AM
Jonathan Lewis
 
Posts: n/a
Default Re: how to get correct info on freelists?

"Ben" <balvey@comcast.net> wrote in message
news:1143749901.727869.109820@v46g2000cwv.googlegr oups.com...
> Once again, Jonathan, thank you for the information. I appreciate the
> fact that you pointed out that there could be repercussions from adding
> the freelists.
>
> After looking at the p3 values in v$session_wait, they are all 0. What
> would they be if there was update collision? The majority of the events
> are "SQL*Net message from client".
>
> The most popular SQL statement from looking at several statspack
> snapshots is a statement that executes every few seconds and monitors
> the table that is listed at the top of my v$segstat snippet above,
> (F55PTRQ). The script that executes that sql looks for a column to be
> of a certain value and updates it to a different value when finding
> one. We use it as a label printing queue table, so it probably has over
> 7000 or so records pass through it per day. By pass through I mean
> inserted, updated, and deleted.
>
> As far as the extent map and segment header waits. I could see that
> this could be caused by the fact that we do have a LOT of small
> extents. The previous dba didn't really do much to keep the extent
> sizes uniform. We are using DMT and some the tables (and indexes for
> that matter) within the tablespaces have large, 200M, initial and next
> extents, and others have 56K extents. So our maps don't really have any
> kind of uniformity to them.
>
> With the snapshots, what can I look at to determine if these waits are
> a significant fraction of our time? What values should I compare?
>
> Finally, I know that this is such a broad span of things that could be
> wrong or could not be wrong. When it comes to tuning, I don't really
> have any experience. I am waiting on my copy of Cary Milsap's book on
> Tuning, are there any other resources that I should be looking at to
> teach myself how to get through these problems?
>
> Thanks,
>
> Ben
>




As a quick guide, look at the top five
timed events in the interval. It's not perfect
but it can give you a feel for time that might
be worth reclaiming.

Compare CPU time with the length of the
snapshot times the number of CPUs.

Compare the wait times with each other
to see if there is any wait that is particularly
responsible for lots of lost time.

Note - when I said check the p3 values,
this was intended to be specifically when
you see a wait called "buffer busy waits".
p3 = 130 is one of the commonest one
and means one session is waiting
for another to finish reading from disc,
p3=220 is another common one which
I think is the one you will see if you have
competing processes trying to update the buffer.


For a rapid entry to trouble-shooting, I think the best
book is probably the Richmond Shee et. al. on the
Oracle Wait Interface.

http://www.amazon.com/gp/product/007...lance&n=283155

Apart from that it's always worth reading the
Oracle manuals at http://tahiti.oracle.com .
possibly the Performance Tuning Guide as a
start in your case.


But as a CRITICAL guideline - don't look at
particular statistics as an abstract exercise.
Your numbers of buffer busy waits look bad -
but what was the time interval, and how much time
was spent (for example) waiting for disk reads
in the same interval. Don't look at numbers -
look for jobs which are taking too much time
and causing complaints.


--
Regards

Jonathan Lewis
http://www.oracle.com/technology/com...ce1.html#lewis

The Co-operative Oracle Users' FAQ
http://www.jlcomp.demon.co.uk/faq/ind_faq.html

Cost Based Oracle: Fundamentals
http://www.jlcomp.demon.co.uk/cbo_book/ind_book.html



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 02-25-2008, 03:28 AM
Ben
 
Posts: n/a
Default Re: how to get correct info on freelists?

Jonathan,
I've been running your see_space.sql script and before I run it on my
prod schema, I was wondering how big of an impact it has on the system.
Should I wait until off hours to run it?
Thanks
Ben

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 02-25-2008, 03:37 AM
Jonathan Lewis
 
Posts: n/a
Default Re: how to get correct info on freelists?

"Ben" <balvey@comcast.net> wrote in message
news:1144078276.420335.13990@i39g2000cwa.googlegro ups.com...
> Jonathan,
> I've been running your see_space.sql script and before I run it on my
> prod schema, I was wondering how big of an impact it has on the system.
> Should I wait until off hours to run it?
> Thanks
> Ben
>


I've just run a quick test on 9.2.
The procedure seems to walk the freelist
one block at a time. So if you think you
have lots of objects with very large freelists,
then you might want to wait for a quiet time
when the I/O load is low.

Alternative strategy:
select segment_name, owner, header_file, header_block
from dba_segments;

For each interesting segment

alter system dump datafile {header_file} {header_block};

then look at the trace file, which will have a section like:

Extent Control Header
-----------------------------------------------------------------
Extent Header:: spare1: 0 spare2: 0 #extents: 4 #blocks: 511
last map 0x00000000 #maps: 0 offset: 4128
Highwater:: 0x0240041a ext#: 3 blk#: 17 ext size: 128
#blocks in seg. hdr's freelists: 400
#blocks below: 400
mapblk 0x00000000 offset: 3
Unlocked
Map Header:: next 0x00000000 #extents: 4 obj#: 42458 flag: 0x40000000
Extent Map
-----------------------------------------------------------------

The line you want is:
#blocks in seg. hdr's freelists: 400

The presence of this line is what made me think
that the dbms_space call no longer walked the
list.



--
Regards

Jonathan Lewis
http://www.oracle.com/technology/com...ce1.html#lewis

The Co-operative Oracle Users' FAQ
http://www.jlcomp.demon.co.uk/faq/ind_faq.html

Cost Based Oracle: Fundamentals
http://www.jlcomp.demon.co.uk/cbo_book/ind_book.html




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 02:20 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
UnixAdminTalk.com

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646