{"id":2612,"date":"2019-03-12T13:10:55","date_gmt":"2019-03-12T10:10:55","guid":{"rendered":"https:\/\/sysdba.org\/?p=2612"},"modified":"2025-07-02T06:01:07","modified_gmt":"2025-07-02T06:01:07","slug":"starting-and-shutting-down-a-database","status":"publish","type":"post","link":"https:\/\/sysdba.org\/en\/starting-and-shutting-down-a-database\/","title":{"rendered":"Starting and Shutting Down a Database"},"content":{"rendered":"<p><span style=\"font-size: 14.3999996185303px; line-height: 18.7199993133545px;\">Including shutdown, Oracle database has 4 states:<\/span><\/p>\n<p>&nbsp;<\/p>\n<h3>Shutdown &#8212;-&gt;NoMount<\/h3>\n<p><a href=\"\/wp-content\/old_uploads\/Nomount.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-5973 size-full\" src=\"\/wp-content\/old_uploads\/Nomount.png\" alt=\"Starting and shutting down a database\" width=\"441\" height=\"278\" \/><\/a><\/p>\n<p>The initial parameters in the $ORACLE_HOME\/dbs folder are read in the following order.<\/p>\n<p>\u2013 First spfileSID_Name.ora is read, if it cannot be found<\/p>\n<p>\u2013 initSID_Name.ora is read.<\/p>\n<p>&nbsp;<\/p>\n<p>Using STARTUP command parameters a database can start with the specified initial files instead of the default method.<\/p>\n<ul style=\"list-style-type: disc;\">\n<li>The amount of RAM specified in the SGA gets allocated.<\/li>\n<li>Background processes are started.<\/li>\n<li>alertSID.log and trace files are opened.<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p>NoMount is used when a database and controlfile are created.<\/p>\n<p>&nbsp;<\/p>\n<h3>NoMount &#8212;-&gt;NoMount<\/h3>\n<p><a href=\"\/wp-content\/old_uploads\/Mount.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-5975 size-full\" src=\"\/wp-content\/old_uploads\/Mount.png\" alt=\"Starting and shutting down a database\" width=\"470\" height=\"289\" \/><\/a><\/p>\n<p>\u2022 An initialization file specifies the startup control files.<\/p>\n<p>\u2022 The control file lists tablespace information, datafile paths and accesses them but doesn&#8217;t control them.<\/p>\n<p>\u2022 Oracle reads the datafile and redo log names from control files.<\/p>\n<p>\u2022 Recovering a database from a full backup, changing the locations and names of datafiles is similar to putting a database in archive mode.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h3>Mount &#8212;-&gt;Open<\/h3>\n<p>&nbsp;<\/p>\n<p><a href=\"\/wp-content\/old_uploads\/open.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-5977 size-full\" src=\"\/wp-content\/old_uploads\/open.png\" alt=\"Starting and shutting down a database\" width=\"481\" height=\"312\" \/><\/a><\/p>\n<p>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.<\/p>\n<p>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&#8217;t switch to Open mode.<\/p>\n<p>&nbsp;<\/p>\n<p>The following code starts the database.<br \/>\n[crayon] startup ;[\/crayon]<\/p>\n<p>Starts the database in nomount mode.<br \/>\n[crayon] startup nomount ;[\/crayon]<\/p>\n<p>Starts the database in mount mode.<br \/>\n[crayon] alter database mount ;[\/crayon]<\/p>\n<p>Opens the database, after which users can access it.<br \/>\n[crayon] alter database open;[\/crayon]<\/p>\n<p>Oracle starts the database using the initialization parameters in initORCL.ora located in the dbs folder.<br \/>\n[crayon] STARTUP PFILE=$ORACLE_HOME\/dbs\/initORCL.ora<\/p>\n<p>[\/crayon]<br \/>\n<span style=\"font-size: 14.3999996185303px; line-height: 18.7199993133545px;\">The following command displays the initial parameters that the database was opened with.<\/span><br \/>\n[crayon] show parameter spfile;[\/crayon]<br \/>\nIf the output is the same as below, i.e. if there is data in the &#8220;VALUE&#8221; column it means that the database has been started using an spfile.<\/p>\n<table style=\"height: 65px; width: 570px;\">\n<tbody>\n<tr>\n<td><span style=\"font-size: 12pt;\">NAME <\/span><\/td>\n<td><span style=\"font-size: 12pt;\">TYPE <\/span><\/td>\n<td><span style=\"font-size: 12pt;\">VALUE <\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-family: Arial, Helvetica, sans-serif; font-size: 12pt; line-height: 18.7199993133545px;\">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/span><\/td>\n<td><span style=\"font-family: Arial, Helvetica, sans-serif; font-size: 12pt; line-height: 18.7199993133545px;\">&#8212;&#8212;&#8212;&#8211;<\/span><\/td>\n<td><span style=\"font-family: Arial, Helvetica, sans-serif; font-size: 12pt; line-height: 18.7199993133545px;\">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-family: Arial, Helvetica, sans-serif; font-size: 12pt; line-height: 18.7199993133545px;\">spfile<\/span><\/td>\n<td><span style=\"font-family: Arial, Helvetica, sans-serif; font-size: 12pt; line-height: 18.7199993133545px;\">string<\/span><\/td>\n<td><span style=\"font-family: Arial, Helvetica, sans-serif; font-size: 12pt; line-height: 18.7199993133545px;\">\/u01\/app\/oracle\/product\/10.2.0<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p>An example of this is shown in the instance below.<br \/>\n[crayon] startup pfile=\/u01\/app\/oracle\/product\/10.2.0\/db_1\/dbs\/initorcl.ora<\/p>\n<p>[\/crayon]<br \/>\nThe instance was started with the code shown above, due to which the output doesn&#8217;t have any data in the value column.<\/p>\n<p><em>\u00a0show parameter spfile<\/em><\/p>\n<table>\n<tbody>\n<tr>\n<td><span style=\"font-size: 12pt;\">NAME <\/span><\/td>\n<td><span style=\"font-size: 12pt;\">TYPE <\/span><\/td>\n<td><span style=\"font-size: 12pt;\">VALUE <\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-family: Arial, Helvetica, sans-serif; font-size: 12pt; line-height: 18.7199993133545px;\">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/span><\/td>\n<td><span style=\"font-family: Arial, Helvetica, sans-serif; font-size: 12pt; line-height: 18.7199993133545px;\">&#8212;&#8212;&#8212;&#8211;<\/span><\/td>\n<td><span style=\"font-family: Arial, Helvetica, sans-serif; font-size: 12pt; line-height: 18.7199993133545px;\">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-size: 12pt;\">spfile <\/span><\/td>\n<td><span style=\"font-size: 12pt;\">string <\/span><\/td>\n<td><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n","protected":false},"excerpt":{"rendered":"<p>Including shutdown, Oracle database has 4 states<\/p>\n","protected":false},"author":1,"featured_media":3424,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[383,338],"tags":[345],"class_list":["post-2612","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dba_i","category-oracle-tr","tag-oracle"],"_links":{"self":[{"href":"https:\/\/sysdba.org\/en\/wp-json\/wp\/v2\/posts\/2612","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sysdba.org\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sysdba.org\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sysdba.org\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sysdba.org\/en\/wp-json\/wp\/v2\/comments?post=2612"}],"version-history":[{"count":1,"href":"https:\/\/sysdba.org\/en\/wp-json\/wp\/v2\/posts\/2612\/revisions"}],"predecessor-version":[{"id":4821,"href":"https:\/\/sysdba.org\/en\/wp-json\/wp\/v2\/posts\/2612\/revisions\/4821"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/sysdba.org\/en\/wp-json\/"}],"wp:attachment":[{"href":"https:\/\/sysdba.org\/en\/wp-json\/wp\/v2\/media?parent=2612"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sysdba.org\/en\/wp-json\/wp\/v2\/categories?post=2612"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sysdba.org\/en\/wp-json\/wp\/v2\/tags?post=2612"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}