Starting and stopping your Oracle database 12C is a task that you’ll perform frequently. To start/stop your database, connect with a SYSDBA or SYSOPER privileged user account, and issue the STARTUP and SHUTDOWN statements. The following example uses OS authentication to connect to the database:
$ sqlplus / as sysdba
After you’re connected as a privileged account, you can start your database, as follows:
Note For the prior command to work, you need either an spfile or init.ora file in the ORACLE_HOME/dbs directory.
When your instance starts successfully, you should see messages from Oracle indicating that the system global area (SGA) has been allocated. The database is mounted and then opened:
ORACLE instance started. Total System Global Area 2137886720 bytes Fixed Size 2290416 bytes Variable Size 1207962896 bytes Database Buffers 922746880 bytes Redo Buffers 4886528 bytes Database mounted. Database opened.
From the prior output the database startup operation goes through three distinct phases in opening an Oracle database:
- Starting the instance
- Mounting the database
- Opening the database
You can step through these one at a time when you start your database. First, start the Oracle instance (background processes and memory structures):
SQL> startup nomount;
Next, mount the database. At this point, Oracle reads the control files:
SQL> alter database mount;
Finally, open the data files and online redo log files:
SQL> alter database open;
Tip It’s especially important to understand these startup phases when performing RMAN backup and recovery tasks. For example, in some scenarios you may need your database to be in mount mode. In that mode, it’s important to understand that the control file is open but the data files and online redo logs have not been opened yet.
This startup process is depicted graphically in Figure 1.
When you issue a STARTUP statement without any parameters, Oracle automatically steps through the three startup phases (nomount, mount, open). In most cases, you will issue a STARTUP statement with no parameters to start your database. In many RMAN backup and recovery scenarios, you’ll issue a STARTUP MOUNT to place your database in mount mode (instance started and control files opened). Table 2 describes the meanings of parameters that you can use with the database STARTUP statement.