The Oracle Instance
The Oracle8 database is comprised of two parts, the Oracle instance and the Oracle database. The Oracle instance is the software that manipulates the database. The instance refers to the memory structure and a set of background processes. These processes share the memory structure known as the SGA (System Global Area). The SGA is composed of various caches. The DBMS (Database Management System) really resides on the hard drive. The instance is created when the SGA has been allocated and the processes are copied into memory, as shown below. When the instance is shutdown, the SGA is deallocated from memory.
The following diagram depicts the background processes interacting with the database:
Summary of the Background Processes
The Oracle Database
The Oracle Database is where the data is stored. The database consists of the various files seen on your hard drive. The database can be thought of as consisting of three layers, which are the external, conceptual and internal layers. The following diagram depicts the architecture of the Oracle database:
The external layer consists of various objects, such as tables and views. The objects are stored in tablespaces, which represent the conecptual layer. The tablespaces are stored in Oracle data blocks, which represent the internal layer. An Oracle data block is stored within physical data files on the hard drive within your PC. (As an example, the SYSTEM tablespace holds the data dictionary.) In order to open the database, the instance must already be running.
The database is composed of data files, control files, and redo log files. The data files consist of the tablespaces, which contain the database objects. A tablespace can use one or more data files. The data files store all of your data. When a database is running, data is read from the data files and stored within the SGA (a portion of memory). For exaample, if a user wants to read data from the COACH table, the SGA will be checked first to see if the requested data already is already there. If the data is not in the SGA, then the data will be read from the data file and stored in memory.
The control files contain information about the physical structure of the database. For example, the control files contain information such as the database name, names and locations of data files and log files and database backup information. If a tablespace is created in the database then the database needs to know this information the next time it is started up. Therefore, it will store the name and location of the tablespace in the control file.
Furthermore, the database has two or more redo log files. The redo logs record all changes to the data. Therefore, data is never lost. Redo log files are used to recover from a system or media crash. They can be thought of as backup to the database. Once a redo log has been filled, the LGWR process will write to the next redo log file. After all the redo logs are filled they are recycled by being written over. However, if Archivelog Mode is enabled, once the redo logs are filled, the information in the redo logs is copied to the archive log(s) by the ARCH process and the next redo log is written to.