Oracle Architecture Components

Oracle  体系结构图:WIKI


-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


1:SGA:

System Global Area

系统全局区,Orale在内存中的区域,一般很大默认分配255M,可以根据参数设置,
是系统内存中的一部分,所有的进程分享这块内存, 一个instance拥有一块SGA, SGA中包括数据库instance(实例)操作的各种信息
In the  database management systems  developed by the  Oracle Corporation , the  System Global Area  ( SGA ) forms the part of the system memory ( RAM ) shared by all the processes belonging to a single  Oracle database  instance. The SGA contains all information necessary for the instance operation.

In general, the SGA consists of the following:

  • dictionary cache: information about data dictionary tables, such as information about account, datafile, segment, extent, table and privileges
  • redo log buffer: containing information about committed transactions that the database has not yet written to online redo log files
  • the buffer_cache or "database buffer cache": holds copies of data blocks read from datafiles[1]
  • shared pool, the cache of parsed commonly-used SQL statements, and also the data-dictionary cache containing tables, views and triggers
  • Java pool, for parsing Java statements.
  • large pool (including the User Global Area (UGA))
------------------------------------------------------------------------------------------------------------------------------------
SGA通常有一以上几部分组成:
  1:shared pool  : 这部分又包括 dictinary cache, 和 Library Cache 这两部分,
              其中 dictinary Cache 是数据字典的缓存,当一个sql语句进入到内存中,首先根据数据字典判断是否有权限读取数据,然后解析sql,就是对sql进行编译,再对变量进行绑定,最后查询出结果,返回到客户端。
  2:redo log buffer  这部分对应的物理文件的 redo files 用于存储用户进行过的操作,必要是进行回滚,就是利用redo log进行。
  3: the buffer_cache 主要用户缓存从datafiles中读到的数据块的信息。
  4:Library Cache:  存储编译解析后的sql和PL/SQL的语句
2:内存中的每一块就对应着物理存储硬盘上的某一块空间,oracle中有几个进程就是为了处理内存中数据 和 物理数据的写入与读出的。
   oracle中的内存块有以下三部分组成:
                    1:data files 主要用于存储数据信息,通过 DBWn 进程 进行处理SGA和 data files的交互 
                    2:control files  用于数据库启动,记录了数据库中各个文件的位置,以及oracle创建的时间戳, 检查点等信息。
                     Control file, necessary for database startup. "A binary file that records the physical structure of a database                         and  contains the names and locations of redo log files, the time stamp of the database creation, the                             current       log sequence number, checkpoint information, and so on." [8]
                    3:redo files  主要用于存储以后恢复数据库的文件,用于回滚和数据库恢复  通过 LGWR 进程和SGA 交互。
                    4:Archive log files: These files are copies of the redo log files, but are usually stored at different locations. They are necessary for example to be applied to a standby database, or to perform recovery after a media failure. It is possible to archive to multiple locations.
-----------------------------------------------------------------------------------------------------------------------------------
Oracle Server  包括: ORACLE instance 和 oracle database
  backgroud process  主要是为了处理oracle 服务器文件。 包括了以上提到的很多进程。
  server process  主要负责和客户端负责连接。
  password file: 客户端链接后台数据库的时候的口令的存储。

查看SGA 大小sql语句:        select  component, granule_size from v$sga_dynamic_components 
-----------------------------------------------------------------------------------------------------------------------------------

2:PGA :    Program  global area  多个后台进程就多个pga


process Struture:
  user process  客户端的进程    example: sql/plus  或者 pl/sql 或者 toad 等的进程。
  server process 服务器端进程,主要用于和 user process进行交互的进程。  主要处理和客户端进程进行通讯。
  backgroud process  用于处理后台SGA中的数据和数据库的物理存储文件的交互。
一个形象的比喻:            backgroud process 工厂的工人,
                           server process  负责销售工人生产的产品
                           user process 就是销售对应的客户。   SGA 就是相当于生产线:一大块内存
主要有:
  DBWn : Database Writer  把Database buffer cache 写成数据文件
 LGWR:  Log Writer 用于 把 Redo Log Buffer中的信息写到 Redo Log files中,
 SMON: System monitor  用于不正当关闭时候oracle的恢复和清理
 PMON; Process monitor 用于监视进程,如果有个进程垮掉了,用于杀死进程再生成新进程。
 CKPT:  checkpoint  用于帮助LGWR进程工作。

关于客户端和服务器端通讯协议的问题:
 当客户端和服务器不在同一个机器上时   两个不同的物理机上的通讯 走的是TCP/ip协议。

如果客户端和服务器在同一个机器上:
                同一个机器 上的客户端和服务器通过IPC进行通讯和TCP/IP通讯
                IPC : Inter  process comunication 包括: 共享内存,队列,信号量等几种形式. (内部进程通讯协议)

数据库文件逻辑结构之间的关系:
          一个数据库中有多个 tablespace组成,一个tablespace有多个segment
组成,一个segment 又多个extent组成, 一个extent 由多个blocks组成,
block是oracle最小的单元,他们之间的关系 这个过程查资料。
 
 

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值