Saturday, April 21, 2007

Start a Database instance

To START a database instance Use the followings:

Syntax: (This is a SQL*Plus command, not part of standard SQL)

STARTUP [FORCE] [RESTRICT] [PFILE=filename] NOMOUNT

STARTUP [FORCE] [RESTRICT] [PFILE=filename] MOUNT [dbname]

STARTUP [FORCE] [RESTRICT] [PFILE=filename] OPEN [Open_options] [dbname]

Open_options: READ {ONLY | WRITE [RECOVER]} | RECOVER

Key:

FORCE -Shut down the current Oracle instance (if it is running) with SHUTDOWN mode ABORT, before restarting it. If the current instance is running and FORCE is not specified,an error results. FORCE is useful while debugging and under abnormal circumstances. It should not normally be used.

RESTRICT -Only allow Oracle users with the RESTRICTED SESSION system privilege to connect to the database. Later,you can use the ALTER SYSTEM command to disable the restricted session feature.

PFILE=filename - The init.ora parameter file to be used while starting up the instance. If PFILE is not specified,then the default STARTUP parameter file is used. The default file used is platform specific. For example, the default file is $ORACLE_HOME/dbs/init$ORACLE_SID.ora on UNIX, and %ORACLE_HOME%\database\initORCL.ora on Windows.

MOUNT dbname -Mount a database but do not open it. dbname is the name of the database to mount or open. If no database name is specified, the database name is taken from the initialization parameter DB_NAME.

OPEN -Mount and open the specified database.

NOMOUNT -Don't mount the database upon instance startup. Cannot be used with MOUNT, or OPEN.

RECOVER -Specifies that media recovery should be performed, if necessary, before starting the instance.

STARTUP RECOVER has the same effect as issuing the RECOVER DATABASE command and starting an instance. Only 'complete recovery' is possible with the RECOVER option. Recovery proceeds, if necessary, as if AUTORECOVERY is set to ON, regardless of whether or not AUTORECOVERY is enabled.

If a redo log file is not found in the expected location, recovery will continue by prompting you with the suggested location and name of the subsequent log files that need to be applied.


No comments: