Optimize oracle database on linux server

Optimize oracle database on linux server

Optimizing an Oracle database on a Linux server (RHEL / Oracle Linux) is about tuning four layers together: OS β†’ Storage β†’ Oracle instance β†’ SQL workload. If even one layer is misaligned, performance will bottleneck regardless of hardware.

Below is a practical enterprise optimization guide used for production Oracle systems.


1. OS-level optimization (Linux foundation)

πŸ”Ή Kernel tuning (critical)

Configure /etc/sysctl.conf:

Key areas:

  • Shared memory (SGA support)
  • File descriptors
  • Virtual memory behavior
  • Network buffers

πŸ‘‰ Goal: remove OS-level contention before Oracle tuning begins.


πŸ”Ή Disable Transparent HugePages (THP)

THP often causes instability in Oracle workloads.

Best practice:

  • Disable THP
  • Enable HugePages manually

πŸ‘‰ Benefit:

  • Stable SGA memory
  • Lower CPU overhead
  • Reduced latency spikes

πŸ”Ή Enable HugePages

HugePages is essential for performance:

  • Prevents memory fragmentation
  • Reduces TLB misses
  • Improves SGA access speed

πŸ‘‰ Rule:

  • Allocate HugePages β‰ˆ total SGA size

πŸ”Ή File descriptor limits

Increase:

  • fs.file-max
  • ulimit -n

πŸ‘‰ Prevents β€œtoo many open files” under heavy load.


πŸ”Ή CPU and NUMA tuning

Modern Linux servers are NUMA-based.

Best practices:

  • Align Oracle instance with NUMA nodes
  • Avoid cross-node memory access
  • Use CPU affinity if needed

2. Storage optimization (very high impact)

πŸ”Ή Use fast storage

  • NVMe SSD (best)
  • High-performance SAN (second option)

πŸ”Ή Separate I/O workloads

Split physically or logically:

  • Datafiles
  • Redo logs
  • Temp files
  • FRA (Flash Recovery Area)

πŸ‘‰ This reduces I/O contention dramatically.


πŸ”Ή I/O scheduler tuning

For SSD/NVMe:

  • Use none or mq-deadline

πŸ‘‰ Avoid legacy CFQ scheduler.


πŸ”Ή ASM (recommended)

Using Oracle ASM improves:

  • Striping
  • I/O balancing
  • Fault tolerance

3. Oracle instance tuning

πŸ”Ή Memory tuning (SGA & PGA)

SGA (cache performance)

  • Buffers data in memory
  • Critical for OLTP performance

PGA (processing performance)

  • Sorts, joins, aggregations

πŸ‘‰ Rule:

  • OLTP β†’ higher SGA ratio
  • Analytics β†’ higher PGA ratio

πŸ”Ή Automatic Memory Management (AMM)

Use carefully:

  • Good for small/medium systems
  • Not ideal for large enterprise workloads

πŸ”Ή Parallel execution tuning

Control:

  • parallel_degree_policy
  • CPU utilization limits

πŸ‘‰ Misuse leads to CPU saturation.


πŸ”Ή Cursor and cache tuning

  • Increase open_cursors
  • Optimize buffer cache hit ratio
  • Reduce hard parses

4. SQL-level optimization (biggest ROI area)

πŸ”Ή Identify top SQLs

Use:

  • AWR reports
  • ASH analysis

πŸ”Ή Fix execution plans

Common fixes:

  • Add missing indexes
  • Remove full table scans
  • Use partition pruning
  • Update statistics

πŸ”Ή Statistics management

  • Keep optimizer stats updated
  • Avoid stale statistics

πŸ‘‰ Bad stats = bad execution plans


πŸ”Ή Reduce expensive operations

Avoid:

  • Unnecessary joins
  • Large sorts without indexes
  • Cartesian joins

5. I/O and redo optimization

πŸ”Ή Redo log tuning

  • Increase redo log size
  • Reduce frequent log switches

πŸ‘‰ Benefit: fewer I/O spikes


πŸ”Ή Archive log optimization

  • Ensure fast storage for archive destination
  • Avoid contention with datafiles

πŸ”Ή Temp tablespace tuning

  • Move to faster storage
  • Increase size for heavy sorting queries

6. Network optimization (for distributed systems)

  • Increase TCP buffer sizes
  • Enable jumbo frames (if supported)
  • Optimize latency for RAC / Data Guard setups

7. Monitoring & diagnostics

Essential tools:

  • AWR (Automatic Workload Repository)
  • ASH (Active Session History)
  • ADDM (Advisor recommendations)

Key metrics to track:

  • CPU usage vs wait events
  • I/O latency
  • Buffer cache hit ratio
  • Top SQL response time
  • PGA usage

8. Common performance bottlenecks

πŸ”΄ CPU bottleneck

  • Too much parallel execution
  • Poor SQL design

πŸ”΄ Memory bottleneck

  • No HugePages
  • PGA spills to temp

πŸ”΄ I/O bottleneck

  • Redo log contention
  • Shared storage overload

πŸ”΄ SQL bottleneck

  • Missing indexes
  • Inefficient execution plans

9. Enterprise optimization strategy (step-by-step)

βœ” Step 1: Baseline

  • Capture AWR during peak load

βœ” Step 2: OS tuning

  • Kernel, HugePages, CPU alignment

βœ” Step 3: Storage tuning

  • ASM + separation of workloads

βœ” Step 4: Database tuning

  • SGA/PGA optimization
  • SQL tuning

βœ” Step 5: Continuous monitoring

  • AWR trending
  • OEM / Grafana dashboards

10. Best practices summary

βœ” Enable HugePages
βœ” Disable THP
βœ” Use ASM for storage
βœ” Separate redo/data/temp I/O
βœ” Tune SGA and PGA properly
βœ” Optimize top SQL first
βœ” Avoid excessive parallelism
βœ” Keep statistics updated
βœ” Monitor continuously using AWR


Final takeaway

Oracle performance optimization on Linux is not a single tuning stepβ€”it is a layered optimization process across OS, storage, memory, and SQL execution plans.

Most real-world performance gains come from:

  • SQL tuning (biggest impact)
  • Storage separation
  • Memory (HugePages + SGA/PGA tuning)
Looking for servers Rental ?

Call Our Expert :


  • (call for rental enquiries)

Email us :