Starting and Shutting Down a Database

Including shutdown, Oracle database has 4 states

Including shutdown, Oracle database has 4 states:

 

Shutdown —->NoMount

Starting and shutting down a database

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

Starting and shutting down a database

• 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

 

Starting and shutting down a database

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.

Starts the database in nomount mode.

Starts the database in mount mode.

Opens the database, after which users can access it.

Oracle starts the database using the initialization parameters in initORCL.ora located in the dbs folder.

The following command displays the initial parameters that the database was opened with.

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.

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