What is an Oracle Instance? Structure, Startup, Shutdown – Explained with Diagrams

Bronze_en

When working with Oracle, understanding the concept of an instance is fundamental.
This article provides a complete explanation of what an Oracle instance is, how it works, and how it is structured — all in a beginner-friendly and visual format.


🔰 What Is an Oracle Instance?

An Oracle instance refers to a memory-based execution environment consisting of:

  • SGA (System Global Area)
  • Background processes

An instance must be started in order to access the database files.

┌────────────────┐
│ Oracle Instance │
│ (in-memory runtime) │
├────────────────┤
│ ① SGA (shared memory) │
│ ② Background processes │
└────────────────┘


┌────────────────────────────┐
│ Oracle Database (physical files) │
└────────────────────────────┘

💡 Difference Between Instance and Database

ConceptDescription
InstanceThe in-memory execution environment (SGA + processes)
DatabaseThe collection of physical files (.dbf, .ctl, .log, etc.)

🧠 Main Components of an Instance

🔸 SGA (System Global Area)

  • Shared Pool: Stores parsed SQLs, PL/SQL, and dictionary caches
  • Database Buffer Cache: Stores data blocks read from disk
  • Redo Log Buffer: Temporarily holds transaction changes before writing to log files

🔸 Background Processes (Main)

ProcessRole
DBWnWrites buffer cache to disk
LGWRWrites Redo Log Buffer contents to redo log files
CKPTPerforms checkpoint operations
SMON/PMONHandles recovery and process monitoring

🚀 Oracle Instance Startup Phases

The STARTUP command initiates the following startup sequence:

┌────────────┐
│ STARTUP │
└─────┬──────┘

┌────────────┐ ① SGA allocation + read init. param file
│ NOMOUNT │
└─────┬──────┘

┌────────────┐ ② Reads control file
│ MOUNT │
└─────┬──────┘

┌────────────┐ ③ Opens DB files (ready for user access)
│ OPEN │
└────────────┘

🛑 Shutdown Methods and Key Differences

Oracle provides several shutdown options, each with distinct behaviors.

ModeCheckpointTransaction HandlingForcefulNotes
NORMAL✅ Yes✅ Waits for disconnectsWaits for all users to disconnect
IMMEDIATE✅ Yes✅ Rolls backFast, clean shutdown
TRANSACTIONAL✅ Yes✅ Waits for commitsWaits for active transactions to complete
ABORT❌ No❌ Terminates immediatelyForce shutdown – requires instance recovery

Checkpoints are performed in all modes except ABORT.
Use SHUTDOWN ABORT only in emergencies, as it skips checkpointing and may cause inconsistency until the next startup recovery.


🧩 Instance Structure: Single vs RAC

Single Instance:

One instance → One database

RAC (Real Application Clusters):

Multiple instances (each with SGA & processes) → One shared database

RAC offers high availability and load balancing capabilities.


✅ Summary

TopicDescription
Oracle InstanceIn-memory runtime environment of SGA + background processes
Startup PhasesNOMOUNT → MOUNT → OPEN
Shutdown ModesAll except ABORT ensure safe shutdown with checkpoints
Instance vs DatabaseInstance = Memory-level; Database = Disk-level; both are required
RAC SupportMultiple instances can simultaneously access a shared database (RAC setup)


[reference]
5 Managing the Oracle Instance

コメント

Copied title and URL