Oracle Memory Architecture - Oracle 体系结构篇 1

来源:互联网 发布:数据库集群是什么意思 编辑:程序博客网 时间:2024/06/05 00:19

前言:在官方文档里面切了两个oracle 10g & oracle 11g的架构图过来,大家可以对比的看。大体上还是一样的。Oracle 体系结构篇 就围绕的这两张图来展开,逐一进行讲解。

 

1.Oracle 服务 

大家听过SOA这个词吧,SOA(service-oriented architecture)是面向服务的一个架构,ORACLE 也同样提供了一个服务,它提供了数据存储和业务支持服务,ORACLE的服务就叫ORACLE SERVICES,如果你的实例名叫Rain,那么你可以看到有个Rain的服务。

(1)一个ORACLE服务提供了开放的完整性的信息管理系统。

(2)ORACLE服务由一个实例和一个数据库组成。

An Oracle server is a database management system that provides an open ,comprehensive,integrated approach to information management, consists of an Oracle instance and an Oracle database.

举一个生活中的例子,比如工商银行,北京的工商银行总行,下面有n多个分行,我们可以在网上登录工商银行查询信息,但是存取现金我们就可以去各个分行办理,这里工商银行总行就像我们oracle的数据库库文件,各个分行就好比oracle实例,提供具体的取现服务。一个分店就是总行的一个实例,总行可以开n个分店,那么总行就有n个实例,这个就是oracle的另一个体系架构:RAC,一个数据库可以通过集群,实例化多个实例,以提供多个服务。

 

Oracle Server 的概念就是:一个ORACLE SERVER就是一个DATABASE库文件加上一个INSTANCE,那有两个实例服务关联同一个DATABASE库文件,是不是两个ORACLE SERVER?是的,提供两个服务。

总结:

-->ORACLE SERVER = 1个DB + 1个INSTANCE
-->INSTANCE = MEMORY + PROCESS
--> RAC = N个ORACLE SERVER = 1个DB + N个INSTANCE

2.实例

2.1   What's the instance? 什么是实例?      

A database  instance  is a set of memory structures that manage database files. A  database is a set of physical files on disk created by theCREATE DATABASE statement. The instance manages its associated data and serves the users of the database.

Every running Oracle database is associated with at least one Oracle database instance. Because an instance exists in memory and a database exists on disk, an instance can exist without a database and a database can exist without an instance.

每个Oracle数据库都是由Oracle Instance(实例)与数据库(数据文件,控 制文件、重做日志文件)组成,其中所谓实例就是用户同数据库交互的媒介,用户通过与一个实例相连来操作数据库。而实例又是由统一的内存结构(SGA,PGA,UGA)和一批内存驻留进程组成。

When an instance is started, Oracle Database allocates a memory area called the system global area(SGA) and starts one or more background processes.

A database instance includes background processes. Server processes, and the process memory allocated in these processes, also exist in the instance. The instance continues to function when server processes terminate.

2.2  How an instance is started?  实例启动的基本步骤是什么呢?      

  1. Searches for a  server parameter file  in a platform-specific default location and, if not found, for atext  initialization parameter file (specifyingSTARTUP with the SPFILE or PFILE parameters overrides the default behavior)                                           ---首先查找服务器参数文件,如果不存在,就找文本参数文件

  2. Reads the parameter file to determine the values of initialization parameters       --读取初始化参数文件里面的值

  3. Allocates the SGA based on the initialization parameter settings                          --根据初始化参数文件里面设置的值分配SGA

  4. Starts the Oracle background processes                                                              --启动Oracle 后台进程

  5. Opens the alert log  and trace files and writes all explicit parameter settings to the  alert log in valid parameter syntax     --打开警告日志文件跟踪

2.3  Oracle System Identifier (SID) 

The system identifier (SID) is a unique name for an Oracle database instance on a specific host. On UNIX and Linux, Oracle Database uses the SID and oracle_home values to create a key to shared memory. Also, the SID is used by default to locate the parameter file, which is used to locate relevant files such as the database control files.

SID 系统标示符:1.区分操作系统的实例。  2.定位参数文件。3.在大多数平台,ORACLE_SID以环境变量的形式出现。

 

3. 内存管理

3.1   What's the memory area stores information? 内存存储的主要内容   

When an instance is started, Oracle Database allocates a memory area and starts background processes.  The memory area stores information such as the following:

>Program code

>Information about each connected   session,even if it is not currently active

>Information needed during program execution, for example, the current state of a  query from which rows are being fetched

>Information such as lock  data that is shared and communicated among processes

>Cached data, such as   data blocks and redo records, that also exists on disk

Oracle 内存存储的主要内容是:

程序代码(PLSQL、Java);
关于已经连接的会话信息,包括当前所有活动和非活动会话;
程序运行时必须的相关信息,例如查询计划;
Oracle 进程之间共享的信息和相互交流的信息,例如锁;
那些存储在外围介质上,被cache 在内存中的数据(如redo 记录,数据块)。

3.2   Basic Memory Structures  基本的内存结构

            >System global area (SGA)       系统全局区  

            >Program global area (PGA)     程序全局区

            >User Global Area (UGA)          用户全局区

            >Software code areas               软件代码区

 

待续:下一节详细讲解SGA。

 

 

 

原创粉丝点击