Oracle Essentials: Oracle9i, Oracle8i and Oracle8, Second Edition
by Rick Greenwald, Robert Stackowiak, Jonathan Stern
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:
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 checkpoints the datafiles, marking the datafile headers as “current” as of the time the database was closed, and closes the datafiles and redo log files. At this point, users can no longer access the database.
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.
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 automatically perform what is called crash recovery. Crash recovery guarantees that the changes for all committed ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access