Databases Reference
In-Depth Information
There are problems that can prevent an instance from starting. For example, there
may be errors in the initialization file, or the operating system may not be able to
allocate the requested amount of shared memory for the SGA. You also need the
special privilege SYSOPER or SYSDBA, granted through either the operating sys‐
tem or a password file, to start an instance.
2. Mounting the database . The instance opens the database's control files. The initi‐
alization parameter CONTROL_FILES tells the instance where to find these control
files. At this point, only the control files are open. This is called the MOUNT state,
and the database is accessible only to the database administrator. In this state, the
DBA can perform limited types of database administration. For example, the DBA
may have moved or renamed one of the database files. The datafiles are listed in the
control file but aren't open in the MOUNT state. The DBA can issue a command
( ALTER DATABASE ) to rename a datafile. This command will update the control file
with the new datafile name.
3. Opening the database . The instance opens the redo logfiles and datafiles using the
information in the control file. At this point, the database is fully open and available
for user access.
Shutting Down the Database
Logically enough, the process of shutting down a database or making it inaccessible
involves steps that reverse those discussed in the previous section:
1. Closing the database . Oracle flushes any modified database blocks that haven't yet
been written to the disk from the SGA cache to the datafiles. Oracle also writes out
any relevant redo information remaining in the redo log buffer. Oracle then check‐
points the datafiles, marking the datafile headers as “current” as of the time the
database was closed, and closes the datafiles and redologfiles. At this point, users
can no longer access the database.
2. Dismounting the database . The Oracle instance dismounts the database. Oracle
updates the relevant entries in the control files to record a clean shutdown and then
closes them. At this point, the entire database is closed; only the instance remains.
3. Shutting down the instance . The Oracle software stops the background processes
of the instance and frees, or deallocates, the shared memory used for the SGA.
In some cases (e.g., if there is a machine failure or the DBA aborts the instance), the
database may not be closed cleanly. If this happens, Oracle doesn't have a chance to write
the modified database blocks from the SGA to the datafiles. When Oracle is started
again, the instance will detect that a crash occurred and will use the redo logs to auto‐
matically perform what is called crash recovery . Crash recovery guarantees that the
changes for all committed transactions are done and that all uncommitted or in-flight
Search WWH ::




Custom Search