When you start up a database, you create an instance of that database and you determine the state of the database. Normally, you start up an instance by mounting and opening the database. Doing so makes the database available for any valid user to connect to and perform typical data access operations. Other options exist, and these are also discussed in this section.
This section contains the following topics relating to starting up an instance of a database:
You can start up a database instance with SQL*Plus, Recovery Manager, or Enterprise Manager.
You can start a SQL*Plus session, connect to Oracle Database with administrator privileges, and then issue the
STARTUP command. Using SQL*Plus in this way is the only method described in detail in this book.
You can also use Recovery Manager (RMAN) to execute
SHUTDOWN commands. You may prefer to do this if your are within the RMAN environment and do not want to invoke SQL*Plus.
See Also:Oracle Database Backup and Recovery User's Guide for information on starting up the database using RMAN
You can use Oracle Enterprise Manager (EM) to administer your database, including starting it up and shutting it down. EM combines a GUI console, agents, common services, and tools to provide an integrated and comprehensive systems management platform for managing Oracle products. EM Database Control, which is the portion of EM that is dedicated to administering an Oracle database, enables you to perform the functions discussed in this book using a GUI interface, rather than command line operations.
The remainder of this section describes using SQL*Plus to start up a database instance.
To start an instance, the database must read instance configuration parameters (the initialization parameters) from either a server parameter file (
SPFILE) or a text initialization parameter file.
When you issue the SQL*Plus
STARTUP command, the database attempts to read the initialization parameters from an
SPFILE in a platform-specific default location. If it finds no
SPFILE, it searches for a text initialization parameter file.
Note:For UNIX or Linux, the platform-specific default location (directory) for the
SPFILEand text initialization parameter file is:
For Windows NT and Windows 2000 the location is:
In the platform-specific default location, Oracle Database locates your initialization parameter file by examining filenames in the following order:
The first two filenames represent
SPFILEs and the third represents a text initialization parameter file.
spfile.orafile is included in this search path because in an Oracle Real Application Clusters environment one server parameter file is used to store the initialization parameter settings for all instances. There is no instance-specific location for storing a server parameter file.
For more information about the server parameter file for an Oracle Real Application Clusters environment, see Oracle Real Application Clusters Administration and Deployment Guide.
If you (or the Database Configuration Assistant) created a server parameter file, but you want to override it with a text initialization parameter file, you can specify the
PFILE clause of the
STARTUP command to identify the initialization parameter file.
STARTUP PFILE = /u01/oracle/dbs/init.ora
A non-default server parameter file (
SPFILE) is an
SPFILE that is in a location other than the default location. It is not usually necessary to start an instance with a non-default
SPFILE. However, should such a need arise, you can use the
PFILE clause to start an instance with a non-default server parameter file as follows:
Create a one-line text initialization parameter file that contains only the
SPFILE parameter. The value of the parameter is the non-default server parameter file location.
For example, create a text initialization parameter file
/u01/oracle/dbs/spf_init.ora that contains only the following parameter:
SPFILE = /u01/oracle/dbs/test_spfile.ora
Note:You cannot use the
IFILEinitialization parameter within a text initialization parameter file to point to a server parameter file. In this context, you must use the
Start up the instance pointing to this initialization parameter file.
STARTUP PFILE = /u01/oracle/dbs/spf_init.ora
SPFILE must reside on the machine running the database server. Therefore, the preceding method also provides a means for a client machine to start a database that uses an
SPFILE. It also eliminates the need for a client machine to maintain a client-side initialization parameter file. When the client machine reads the initialization parameter file containing the
SPFILE parameter, it passes the value to the server where the specified
SPFILE is read.
Note that on the UNIX and Linux platforms, if your SPFILE is not in the default location, you can also create a symbolic link to the SPFILE and place the symbolic link in the default location.
See Table 2-3 for information on PFILE and SPFILE default names and locations.
A database that uses Automatic Storage Management (ASM) usually has a non-default
SPFILE. If you use the Database Configuration Assistant (DBCA) to configure a database to use ASM, DBCA creates an
SPFILE for the database instance in an ASM disk group, and then creates a text initialization parameter file in the default location in the local file system to point to the
See Also:Chapter 2, "Creating and Configuring an Oracle Database", for more information about initialization parameters, initialization parameter files, and server parameter files
Ensure that environment variables are set so that you connect to the desired Oracle instance. For details, see "Submitting Commands and SQL to the Database".
Start SQL*Plus without connecting to the database:
Connect to Oracle Database as
CONNECT username AS SYSDBA
Now you are connected to the database and ready to start up an instance of your database.
See Also:SQL*Plus User's Guide and Reference for descriptions and syntax for the
Start the instance without mounting a database. This does not allow access to the database and usually would be done only for database creation or the re-creation of control files.
Start the instance and mount the database, but leave it closed. This state allows for certain DBA activities, but does not allow general access to the database.
Start the instance, and mount and open the database. This can be done in unrestricted mode, allowing access to all users, or in restricted mode, allowing access for database administrators only.
Force the instance to start after a startup or shutdown problem, or start the instance and have complete media recovery begin immediately.
Note:You cannot start a database instance if you are connected to the database through a shared server process.
The following scenarios describe and illustrate the various states in which you can start up an instance. Some restrictions apply when combining clauses of the
Note:It is possible to encounter problems starting up an instance if control files, database files, or redo log files are not available. If one or more of the files specified by the
CONTROL_FILESinitialization parameter does not exist or cannot be opened when you attempt to mount a database, Oracle Database returns a warning message and does not mount the database. If one or more of the datafiles or redo log files is not available or cannot be opened when attempting to open a database, the database returns a warning message and does not open the database.
See Also:SQL*Plus User's Guide and Reference for information about the restrictions that apply when combining clauses of the
The following command starts an instance, reads the initialization parameters from the default location, and then mounts and opens the database. (You can optionally specify a
You can start an instance and mount a database without opening it, allowing you to perform specific maintenance operations. For example, the database must be mounted but not open during the following tasks:
Enabling and disabling redo log archiving options. For more information, please refer to Chapter 11, "Managing Archived Redo Logs".
Performing full database recovery. For more information, please refer to Oracle Database Backup and Recovery User's Guide
The following command starts an instance and mounts the database, but leaves the database closed:
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). Use this mode of instance startup when you need to accomplish one of the following tasks:
Perform an export or import of data
Perform a data load (with SQL*Loader)
Temporarily prevent typical users from using data
Perform certain migration or upgrade operations
Typically, all users with the
CREATE SESSION system privilege can connect to an open database. Opening a database in restricted mode allows database access only to users with both the
CREATE SESSION and
RESTRICTED SESSION system privilege. Only database administrators should have the
RESTRICTED SESSION system privilege. Further, when the instance is in restricted mode, a database administrator cannot access the instance remotely through an Oracle Net listener, but can only access the instance locally from the machine that the instance is running on.
The following command starts an instance (and mounts and opens the database) in restricted mode:
You can use the
RESTRICT clause in combination with the
Later, use the
ALTER SYSTEM statement to disable the
RESTRICTED SESSION feature:
ALTER SYSTEM DISABLE RESTRICTED SESSION;
If you open the database in nonrestricted mode and later find that you need to restrict access, you can use the
ALTER SYSTEM statement to do so, as described in "Restricting Access to an Open Database".
See Also:Oracle Database SQL Language Reference for more information on the
You cannot shut down the current instance with the
SHUTDOWN IMMEDIATE, or
SHUTDOWN TRANSACTIONAL commands.
You experience problems when starting an instance.
If one of these situations arises, you can usually solve the problem by starting a new instance (and optionally mounting and opening the database) using the
STARTUP command with the
If an instance is running,
STARTUP FORCE shuts it down with mode
ABORT before restarting it. In this case, beginning with Oracle Database 10g Release 2, the alert log shows the message "
Shutting down instance (abort)" followed by "
Starting ORACLE instance (normal)." (Earlier versions of the database showed only "
Starting ORACLE instance (force)" in the alert log.)
See Also:"Shutting Down with the ABORT Clause" to understand the side effects of aborting the current instance
If you know that media recovery is required, you can start an instance, mount a database to the instance, and have the recovery process automatically start by using the
STARTUP command with the
STARTUP OPEN RECOVER
If you attempt to perform recovery when no recovery is required, Oracle Database issues an error message.
Many sites use procedures to enable automatic startup of one or more Oracle Database instances and databases immediately following a system start. The procedures for performing this task are specific to each operating system. For information about automatic startup, see your operating system specific Oracle documentation.