Startup and Shutdown modes in Oracle
When Oracle starts an instance, it reads the server parameter file (SPFILE) or initialization parameter file to determine the values of initialization parameters. Then, it allocates an SGA, which is a shared area of memory used for database information, and creates background processes.
NOMOUNT State:
This is the first phase in which the parameter file is read and instance is created based on the value of memory parameters from parameter file (init or spfile).
We can start the database in NOMOUNT state as below.
SQL> startup nomount ;
Action performed in NOMOUNT state:
- Oracle reads spfile or pfile
- Instance gets created (SGA & Background Processes)
- We can create a database
- We can recreate controlfile
When you query v$database for the open_mode, we do not get any answer for nomount state.
MOUNT State:
This is the second phase in which the control file is opened and the existence of all the database files and online redo log files is verified.
We can directly start the database in MOUNT state as below.
SQL> startup mount ;
To mount a database from a started state (nomount state):
Sql> alter database mount;
Action performed in MOUNT state:
- Oracle read control file.
- Verify datafiles and redo files.
- We can enable or disable database archive log mode.
- We can enable flashback database.
When you query v$database for the open_mode, we get the answer as mounted.
OPEN State:
In this stage, the datafiles and the online redo log files are opened and are ready to use. Oracle doesn’t allow you to open the database if any of the datafile or online redo log file is missing or is corrupted. Database completely opens, where end users connect and perform all transactions.
We can open an already mounted database by below command.
Sql> alter database open ;
We can directly go from a shut database to an open database by typing below command.
Sql> startup ;
When you query v$database for the open_mode, we get the answer as read write.