Pages

Tuesday, November 15, 2011

Oracle 10g startup


STARTING UP THE DATABASE:                                                               
There are 4 stages to startup and shutdown the database
When startup database
Shutdown à Nomount à Mount à Open

At  NOMOUNT  Stage:
An instance is typically started only in NOMOUNT mode
During Database creation,
During Re-creation of control files,
Or During certain backup and recovery scenarios.

At this stage following tasks are performed
  • Reading initialization parameter file
                   First spfileSID.ora
if not found then, spfile.ora
If not found then, initsid.ora
specifying the PFILE parameter with STARTUP overrides the default behavior.
  • Allocating SGA
  • Starting the background Process
  • opening the alertSID.log files and trace files

At  MOUNT  Stage:
  Mounting a database includes the following tasks:
  • Associating a database with instance start at nomount stage.
  • Locating and opening the control file specified in the parameter file.
  • Reading the control file to obtain the name, status and destination of
DATA FILES AND ONLINE REDO LOG FILES
  • To perform special maintenance operations
  • Renaming data files
(data files for an offline tablespace can be renamed when the database is open)
  • Enabling and disabling online redo log file archiving, flashback options.
  • Performing full Database Recovery
We usually need to start up a database in mount mode when you’re doing activities such as performing a full database recovery, changing the archive logging mode of the database, or renaming data files. Note that all three of these operations require Oracle to access the data files but can’t accommodate any user operations in the files.

At  OPEN  Stage:
The last stage of the startup process is opening the database. When the database is started in the open mode, all valid users can connect to the database and perform database operations. Prior to this stage, the general users can’t connect to the database at all. You can bring the database into the open mode by issuing the ALTER DATABASE command as follows:
SQL> ALTER DATABASE OPEN;
Database altered.
More commonly, we simply use the STARTUP command to mount and open our database all at once:
SQL> STARTUP
To open the database, the Oracle server first opens all the data files and the online redo log files, and verify that the database is consistent. If the database isn’t consistent—for example, if the SCNs in the control files don’t match some of the SCNs in the data file headers—the background process will automatically perform an instance recovery before opening the database. If media recovery rather than instance recovery is needed, Oracle will signal that a database recovery is called for and won’t open the database until you perform the recovery.
IN SHORT
Opening a database includes the following tasks:
  • Open online data files
  • Open online redo log files

NOTE If any of the data files or online redo log files are not present when you attempt to open the database, then the oracle server returns an error.

STARTUP COMMAND à use to start database

STARTUP NOMOUNT;
to move the database from  NOMOUNT TO MOUNT or from
                                                      NOMOUNT TO OPEN   use
ALTER DATABASE COMMAND 

ALTER DATABASE MOUNT;
ALTER DATABASE OPEN;

No comments:

Post a Comment