Oracle體系結構概覽(一)

學習Oracle,基礎是少不了的,下面是從Oracle文檔中看的關於Oracle體系結構的概述,記錄下來以便於以後查詢,紅色標的可以重點看看。


一、Oracle體系結構概覽


Database and Instance

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:

  • Database

A database is a set of files, located on disk, that storedata. These files can exist independently of a database instance.

一個數據庫是由一組位於磁盤上存放數據的文件。這些文件可以獨立於數據庫實例存在。

  • 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的結構可以通過下面的圖來查看。

Description of Figure 1-1 follows

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.

 

Database Storage Structures

An essential task of a relational database is data storage.This section briefly describes the physical and logical storage structures usedby Oracle Database.

Physical Storage Structures

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個部分。

Logical Storage Structures

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的邏輯概念,不是具體存在的。

Database Instance Structures

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.

Oracle Database 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.

Instance Memory Structures

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.

Application and Networking Architecture

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.

Application Architecture

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.

Networking Architecture

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.






發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章