This action might not be possible to undo. Are you sure you want to continue?
There are two terms that are used with Oracle
Database - A collection of physical operating system files Instance - A set of Oracle processes and a SGA (allocation of memory)
These two are very closely related but a database can be mounted and opened by many instances. An instance may mount and open only a single database at any one point in time. The File Structure The are a number of different file types that make up a database
• • • • • • • •
Parameter File - These files tells Oracle were to find the control files. Also they detail how big the meory area will be, etc Data Files - These hold the tables indexes and all other segments Temp Files - used for disk-based sorting and temporary storage Redo Log Files - Our transaction logs Archive Log Files - Redo log files which have been archived Control File - Details the location of data and log files and other relevant information about their state. Password File - Used to authenticate users logining into the database. Log files - alert.log contains database changes and events including startup information, trace files are debugging files.
Parameter Files The parameter file for Oracle is the commonly know file init.ora (or init<oracle sid>.ora). The file itself is a very simple plain text file (on oracle >9i it can also be a binary file called spfile.ora) and details information regarding block size, location of the control files, etc. On a windows server the file can be found in [ORACLE_HOME]/admin/<sid>/pfile but can be in any location by using the "startup pfile = <location>" . Sometimes a parameter may start with a underscore this normally refers to a undocumented parameter and is normally only requested by Oracle support. The main difference between the spfile and pfile is that instance parameters can be changed dynamically using a spfile, where as you require a instance reboot to load pfile parameters. Data Files Normally there are at least two data files, one for system data and the other sysaux data .
• • •
Segments - are database objects, a table, a index, rollback segments. Every object that consumes space is a segment. Segments themselves consist of one or more extents. Extents - are a contiguous allocation of space in a file. Extents, in turn, consist of data blocks Blocks - are the smallest unit of space allocation in Oracle. Blocks normally are 2KB, 4KB, 8KB, 16KB or 32KB in size but can be larger.
The relationship between segments, extents and blocks looks like this
This is an array of Row Directory pointers to where the rows are to be found in the data portion of the block. Free space available space within the block Data data within the block Header Temp Files . determining the block size depends on what you are going to do with the database. contains information regarding the type of block (a table block. etc). if you are using LOB's then the block size should be larger. The three above pieces are know as the Block Overhead and are used by Oracle to manage the Block overhead block itself. each tablespace having a different block size depending on what is storaged in the tablespace. if you are using small rows then use a small block size (oracle recommends 8KB).Oracle Database Architecture overview -2- The parameter DB_BLOCK_SIZE determines the default block size of the database. transaction information regarding active and past transactions on the block and the address (location) of the block on the disk Table Directory contains information about the tables that store rows in this block contains information describing the rows that are to be found on the block. You can have different block sizes within the database. A data block will be made up of the following. the two main area's are the free space and the data area. index block.
See Oracle recover critical files. although they have UNDO generated.Oracle Database Architecture overview -3- Oracle will use temorary files to store results of a large sort operation when there is insufficient memory to hold all of it in RAM. this will probably be the first file that will be looked when you have database issues. The redo logs guarantee that no committed changes are ever lost. The view V$CONTROLFILE can be used to list the control files. Oracle uses the concept of groups and a minimum of 2 is required each group having at least one file they are used in a circular fashion when one group fills up oracle will switch to the next log group. Redo log files consist of redo records which are group of change vectors each referring to specific changes made to a data block in the db.doc.log file contains important startup information major database changes and system events.If this file is removed Oracle creates another one automatically. backup set details and the SCN. these files along with any archived redo logs enable a dba to recover the database to any point in the past. Traces files . Password file This file optional and contains the names of the database users who have been granted the special SYSDBA and SYSOPER admin privilege. warnings and other messages. This file is the first file that Oracle consults when starting up. Redo log files All the Oracle changes made to the db are recorded in the redo log files. There are two types of redo log files online and archive. It is best practice to turn on ARCHIVELOG mode which performs the archiving automatically. Control file The control is one of the most important files within Oracle. this archive file with other redo log files can recover a database to any point in time. Log files The alert. Temporary data files never need to be backed up. Archive Redo log When a redo log file fills up and before it is used again the file is archived for safe keeping. the file contains data and redo log location information. Oracle will write all commited changes to the redo logs first before applying them to the data files. For more informtion on how to configure and maintain redo log on Oracle Redo. This file should have multiple copies due to it's importance. The changes are first kept in the redo buffer but are quickly written to the redo log files. This file is used in recovery as the control file notes all checkpoint information which allows oracle to recover data from the redo logs. db errors.doc for control file recovery. Temporary files never have redo generaed for them. current log sequence numbers. The file contains log switches.
Each and every segment belongs to exactly one tablespace. a tablespace contains segments A segment (table. An extent is a continuous set of blocks on a disk. Oracle uses this to rollback or undo changes to the db. any tablespace that is not temporary one. A block is the smallest unit of allocation in the database. recursive SQL operations are used to retrieve this information which generates undo activity which can produce performance issues Locally Dictionary There are a number of types that a tablespace can be • • • • • • Bigfile tablespaces. DBWn. The minimum tablespaces required are the system and sysaux tablepsaces. Tablespaces -4- A tablespace is a container which holds segments. The data dictionary is used to store space information. Tablespaces can be manged either locally or by the data dictionary Space information is stored within the data files and are tracked by bitmaps. A tablespace itself has one or more files associated with it. Temporary tablespaces. etc). Undo tablespaces. A segment exists in a tablespace but may have data in many data files within a tablespace. no write operations are allowed. An extent is in a single tablespace and is always in a single file within that tablespace. An extent will be contained entirely within one data file. Smallfile tablespaces (default). can have multiple files but the files are smaller than a bigfile tablespace. the following reasons are why tablespaces are used. index. . This is the default option when you create a tablespace in Oracle 10g. The data dicitonary is not used so recursive SQL operations are significantly reduced. So in summary the Oracle hierarchy is as follows: • • • • • A database is made up of one or more tablespaces A tablespace is made up of one or more data files. Read-only. etc) is made up of one or more extents. etc) and user processing information (SQL). will have only one file which can range from 8-128 terabytes. used for sorting Permanent tablespaces. • • • • • Tablespaces make it easier to allocate space quotas to users in the database Tablespaces enable you to perform partial backups and recoveries based on the tablespace as a unit Tablespaces can be allocated to different disks and controllers to improve performance You can take tablespaces offline without affecting the entire database You can import and export specific application data by using the import and export utilities at the tablespace. contain data that only persists for the duration a users session.Oracle Database Architecture overview are debugging files which can trace background process information (LGWR. A block is the smallest unit of i/o used by the database. Segments never cross tablespace boundaries. core dump information (ora-600 errors.
all SCN's are unique. The method is suited in small to meduim environments. You can even take the database back in time to a specific SCN number (or point in time). etc Oracle Managed Files -5- The OMF feature aims to set a standard way of laying out Oracle files. its a logical timestamp that is used by oracle to order events that have occurred within the database. OMF simplifies the initial db creation as well as on going file management. there is no need to worry about file names and the physical location of the files themselves. SCN's are used in crash recovery as the control maintains a SCN for each datafile. The SCN is used to keep track of all changes within the database.Oracle Database Architecture overview See Oracle tablespaces. SCN's are increasing sequence numbers and are used in redo logs to confirm that transactions have been comitted. if the datafiles are out of sync after a crash oracle can reapply the redo log information to bring the database backup to the point of the crash.doc for information regarding tablespaces such as creating. resizing. . System change number (SCN) The SCN is an important quantifier that oracle uses to keep track of its state at any given point in time.