Different modes to start Oracle Database




STARTING ORACLE DATABASE IN DIFFERENT MODES


One of the most common jobs of the database administrator is to startup or shutdown the Oracle database. Typically we hope that database shutdowns will be infrequent for a number of reasons:

* Inconvenience to the user community.
* Anytime you cycle the database, there is a risk that it will not restart.
* It flushes the Oracle memory areas, such as the database buffer cache.
Performance on a restarted database will generally be slow until the database memory areas are “warmed” up.
Why would you shutdown your database? Some reasons include database maintenance:
* Applying a patch or an upgrade.
* Allow for certain types of application maintenance.
* Performing a cold (offline) backup of your database. (We recommend hot backups that allow you to avoid shutting down your database)
* An existing bug in your Oracle software requires you to restart the database on a regular basis.

The Oracle Startup Command
You start the Oracle database with the startup command. You must first be logged into an account that has sysdba  privileges such as the SYS account. Here then is an example of a DBA connecting to his database and starting the instance:

C:\Documents and Settings\Robert>set oracle_sid=booktst
C:\Documents and Settings\Robert>sqlplus "sys as sysdba"
 
SQL*Plus: Release 10.1.0.2.0 - Production on Mon Feb 21 12:35:48
 
Enter password: xxxx
Connected to an idle instance.
 
SQL> startup
ORACLE instance started.
 
Total System Global Area  251658240 bytes
Fixed Size                   788368 bytes
Variable Size             145750128 bytes
Database Buffers          104857600 bytes
Redo Buffers                 262144 bytes
Database mounted.
Database opened.
 
When Oracle is trying to open your database, it goes through three distinct stages, and each of these is listed in the startup output listed previously. These stages are:
* Startup (nomount)
* Mount
* Open

Let’s look at these stages in a bit more detail.

The Startup (nomount) Stage

When you issue the startup command, the first thing the database will do is enter the nomount stage. During the nomount stage, Oracle first opens and reads the initialization parameter file (init.ora) to see how the database is configured. For example, the sizes of all of the memory areas in Oracle are defined within the parameter file.
After the parameter file is accessed, the memory areas associated with the database instance are allocated. Also, during the nomount stage, the Oracle background processes are started. Together, we call these processes and the associated allocated memory of the Oracle instance. Once the instance has started successfully, the database is considered to be in the nomount stage. If you issue the startup command, then Oracle will automatically move onto the next stage of the startup, the mount stage.

Starting the Oracle Instance (Nomount Stage)

There are some types of Oracle recovery operations that require the database to be in nomount stage. When this is the case, you need to issue a special startup command: startup nomount, as seen in this example:
SQL> startup nomount
       The Mount Stage
When the startup command enters the mount stage, it opens and reads the control file. The control file is a binary file that tracks important database information, such as the location of the database datafiles.
In the mount stage, Oracle determines the location of the datafiles, but does not yet open them. Once the datafile locations have been identified, the database is ready to be opened.
       Mounting the Database
Some forms of recovery require that the database be opened in mount stage. To put the database in mount stage, use the startup mount command as seen here:
SQL> startup mount
If you have already started the database instance with the startup nomount command, you might change it from the nomount to mount startup stage using the alter database command:
SQL> alter database mount;

The Open Oracle startup Stage

The last startup step for an Oracle database is the open stage. When Oracle opens the database, it accesses all of the datafiles associated with the database. Once it has accessed the database datafiles, Oracle makes sure that all of the database datafiles are consistent.

      Opening the Oracle Database
To open the database, you can just use the startup command as seen in this example
SQL> startup
If the database is mounted, you can open it with the alter database open command as seen in this example:
SQL> alter database open;
Other Ways to Open the Database

      Opening the Database in Restricted Mode

You can also start the database in restricted mode. Restricted mode will only allow users with special privileges to access the database (typically DBA’s), even though the database is technically open. We use the startup restrict command to open the database in restricted mode as seen in this example.
       SQL> startup restrict
You can take the database in and out of restricted mode with the alter database command as seen in this example:
-- Put the database in restricted session mode.
SQL> alter system enable restricted session;
-- Take the database out of restricted session mode.
SQL> alter system disable restricted session;
Note:  Any users connected to the Oracle instance when going into restricted mode will remain connected; they must be manually disconnected from the database by exiting gracefully or by the DBA with the “alter system kill session” command.

The database can be placed in a state where only the sys and system users can query the database without stopping the database and performing a subsequent startup restrict. The activities of other users continue until they become inactive. This can be performed using the quiesce option of alter session when the Database Resource Manager option has been set up.
> alter system quiesce restrict;
> alter system unquiesce;

Forcing a Startup 

Over time, you will run into situations where Oracle has not shutdown properly and you are unable to restart it. In these rare instances, you will need to use the force option of the startup command. This will first perform a “shutdown abort” that forces the database to shutdown (see the next section for more information on this) followed by a database startup.
> startup force

Problems during Oracle Startup

The most typical reason for a database not starting up is a prior database crash,
 a data corruption,disk failure,media corruption or
 some other catastrophic event from which the database cannot recover.
 In these cases, you have to go into database recovery mode to start your instance.

 


Share your views...

0 Respones to "Different modes to start Oracle Database"

Post a Comment

 

© 2010 Codes & Concepts All Rights Reserved Thesis WordPress Theme Converted into Blogger Template by Hack Tutors.info