Oracle学习笔记<<2>>

Oralce Architectural Components
Meroy Structure
    Oracle’s memory structure consists of two memory areas known as :
    System Grobal Area(SGA):allocated at instance start up,and is  fundamental component of an Oralce instance
    Program Global Area(PGA):allocated where the server process is started


SGA:System Grobal Area
    Is dynamic,sized
    Size by the SGA_MAX_SIZE parameter
    Allocated and tracked in granules by SGA components
        Contiguous virtual memory allocation
        Granule size based on total estimated SGA_MAX_SIZE
    SGA可以动态改变,最大的尺寸可以通过SGA_MAX_SIZE来改变。Granules是SGA的最小单位。SGA是连续的内存区域,并且最大不能超过  SGA_MAX_SIZE.
    可以通过show sga 查看SGA 大小.
    可以通过语句
     select component,granule_size from v$sga_dynamic_components.
    查看granule的大小

    1.The SGA consists of several memory structures:
       Shared Pool: SHARED_POOL_SIZE
       Database Buffer Cache:  DB_CACHE_SIZE
       Redo Log Buffer: LOG_BUFFER
       Other structures(for example ,lock and latch management,statistical data)
    2.There are two additional memory structures that can be configured within the SGA:
      Large Pool: LARGE_POOL_SIZE
      Java Pool: JAVA_POOL_SIZE

Shared Pool
    Used to store
        Most recently executed SQL statements
        Most recently used data definitions
    It consists of two key performance-related memory structures:
        Library Cache
        Data Dictionary Cache
    Sized by the parameter
    每一个SQL将被解析,制定执行计划。解析SQL语句被存到共享池中。包含两部分重要内容。为Library Cache和Data Dictionary Cache


    Library Cache
    Stores information about the most recently used SQL and PL/SQL statements
    Enables the sharing of commonly used statements
    Is manager by a least recently user(LRU) algorithm
    Consists of  two structures:
          Shared SQL area
          Shared PL/SQL area
    Size determined by the Shared Pool sizing
    存储的是经过编译解析后的SQL语句和PL/SQL语句的内容.
    包含两部分。一部分是SQL area ,一部分是PL/SQL area
    大小由Shared Pool 管理

Data Dictionary Cache
    A collection of the most recently used definitions in the database
    Includes information about database files, tables , indexes , columns , users, privileges ,and others database objects.
    During the parse phase ,the server process looks at the data dictionary for information to resolve object names and validate access
Improves response time on queries and DML
    Size determined by the  Shared Pool sizing.
    数据字典是使用最频繁的,各种数据操作都需要使用到.各种数据库信息被保存在这里.用来响应各种查询和DML操作
    大小由Shared Pool 管理


Database Buffer Cache
    Stores copies of data block that have been retrieved from the data files
    Enables great performance gains when you bobtain and update data
    Manager through an LRU algorithm
    DB_BLOCK_SIZE determines primary block size
缓存数据文件中的数据。
    Consists of independent subcaches
    DB_CACHE_SIZE
    DB_KEEP_CACHE_SIZE
    DB_RECYCLE_CACHE_SIZE
    Can be dynamically resized
    DB_CACHE_ADVICE Set to gather statistics for predicting different cache size behavior
    Statistics displayed by V$DB_CACHE_ADVICE


Redo Log Buffer
    Records all changes made to the database data blocks
    Primary purpose is recovery
    Changer recorded within are called redo entries
    Redo entries contain information to reconstruct or redo changes
    Size defined by LOG_BUFFER
    主要用来恢复数据文件。每做一次操作,就会形成一个操作记录。


Large Pool
    An optional area of memory in the SGA
    Relieves the burden placed on the Shared Pool
    Used For:
    Session memory(UGA) for the Shared Server
    I/O server processes
    Backup and restore operations or RMAN
    Parallel execution message buffers
    PARALLEL_ATUOMATIC_TUNING set to TRUE
    Dose not use an LRU list
    Sized by LARGE_POOL_SIZE
    Can be dynamically resized


JAVA Pool
    Services parsing requirements for java commands
    Requied if installing and using java
    Size by JAVA_POOL_SIZE parameter


PGA: Program Global Area
    Memory reserved for each user process connecting to an Oracle database
    Allocated when a process is created
    Deal located when the process is terminated
    Used by only one process

你可能感兴趣的:(oracle,sql,SQL Server,cache,performance)