Oracle DB Startup Steps on Linux

ADVERTISEMENT

Starting an Oracle database manually requires a good understanding of your Oracle environment. You need at least two essential details:

  • Oracle Home (ORACLE_HOME)
  • Oracle SID (ORACLE_SID)

In this guide, we’ll walk through various methods to start an Oracle database on Linux, covering different startup states and how to switch between them. Though we focus on Linux, the SQL commands remain the same on Windows.

🔄 Oracle Database Instance Lifecycle

An Oracle instance transitions through the following four states:

StateDescription
IDLENo instance or processes are running.
NOMOUNTOracle instance is started with memory and background processes.
MOUNTControl files are read, database structure is recognized but not open.
OPENDatabase is open and accessible for user operations.

You typically start from IDLE and move to the required state.

📘 Required Files by Startup State

Startup StateRequired Files
NOMOUNTParameter File (SPFILE or PFILE)
MOUNTControl Files
OPENData Files + Redo Log Files

Note: Temporary data files are not required at startup — Oracle recreates them if missing.

🧭 Section A: Starting Oracle to NOMOUNT

In NOMOUNT, Oracle only requires a parameter file to allocate memory and start background processes.

✅ Environment Variables

Ensure these are set:

$ echo $ORACLE_HOME
/u01/app/oracle/product/19.0.0/dbhome_1

$ echo $ORACLE_SID
ORCL

🚀 Commands

1. Start with default SPFILE

SQL> startup nomount;

2. Start with specific PFILE

SQL> startup nomount pfile='/tmp/initORCL.ora';

3. Force start (useful when SPFILE is missing, done via RMAN)

RMAN> startup force nomount;
-- or
RMAN> startup nomount force;

🔍 Check status

SQL> select instance_name, status from v$instance;

🧭 Section B: Mounting the Oracle Database

In MOUNT state, Oracle uses control files to locate data and redo logs but doesn’t open the files.

1. From IDLE to MOUNT

SQL> startup mount;

2. Using PFILE explicitly

SQL> startup mount pfile='/tmp/initORCL.ora';

3. From NOMOUNT to MOUNT

SQL> alter database mount;

🔍 Verify

SQL> select instance_name, status from v$instance;
SQL> select name, open_mode from v$database;

⚠ For RAC databases, ALTER DATABASE MOUNT affects only the current instance.

🧭 Section C: Opening the Oracle Database

Opening means full access — users can read/write depending on mode.

✅ Modes of OPEN

  • READ WRITE (default)
  • READ ONLY
  • RESTRICTED SESSION
  • RESETLOGS

1. From IDLE to OPEN

All below are equivalent:

SQL> startup;
SQL> startup open;
SQL> startup open read write;

Check status

SQL> select name, open_mode from v$database;

If database is a standby, it opens in READ ONLY by default.

2. Open in RESTRICTED mode

SQL> startup restrict;
-- To disable later:
SQL> alter system disable restricted session;
-- To re-enable:
SQL> alter system enable restricted session;

3. Open in READ ONLY mode

SQL> startup open read only;

To confirm:

SQL> select name, open_mode from v$database;

4. From MOUNT to OPEN

SQL> alter database open;

To force resetlogs after recovery:

SQL> alter database open resetlogs;

To open in READ ONLY from MOUNT:

SQL> alter database open read only;

❗ You can’t switch directly between READ ONLY and READ WRITE. You must restart the database.

🧭 Section D: Startup with Scripts

Using dbstart for Batch or Automated Startup

Oracle provides the dbstart utility to start databases automatically, which is especially useful during server reboots or for scripted automation.

Typical steps:

  1. Edit oratab using vi /etc/oratab
    Locate your database entry and change the last field to Y to enable auto-start.
    Example: ORCL:/u01/app/oracle/product/19.0.0/dbhome_1:Y
  2. Run the dbstart command: $ $ORACLE_HOME/bin/dbstart $ORACLE_HOME
  3. (Optional)Automate with system startup:
    • Add the dbstart command to system startup scripts like /etc/rc.local (for older Linux versions) or create a custom systemd service on modern systems.
    • Alternatively, set up a cron job with @reboot.

🧱 Working with Pluggable Databases (PDBs)

Since Oracle 12c, databases can use Multitenant Architecture. You have:

  • CDB – Container Database (main host)
  • PDB – Pluggable Databases (guests)

PDBs are in MOUNT state by default. You can open them individually:

SQL> alter pluggable database all open;
-- or specific one
SQL> alter pluggable database pdb_name open;

To persist this behavior after restart:

SQL> alter pluggable database pdb_name save state;

🧩 Summary

TransitionCommand Example
IDLE → NOMOUNTstartup nomount;
NOMOUNT → MOUNTalter database mount;
MOUNT → OPENalter database open;
OPEN (Restricted)startup restrict;
OPEN (Read Only)startup open read only;
OPEN (Resetlogs)alter database open resetlogs;

✅ Final Notes

  • Always ensure environment variables are set.
  • Prefer SPFILE over PFILE for consistency.
  • Use dbstart for automating startup.
  • Handle RAC and PDBs with extra care — they have unique behaviors.

ADVERTISEMENT

Leave a Reply

Your email address will not be published. Required fields are marked *