[Oracle Notes] 1. Oracle Architecture

Source: Internet
Author: User
[Oracle Notes] 1. Oracle architecture, oracle routine is a database access tool, composed of a memory structure and background process, always open one, and can only open one

[Oracle Notes] 1. Oracle architecture, oracle routine is a database access tool, composed of a memory structure and background process, always open one, and can only open one

Architecture
I. Basic Components
1. The Oracle Server is a database management system, including oracle instances and oracle databases ).
2. An oracle routine is a database access tool consisting of a memory structure and background processes. It always opens one database and can only open one database. It has a one-to-many relationship with the database.
3. oracle database is a collection of processed data, including three types of files: data files, control files, and redo log files ). In addition, there are some auxiliary parameters, including parameter files, password files, and archived log files)
Data files include actual data in the database
Control files include information required to maintain and verify database integrity
Redo log files include Database Change records, which can be used to recover data when a fault occurs.
The parameter file is used to define the features of oracle routines and is mainly used to specify the parameters in the memory and database.
Password File verification routines that users have the right to start and close oracle
The archived log file is an offline copy of the redo log file. When the redo log file is full, it will be overwritten cyclically. The archived log file will record all the redo logs.
4. the physical structure includes three file types: control file. files with the suffix ctl) and data files with. dbf Files with the suffix, data dictionary files are also data files), redo log files (files with the suffix of log)
Ii. Memory Structure
1. The memory structure of oracle consists of two memory zones: the system global zone (SGA) and the process global zone (PGA)
SGA is allocated when the oracle routine is started. It is a continuous grain group (granules: When SGA is <M, the size of the grain group is 4 M; otherwise, 16 M) memory allocation per unit, used to store database information shared by database processes, including data and control information about oracle servers. (Use show SGA to query related information in the database)
PGA is allocated when the server process is started,
2. SGA includes the following basic memory structures:
Shared pool: used to store recently executed SQL statements and recently used data definitions. It consists of two parts.
A. Library cache: stores information about recently used SQL and PL/SQL statements, which is based on "least recently used algorithms" (LRU) -- When the cache is full, the execution path and syntax analysis tree rarely used in the cache will be deleted. It also includes two structures: the Shared SQL area and the Shared PL/SQL area ).
B. Data Dictionary high-speed cache (Dictionary buffer cache): a set of recently used definitions in the database, including information related to database files, tables, indexes, columns, users, permissions, and other database objects (related to user account data, the data file name, segment name, partition location, table description, and user permission information are stored in the data dictionary table ).
Database buffer cache: stores copies of data blocks that have been retrieved from data files. And manage it through the LRU algorithm.
Redo log buffer: records all modifications made to database data blocks. It is mainly used for restoration.
Large pool: an optional memory area in SGA for sharing Server session memory (UGA), I/O Server Processes, backup and recovery operations, or RMAN, message cache for parallel execution. Do not use LRU
JAVA pool: a service analysis requirement for storing JAVA commands. It is required when JAVA is installed and used.
3. PGA is the memory reserved for each user process connected to the oracle database. It is allocated when a process is created and withdrawn when the process is terminated. It is only used by one process. PGA memory includes the following components:
Dedicated SQL zone: contains binding information and data such as the runtime memory structure.
Session memory: contains the memory allocated for session variables and other information related to the session.
SQL Workspace: used for operations that consume a large amount of memory.
3. Process Structure
1. Several oracle Processes
User process: it is started when a database user requests to connect to the oracle server. Generally, it starts a Client Connected to the oracle server, instead of directly interacting with the oracle server, but through the user program structure (UPI) generate various calls
Server process: it is connected to the oracle routine. It is started when the user establishes a session. The generated call is executed and relevant results are returned to the user. After the user's process is disconnected, the server process will be terminated.
Background process: it is started when the oracle routine is started. There are five background processes and other optional background processes.
A. Database Write Program (DBWn): the server process records changes made to the restored block and data block in the database buffer cache. DBWn writes the gray data buffer in the cache of the database buffer to the data file. DBWn delays writing data files until one of the following events occurs:
Incremental or normal checkpoint
The number of gray data buffers reaches the threshold.
When a process scans the specified data block and cannot find any idle Buffer
Timeout
Ping request in RAC cluster environment
Offline normal or temporary tablespace
Make the tablespace in read-only mode
Delete or truncate a table
Execute alter tablespace name begin backup operation
B. Log writer (LGWR): writes information about the redo log buffer to the redo log file, which occurs in the following events:
When a transaction is committed
When 1/3 of the redo log buffer is filled
When the redo log buffer records changes that exceed 1 MB
Before DBWn writes a modified block in the data buffer cache to a data file
Every three seconds
C. System Monitoring Program (SMON): used for routine recovery (roll back the changes in the redo log, open the database for user access, and roll back the uncommitted transactions), merge idle space, and reclaim temporary segments.
D. Process Monitor (PMON): After the routine fails, roll back the transaction processing, release the lock, release other resources, and restart the invalid scheduling program.
E. Checkpoint (CKPT): includes sending a signal to DBWn at the check point, updating the data file header with the checkpoint information, and updating the control file with the checkpoint information. The checkpoint interval is three seconds. The purpose of the checkpoint is to ensure that all the buffer content modified between time points in the cache of the database buffer has been written to the data file.
F. archive program (ARCn): An optional background process. When ARCHIVELOG (archive log) mode is set, online redo logs are automatically archived to keep all changes to the database.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.