Saturday, January 24, 2015

Starting Up a Database

While starting up a database you create an instance of that database and determine the state of the database. Normally you can start up an instance by mounting and opening the database.


Starting Up a Database Using SQL*Plus

By mounting & opening the database you can make the database available for any valid user to connect to and perform typical data access operations. You can start a SQL*Plus session, connect to the oracle database using the administrator privileges. Then you issue the STARTUP command. When you issue the SQL*Plus STARTUP command, the database aims to read the initialization parameters from an SPFILE in a platform-specific default location. If it doesn't find SPFILE, it will search for text initialization parameter file(SPFILE).


The following table describes and illustrates the various states in which you can start up an instance.

SQL COMMAND Database Behavior
STARTUP  It means normal database operation. By STARTUP command,
an instance is started and the database is mounted and open.
This mode allows any valid user to connect to the database
 and perform data access operations. 
STARTUP MOMOUNT You can start an instance without mounting a database.
Typically you can do so during database creation. 
STARTUP MOUNT You can start an instance and mount a database without opening
it, allowing you to perform specific maintenance operations.  As
for an example, the database must be mounted but not open during
the following activities. They are enabling and disabling redo log
archiving options, performing full database recovery. 
STARTUP RESTRICT  At this stage you can start an instance, and optionally mount and open a database in restricted mode so that the instance is available only to administrative personnel (not general database users. 


How an Instance is Started

When oracle database starts an instance, it reads the server parameter file(SPFILE) or initialization parameter file(PFILE) 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. At this point no database is associated with these memory structures and processes.  


How a Database is Mounted

The instance mounts a database to associate the database with that instance. To mount the database, the instance finds the database control files and opens them. Control files are specified in the control_files initialization parameter in the parameter file used to start the instance. Oracle database then reads the control files so that is can get the names of the database's data files and redo log files. 

 At this point, the database is still closed and is accessible only to the database administrator. The database administrator can keep the database closed while completing specific maintenance operations. The database is not yet available for normal operations. 

How a Database is Opened

Opening the mounted database makes it available for normal database operations. Any valid user who can connect to an open database access its information. Usually a database administrator opens the database to make it available for general use. 

While you are opening the database, Oracle database opens the online data files and redo log files. If any of the data files or redo log files is absent while attempting to open the data files, Oracle Data base returns an error. You must perform recovery on a backup of any damaged or missing files before you can open your database.    


Back to Database Administration


No comments:

Post a Comment

Contact Form

Name

Email *

Message *