| Lesson 12 | Limiting the number of dirty buffers |
| Objective | How to limit the number of dirty buffers |
Dirty buffers are cached blocks whose contents differ from what’s on disk. Limiting how many dirty buffers can accumulate helps bound crash-recovery time and keeps the buffer cache healthy. In modern Oracle (11g+), you control this primarily with an MTTR policy rather than a hard cap parameter.
DB_BLOCK_MAX_DIRTY_TARGET?DB_BLOCK_MAX_DIRTY_TARGET is a legacy concept from pre-MTTR-policy tuning. In current releases, rely on
MTTR targeting; do not set legacy or hidden parameters unless directed by Oracle Support for your exact version and case.
DB_WRITER_PROCESSES) only if you observe sustained dirty-buffer pressure and your storage can benefit.-- Set an MTTR policy (example only; choose a value that fits your RTO)
ALTER SYSTEM SET fast_start_mttr_target = 120 SCOPE=BOTH;
-- Force a one-time checkpoint (rarely needed; let MTTR policy drive it)
ALTER SYSTEM CHECKPOINT;
-- Multiple DB writers (only when proven useful)
ALTER SYSTEM SET db_writer_processes = 4 SCOPE=SPFILE;
-- (Bounce required; validate storage can handle the extra write concurrency.)
-- MTTR target and current estimate
SHOW PARAMETER fast_start_mttr_target;
SELECT estimated_mttr FROM v$instance_recovery;
-- Checkpoint / write activity since startup
SELECT name, value
FROM v$sysstat
WHERE name IN ('background checkpoints completed',
'DBWR checkpoints', 'physical writes');
-- Log switch cadence (to spot thrash or oversizing)
SELECT sequence#, first_time, next_time
FROM v$log_history
ORDER BY first_time DESC
FETCH FIRST 20 ROWS ONLY;
More aggressive checkpointing reduces recovery time but increases background write I/O. Use workload evidence to pick a balanced MTTR. If runtime stalls appear (e.g., free buffer waits), confirm storage latency/throughput, hot segments, and log sizing before adding more writers.