Side Effect Of Optimizer_capture_sql_plan_baselines

I got the report that a test DB cannot be logined. The error message indicates that sysaux is full. The tablespace sysaux have 4G, while the top one LOBSEGMENT SYS_LOB0000164261C00005 consumes 1.8G. The system-generated names for lob segment default to the format:

SYS_LOB {10 digit object_id} C {5 digit col#} $$
Continue reading

Small Tables

Jonathan Lewis Write a section about the Oracle’s behavior for tablescan and index fast full scan, in his new book “Oracle Core”.

Why does Oracle need to take care the tablescan seriously?

If you scan a large object, you could flush a huge amount of useful data from the cache,data that you may then have to reread very promptly. Tablescans shouldnt really happen often in OLTP systems, and when they do happen, you need to ensure that they dont cause problems. The potential for performance problems relating to tablescans resulted in Oracle Corp. writing code to distinguish between “short and “long tables (and, recently, “medium tables, although there are no statistics collected to record that particular option).

Continue reading

Latch Level

Cuihua pointed out that there is a mistake in a latch level description in Janathan Lewis’s new book “Oracle Core”. Here is his blog. In page 116 of the section “Loading a Hash Chain” in Chapter 5.

SQL> select     name, level#
  2  from       v$latch
  3  where      name in ('cache buffers lru chain','cache buffers chains')
  4  /

NAME                               LEVEL#
-------------------------------    ------
cache buffers lru chain                 2
cache buffers chains                    1

2 rows selected.

The cache buffers chains latch has a lower level than the cache buffers lru chain latch, so we can’t request the cache buffers lru chain latch in willing-to-wait mode if we’re already holding the cache buffers chains latch. Think about what this means: we’re holding the cache buffers chains latch (which I will call the hash latch for the rest of this subsection) because we’ve just searched the hash chain for a buffer and discovered that, for whatever reason, we need to add another buffer to the chain. So we have to acquire the cache buffers lru chain latch (which I will call the lru latch for the rest of this subsection) to move a buffer from the REPL_AUX list to the midpoint of the REPL_MAIN list; but we can’t request it in willing-to-wait mode because we’re already holding a lower-level latch.


But if you can’t get the lru latch with an immediate get, you have to drop the hash latch, get the lru latch, and then get the hash latch again.

Continue reading

2011关于Oracle的书单

Oracle Core Essential Internals for DBAs and Developers – Jonathan Lewis
很可能是未来十年,关于Oracle内部机制最好的书籍. 书评见这里
Continue reading

[Oracle Core Essential Internals for DBAs and Developers] 未来十年,最好的书

去年大概8月份的时候, 我看完了Cost-Based Oracle Fundamentals,在SQL Tuning方面,我是藉由这书入门的,一本经典好书可以帮助提升在某一方面的层次。之后我想找Jonathan Lewis的一本更旧十年前的书看 – Practical Oracle8i™: Building Efficient Databases,当时还在豆瓣上找看过这本书的朋友,看看能不能把书借给我看或者卖给我。
Continue reading