The document provides an overview of performance tuning for Oracle databases. It discusses tuning goals such as accessing the least number of blocks and caching blocks in memory. It outlines the tuning process which includes tuning the design, application, memory, I/O, contention and operating system. Common performance issues for OLTP systems like I/O bottlenecks are also covered. Various tools for identifying performance problems are listed.
28. Memory Architecture
From a memory management perspective, the entire physical memory is divided into "frames"
and the virtual memory is divided into "pages". The memory management unit performs a
translation of virtual memory address to physical memory address. The information regarding
which virtual memory page maps to which physical frame is kept in a data structure called the
"Page Table".
Page table lookups are costly. In order to avoid performance hits due to this lookup, a fast
lookup cache called Translation Lookaside Buffer(TLB) is maintained by most architectures.
So any virtual memory address which requires translation to the physical memory address is
first compared with the translation lookaside buffer for a valid mapping. When a valid address
translation is not present in the TLB, it is called a "TLB miss". If a TLB miss occurs, the memory
management unit will have to refer to the page tables to get the translation. This brings
additional performance costs, hence it is important that we try to reduce the TLB misses.
29. What is HugePages
Linux Kernel allocates physical memory in unit called pages, the default size of the page
is 4KB. Kernel manages allocation of Pages in PageTable, HugePages allows larger page
size, the default HugePage size is 2048KB. The larger page size results in performance
benefits as system deals with less number of pages, as the PageTable is smaller.
35. Huge Pages
Advantages of HugePages
HugePages are not swappable, in other words
they are always pinned, so no swapping overhead.
HugePages can be allocated on-the-fly but must be
reserved first by setting the kernel parameters
HugePages are reserved at system startup
AMM (Automatic Memory Management) and HugePages
are not compatible, AMM should be disabled so that
Database can utilize HugePages. 11gR2 logs
HugePages information in alert.log.
38. What happens when a SQL statement is issued?
User
Library Cache
Shared SQL Area
Shared Pool
CnC1 C2 …
3
Optimizer
Oracle Database
Code Generator
1
Syntax Check
Semantic Check
Shared Pool check
2
Parsing
4
SQL Execution