数据库知识整理

1 OV of Primary Components (主要组件的概述)
   Oracle Server: Consists of an Oracle instance and an Oracle database
   Instance:Consists of memory and background process structures
      PGA: Program Global Area
      SGA: System Global Area
        SGA_MAX_SIZE 参数,指定SGA 的最大值     
        granule: oracle 的内存单位
***** select component, granule_size form v$sga_dynamic_components;
           @ Shared Pool :
              Used to store: Most recently executed SQL statements
                             Most recently used data definitions
                  @Library Cache: Stroes information about the most recently used SQL and PL/SQL statements
                  @Data Dictionary Cache
           @ Database Buffer Cache : Stores copies of data blocks that have been retrieved form the data files

           @ Redo Log Buffer : Records all changes made to the database data blocks

           @ Java Pool :
           @ Large Pool :
      PMON :
      SMON :
      DBWn :
      LGWR : write Redo Log Buffer to Redo Log files.
      CKPT :
      Others :
          ARCn : write Redo log files to Archived redo log files.

   Database: a collection of data
       Data files
       Control files
       Redo Log files
       Parameter file: 定义数据库的参数
       Archived Log files
       Password file

***** ps -ef   :  察看进程
u01/oradata/wilson 中存放数据文件, 其中.ctl 为控制文件;dbf数据文件;log日志文件
***** 启动oracle
      sqlplus /nolog  进入sqlplus
      conn / as sysdba
      startup  启动oracle
***** 启动linsoner : lsnrctl start
***** ! : 进入shell 下
*****  ipcs : 察看内存状态的
***** exit : 回到 sqlplus 中
***** show sga; sqlplus查看sga

Logical Structure
    Tablespace
    Segment
    Extent
    Block

Processing SQL Statements:
    1 安全检查
    2 解析sql
    3 绑定变量
    4 执行
    5 返回
    type Sql statement
        1 Queries return rows
        2 DML statements log changes
        3 Commit ensures transation recovery


3 Manage oracle instanse
  (1)Initialization Parameter Files
     Static parameter file, PFILE
     目录:$ORACLE_HOME/dbs
     initSID.ora
     Persistent server parameter file, SPFILE
***** desc v$parameter;  察看参数表
***** show parameter pga_ag;   察看pga_ag 参数
Thomas Kyte : Oracle expert, Expert oracle Database Architecture
     (2) spfileSID.ora
     修改值:alert system set parameter=value <comment='text'><deferred><scope=memory|spfile|both><sid='sid|*'>
     参数存储在 v$parameter 视图中

STARTUP :启动数据库
     共四个状体:
     1  shutdown 
         startup nomount
     2  nomount
         alert database mount;
     3  mount
         alert database open;
     4  open



    
***** strings spfilewilson.ora | more
IPC: Inter Process Communication, 包括共享内存、队列、信号量等。

你可能感兴趣的:(数据库知识整理)