Including shutdown, Oracle database has 4 states:
Shutdown —->NoMount
The initial parameters in the $ORACLE_HOME/dbs folder are read in the following order.
– First spfileSID_Name.ora is read, if it cannot be found
– initSID_Name.ora is read.
Using STARTUP command parameters a database can start with the specified initial files instead of the default method.
- The amount of RAM specified in the SGA gets allocated.
- Background processes are started.
- alertSID.log and trace files are opened.
NoMount is used when a database and controlfile are created.
NoMount —->NoMount
• An initialization file specifies the startup control files.
• The control file lists tablespace information, datafile paths and accesses them but doesn’t control them.
• Oracle reads the datafile and redo log names from control files.
• Recovering a database from a full backup, changing the locations and names of datafiles is similar to putting a database in archive mode.
Mount —->Open
In this database state, Oracle opens the redo logs and data files. Redo Logs and Data Files are checked for consistency. If necessary, a system monitor (smon background processor) starts a recovery procedure.
If there are problems in the datafiles or redo log files while transitioning from Mount mode to Open mode, the DBMS gives an error message and Oracle doesn’t switch to Open mode.
The following code starts the database.
1 |
startup ; |
Starts the database in nomount mode.
1 |
startup nomount ; |
Starts the database in mount mode.
1 |
alter database mount ; |
Opens the database, after which users can access it.
1 |
alter database open; |
Oracle starts the database using the initialization parameters in initORCL.ora located in the dbs folder.
1 |
STARTUP PFILE=$ORACLE_HOME/dbs/initORCL.ora |
The following command displays the initial parameters that the database was opened with.
1 |
show parameter spfile; |
If the output is the same as below, i.e. if there is data in the “VALUE” column it means that the database has been started using an spfile.
NAME | TYPE | VALUE |
———————————— | ———– | —————————— |
spfile | string | /u01/app/oracle/product/10.2.0 |
An example of this is shown in the instance below.
1 |
startup pfile=/u01/app/oracle/product/10.2.0/db_1/dbs/initorcl.ora |
The instance was started with the code shown above, due to which the output doesn’t have any data in the value column.
show parameter spfile
NAME | TYPE | VALUE |
———————————— | ———– | —————————— |
spfile | string |
Installing Oracle 10G...
12 March 2019