Wednesday, April 27, 2011

Startup options in Oracle

Oracle has several options for startup.

1.Standard startup

> startup;
This command actually takes Oracle through three distinct startup phases automatically which are
nomount
mount
open
, or you could also choose to explicitly step through these phases:

2.nomount phase

> startup nomount;
In the nomount phase, the database reads the spfile/pfile and starts up the Oracle Instance, but the database is not yet associated with the newly started instance. This is usually used in cases where you need to re-create the controlfile. The command to perform this is

3.mount phase

> startup mount;
> alter database mount;
In order to associate a database with the instance, the instance ''mounts" the database. This is done in the mount phase. The previously read parameter file is used to find those controlfiles, which contain the name of the data files and redo logs. The database is then mounted to allow some maintenance activities to be performed. Datafiles and redo logs are not opened when the database is in mount mode, so the database is not yet accessible by end users for normal tasks.

4.open phase

> Startup {open} {resetlogs};
> alter database open;
When Oracle opens the database in the open phase, it opens the data files and redo logs, making the database available for normal operations. Your redo logs must exist in order for the database to open. If they do not, the resetlogs command must be used to create new redo logs in the location specified in the control files.
Other Ways to Open the Database

5.Read only option.

> alter database open read only;
So that no database changes (inserts, updates, or deletes) can be performed.

6.Restrict Option

> startup restrict;
Only users with both the create session and restricted session privileges will be able to use the database.

7.Quiesce option

> alter system quiesce restrict;
> alter system unquiesce;
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.

8.Force Option

> startup force
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 followed by a database startup.
This command actually takes Oracle through three distinct startup phases automatically which are nomount mount open, or you could also choose to explicitly step through these phases:In the nomount phase, the database reads the spfile/pfile and starts up the Oracle Instance, but the database is not yet associated with the newly started instance. This is usually used in cases where you need to re-create the controlfile. The command to perform this isIn order to associate a database with the instance, the instance ''mounts" the database. This is done in the mount phase. The previously read parameter file is used to find those controlfiles, which contain the name of the data files and redo logs. The database is then mounted to allow some maintenance activities to be performed. Datafiles and redo logs are not opened when the database is in mount mode, so the database is not yet accessible by end users for normal tasks. When Oracle opens the database in the open phase, it opens the data files and redo logs, making the database available for normal operations. Your redo logs must exist in order for the database to open. If they do not, the resetlogs command must be used to create new redo logs in the location specified in the control files.So that no database changes (inserts, updates, or deletes) can be performed.Only users with both the create session and restricted session privileges will be able to use the database.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. 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 followed by a database startup.

No comments:

Post a Comment