From: http://hong9270503.blog.163.com/blog/static/1272923200916112245844/
To learn about oracle, we 'd better first understand the Oracle framework. In this way, we have an overall understanding of Oracle, which has the role of creating a high-level architecture.
1. Physical Structure
Control File, data file, redo log file, parameter file, archive file, password file)
The data in a database is stored in physical files on the disk. When used, the data is transferred to the memory.
Control Files, data files, redo log files, tracking files, and warning logs
(Trace files, alert files) are database files;
Parameter file (parameter
File) password file is a non-database file
1.1 data files
: Stores data
Files. data files typically represent the volume of an Oracle database determined by the disk space and quantity they use.
For performance reasons
Put these files on different disks in one or more files.
Types:
. Data dictionary. data
. Redo data. index
. Temporary data, etc.
1.2 Control File
:
Contains necessary information to maintain and verify the integrity of the database. For example, a control file is used to identify data files and redo log files. A database requires at least one control file.
Control File
Content
. Database Name
. Tablespace Information
. Names and locations of all data files
. All
Redo log file name and location
. Current Log serial number
. Checkpoint Information
. For redo logs and archived
Current status information
Use of Control Files
The control file directs Oracle to the database
Other parts. When an instance is started, Oracle reads the name and location of the control file from the parameter file. Oracle
Open the control file. When the database is finally opened, Oracle reads the list of data files from the control file and opens each file.
1.3
Create log files
:
Includes changes made to the database, so that data recovery can be enabled in case of a fault. A database requires at least two redo log files.
Parts.
1.4 Trace Files and warning logs (Trace Files and Alert Files)
Each background process running in the instance is connected to a trace file. Trace file
Records Information about Major Events encountered by background processes.
Warning log (Alert
Log) is a special trace file. Each database has a trace file that synchronously records database messages and errors.
1.5 parameter file
:
This includes a large number of settings that affect the functions of Oracle database instances, as shown in the following settings:
. Locating Database Control Files
. Oracle Used to cache data from
Memory size of data read on the disk
. Select the default optimizer.
Perform two important functions related to database files
1> specify the control file for the database
2> specify the log archiving target for the database
1.6 archive files
:
Is an offline copy of the redo log file, which may be necessary to recover from a media failure.
1.7 Password File
: Authenticate
You have the permission to start and close Oracle routines.
2. Logical Structure (tablespace, segment, partition, block)
Table space: a set of data files in the basic logical structure of the database.
Segment: the space occupied by objects in the database.
ZONE: Indicates data once.
A large storage space reserved.
Block: the most basic storage unit of ORACLE, which is specified when a database is created.
3. Internal
Storage Allocation (SGA and PGA)
)
SGA
: Memory zone used to store database information. The information is
The database process is shared. It contains Oracle
The data and control information of the server. It is allocated in the actual memory of the computer where the Oracle server resides. If the actual memory is insufficient, it is written into the virtual memory.
PGA
:
Contains the data and control information of a single server process or a single background process. Unlike the SGA shared by several processes, PGA is only used by one process. PGA
Assign a process when creating it and reclaim it when terminating it.
4. background processes
Including Data Writing Process
(Database Writer, DBWR), Log Writer (LGWR), System Monitoring (System)
Monitor, SMON), Process Monitor (PMON), Checkpoint Process (Checkpoint
Process, CKPT), archiving Process, service Process, user Process)
Data Writing Process: responsible for writing changed data from the database buffer cache to the data file
Log writing process: writes changes in the redo log buffer to online redo log files.
System Monitoring: Checks Database Consistency. If necessary, it will be enabled when the database is opened.
Start database recovery
Process Monitoring: clears resources when an Oracle process fails.
Checkpoint Process: responsible for every time the buffer is slowed down
Changes in the database are permanently recorded, and the database status information in the control file and data file is updated. The process changes the title of all data files at the check point to indicate the checkpoint. In
Generally, this task is executed by LGWR. However, if the checkpoint significantly reduces system performance, the CKPT process can run to separate the work of the checkpoint originally executed by the LGWR process,
Implemented by the CKPT process. For many applications, the CKPT process is unnecessary. CKPT runs only when the database has many data files and the LGWR significantly reduces the performance at the check point.
The CKPT process does not write blocks to the disk. This task is completed by DBWR. CHECKPOINT_PROCESS In the init. ora File
The parameter controls the enable or disable of the ckpt process. The default value is FALSE.
Archiving process: backs up or archives a full log group during each log switch.
Service Process: User process service.
User process: On the client
It is responsible for passing user SQL statements to the service process and retrieving query data from the server segment.
5. SCN (System
ChangeNumber ):
System Change number, a serial number maintained by the system. It is automatically added when the system needs to be updated.
It is an important indicator of data consistency and sequential recovery.