学习Oracle,基础是少不了的,下面是从Oracle文档中看的关于Oracle体系结构的概述,记录下来以便于以后查询,红色标的可以重点看看。
An Oracle database server consists of a database and at least one database instance (commonly referred to as simply an instance).Because an instance and a database are so closely connected, the term Oracledatabase is sometimes used to refer to both instance and database. In thestrictest sense the terms have the following meanings:
A database is a set of files, located on disk, that storedata. These files can exist independently of a database instance.
一个数据库是由一组位于磁盘上存放数据的文件。这些文件可以独立于数据库实例存在。
An instance is a set of memory structures that managedatabase files. The instance consists of a shared memory area, called thesystem global area (SGA), and a set of background processes. An instance can existindependently of database files.
一个实例是由一组管理数据库文件的内存结构。这个实例(SGA)包括:Shared memory area和一组后台进程。
SGA和PGA的结构可以通过下面的图来查看。
A database can be considered from both a physical and logical perspective.Physical data is data viewable at the operating system level. For example,operating system utilities such as the Linux ls and ps can list database filesand processes. Logical data such as a table is meaningful only for thedatabase. A SQL statement can list the tables in an Oracle database, but anoperating system utility cannot.
The database has physical structures and logical structures. Because the physicaland logical structures are separate, the physical storage of data can bemanaged without affecting access to logical storage structures. For example,renaming a physical database file does not rename the tables whose data isstored in this file.
An essential task of a relational database is data storage.This section briefly describes the physical and logical storage structures usedby Oracle Database.
The physical database structures are the files that storethe data. When you execute the SQL commandCREATE DATABASE
, thefollowing files are created:
· Data files
Every Oracle database has one ormore physical data files,which contain all the database data. The data of logical database structures,such as tables and indexes, is physically stored in the data files.
· Control files
Every Oracle database has a control file. Acontrol file contains metadata specifying the physical structure of thedatabase, including the database name and the names and locations of thedatabase files.
· Online redo log files
Every Oracle Database has an online redo log,which is a set of two or more online redolog files. An onlineredo log is madeup of redo entries (also called redo records), whichrecord all changes made to data.
Many other files are important for the functioning of anOracle database server. These files include parameter files and diagnosticfiles. Backup files andarchived redo log filesare offline files important for backup and recovery.
数据库物理存储结构分为Datafile、Controlfile、Online redo logfile这3个部分。
This section discusses logical storage structures. Thefollowing logical storage structures enable Oracle Database to havefine-grained control of disk space use:
· Data blocks
At the finest level ofgranularity, Oracle Database data is stored in data blocks. Onedata blockcorresponds to a specific number of bytes on disk.
· Extents
An extent is aspecific number of logically contiguous data blocks, obtained in a singleallocation, used to store a specific type of information.
· Segments
A segment is a setof extents allocated for a user object (for example, a table or index),undo data, ortemporary data.
· Tablespaces
A database is divided intological storage units called tablespaces. A tablespaceis the logical container for a segment. Each tablespace contains at least onedata file.
数据库逻辑存储结构分为Data blocks、Extents、Segments和Tablespace,这几个是Oracle的逻辑概念,不是具体存在的。
An Oracle database uses memory structures and processes tomanage and access the database. All memory structures exist in the main memoryof the computers that constitute the RDBMS.
When applications connect to an Oracle database, they areconnected to a database instance. The instance services applications byallocating other memory areas in addition to the SGA, and starting otherprocesses in addition to background processes.
A process is amechanism in an operating system that can run a series of steps. Some operatingsystems use the terms job, task,or thread. For the purpose of this discussion, athread is equivalent to a process. An Oracle database instance has thefollowing types of processes:
· Client processes
These processes are created andmaintained to run the software code of an application program or an Oracletool. Most environments have separate computers for client processes.
· Background processes
These processes consolidatefunctions that would otherwise be handled by multiple Oracle Database programsrunning for each client process. Background processes asynchronously performI/O and monitor other Oracle Database processes to provide increasedparallelism for better performance and reliability.
· Server processes
These processes communicate withclient processes and interact with Oracle Database to fulfill requests.
Oracle processesinclude server processes and background processes. In most environments, Oracleprocesses and client processes run on separate computers.
Oracle Database creates and uses memory structures forpurposes such as memory for program code, data shared among users, and privatedata areas for each connected user. The following memory structures areassociated with an instance:
· System Global Area (SGA)
The SGA is a group of sharedmemory structures that contain data and control information for one databaseinstance. Examples of SGA components include cached data blocks and shared SQLareas.
· Program Global Areas (PGA)
A PGA is a memory region thatcontain data and control information for a server or background process. Accessto the PGA is exclusive to the process. Each server process and backgroundprocess has its own PGA.
To take full advantage of a given computer system ornetwork, Oracle Database enables processing to be split between the databaseserver and the client programs. The computer running the RDBMS handles thedatabase server responsibilities while the computers running the applicationshandle the interpretation and display of data.
The application architecture refersto the computing environment in which a database application connects to anOracle database. The two most common database architectures are client/serverand multitier.
In a client/server architecture,the client application initiates a request for an operation to be performed onthe database server. The server runs Oracle Database software and handles thefunctions required for concurrent, shared data access. The server receives andprocesses requests that originate from clients.
In a traditional multitier architecture,one or more application servers perform parts of the operation. An application server contains a large part of the applicationlogic, provides access to the data for the client, and performs some queryprocessing, thus lessening the load on the database. The application server canserve as an interface between clients and multiple databases and provide anadditional level of security.
Service-oriented architecture (SOA) is a multitier architecture in which application functionality isencapsulated in services. SOA services are usuallyimplemented as Web services. Web services are accessible through HTTP and arebased on XML-based standards such as Web Services Description Language (WSDL)and SOAP.
Oracle Database can act as a Web service provider in atraditional multitier or SOA environment.
Oracle Net Services is the interface between the database and the network communicationprotocols that facilitatedistributed processingand distributed databases. Communication protocols define the way that data istransmitted and received on a network. Oracle Net Services supportscommunications on all major network protocols, including TCP/IP, HTTP, FTP, andWebDAV.
Oracle Net,a component of Oracle Net Services, establishes and maintains a network sessionfrom a client application to a database server. After a network session isestablished, Oracle Net acts as the data courier for both the clientapplication and the database server, exchanging messages between them. OracleNet can perform these jobs because it is located on each computer in thenetwork.
An important component of Net Services is the Oracle Net Listener (called the listener),which is a separate process that runs on the database server or elsewhere inthe network. Client applications can send connection requests to the listener,which manages the traffic of these requests to the database server. When aconnection is established, the client and database communicate directly.
The most common ways to configure an Oracle database toservice client requests are:
· Dedicated server architecture
Each client process connects toa dedicated server process. The server process is not shared by any otherclient for the duration of the client's session. Each new session is assigned adedicated server process.
· Shared server architecture
The database uses a pool ofshared processes for multiple sessions. A client process communicates with a dispatcher, which is a process that enables many clients toconnect to the same database instance without the need for a dedicated serverprocess for each client.