Row Migration can Aggravate Contention on Cache Buffer Chains Latch David Kurtz Go-Faster Consultancy Ltd.
Row Migration can Aggravate Contention on Cache Buffer Chains Latch © Who Am I? Oracle Database Specialist –Independent consultant System Performance tuning –PeopleSoft ERP –Oracle RDBMS Book – UKOUG –PeopleSoft Technology SIG Committee
Row Migration can Aggravate Contention on Cache Buffer Chains Latch © Resources If you can’t hear me say so now. Please feel free to ask questions as we go along. The presentation is available from UKOUG Library See also –Tip: Print in ‘black and white’ for white background.
Row Migration can Aggravate Contention on Cache Buffer Chains Latch © Background Reading Blog Entry: – migration-can-aggrivate-contention.htmlhttp://blog.go-faster.co.uk/2008/12/row- migration-can-aggrivate-contention.html –New slides added since presentation to UKOUG DBMS SIG marked with * UKOUG DBMS SIG
Row Migration can Aggravate Contention on Cache Buffer Chains Latch © A War Story Earlier –I showed you how to build a spreadsheet to graph AWR stats Now –I want to show you a example of how it was used in the real world.
Row Migration can Aggravate Contention on Cache Buffer Chains Latch © System Overview Packaged Training Management Application. –From time to time, users would report that the system would ‘grind to a halt’ No access to OEM. But we did have AWR running on a 15 minute snapshot.
Row Migration can Aggravate Contention on Cache Buffer Chains Latch ©
Row Migration can Aggravate Contention on Cache Buffer Chains Latch © System Overview System stable for weeks at a time. User performance complaints corresponded with spikes on Cache Buffer Chains Latch Couldn’t really get a picture of what the users were doing that was different.
Row Migration can Aggravate Contention on Cache Buffer Chains Latch © Logons
Row Migration can Aggravate Contention on Cache Buffer Chains Latch ©
Row Migration can Aggravate Contention on Cache Buffer Chains Latch © Correlation? By eye, I could see that over several days the spikes in the CBCL wait event matched the number of logons. So I graphed one against the other.
Row Migration can Aggravate Contention on Cache Buffer Chains Latch ©
Row Migration can Aggravate Contention on Cache Buffer Chains Latch © Cache Buffer Chains Latch Whenever more than 90 users. Addition 1 sec/sec of wait per additional user. –The system isn’t scaling any more.
Row Migration can Aggravate Contention on Cache Buffer Chains Latch © *Cache Buffer Chains Latch Usually caused by hot blocks. –Migrated rows cause additional block accesses AWR report: table fetch continued row Have to be a lot of this to cause this much trouble –I believe (but I cannot now prove) that when rows migrated out of a block, others were inserted into space left behind. –So data blocks had lots of pointers to migrated rows.
Row Migration can Aggravate Contention on Cache Buffer Chains Latch © Root Cause Row Migration –XML structure in a CLOB –Starts small, gets larger –<3964 bytes stored in-line in data block Need to –Set appropriate value for PCTFREE. –Rebuild tables and indexes.
Row Migration can Aggravate Contention on Cache Buffer Chains Latch © USER_TABLES.CHAIN_CNT Not populated by dbms_stats. –Also USER_TABLES.AVG_FREE_SPACE Must use ANALYZE. –ANALYZE TABLE LIST CHAINED ROWS INTO – and-fixing-row-migration.htmlhttp://blog.go-faster.co.uk/2009/01/detecting- and-fixing-row-migration.html
Row Migration can Aggravate Contention on Cache Buffer Chains Latch © Rebuilding Tables Where tables have history that will not be updated further –Packed the history into the minimum number of blocks ALTER TABLE MOVE … PCTFREE –But new rows in new blocks need space to grow ALTER TABLE … PCTFREE
Row Migration can Aggravate Contention on Cache Buffer Chains Latch ©
Row Migration can Aggravate Contention on Cache Buffer Chains Latch © Result After rebuilding tables, CBCL contention all but disappeared. –And it hasn’t come back. db_file_sequential_read also fell, probably because fewer blocks forced out to load migrated rows. –Possibly because we rebuilt the indexes.
Row Migration can Aggravate Contention on Cache Buffer Chains Latch © Caveat I am NOT asserting that –Row caching always causes latch contention –Latch contention always caused by row caching. However, in our specific case it did appear that fixing one resolved the other. Your mileage may vary.
Row Migration can Aggravate Contention on Cache Buffer Chains Latch © Conclusion It is important to –Understand what your application is doing to the database. –Set physical attributes of tables appropriately.
Row Migration can Aggravate Contention on Cache Buffer Chains Latch © *Explicit Lob Segments We could have defined explicit LOB segments to hold all lob column data –We didn’t try that. –Application usually queried all columns –So would always have accessed addition data blocks. –Our CLOBs mostly small enough to fit in-line.
Questions?