了解Oracle内核代码层的作用

Oracle RDBMS Kernel 的代码分成多层次,如<Oracle8i Internal Services>一书所介绍的:

oracle_kernel_layer

其中部分代码层的作用:

The cache layer (KC)

The cache layer manages the database buffer cache. It uses operating
system dependent facilities for data file I/O, provides concurrency control
facilities for local access to the cache buffers, and provides parallel cache
management (PCM) instance locking facilities for Oracle parallel server.
The other main responsibility of the cache layer is the control of redo
generation into the log buffer, and the writing of redo to the log files. The
cache layer also caches control file information.

  • To read blocks.
  • To update blocks in redo only mode.

The transaction layer (KT)

This layer is responsible for the allocation of transactions to rollback
segments, interested transaction list changes within data blocks, changes
to rollback segment blocks for undo generation, transaction control
facilities such as savepoints, and read consistency. The transaction layer is
also responsible for space management, both at the level of segment free
lists and at the level of tablespace extent allocation.

  • To update blocks with undo.
  • To check with the status of the transaction.
  • To manage recursive transactions for nested space operations.

The recursive program interface (RPI)

The recursive program interface is used to populate the dictionary cache
from the data dictionary. Row cache recursive SQL statements are
executed in a separate call context, but are not parsed and optimized in the
compilation layer.

Row Cache Layer

  • To read/update space dictionary information, where acutal updates happens by callbacks when row cache is flushed.

Recursive SQL

  • To read/update dictionary information.

File Layer

  • To create/drop/alter files in tablespace.

 

以上各代码层实现了Oracle Space Management 空间管理的主要功能。

VIEW:X$KCCRS-Controlfile Record Section directory (8.0 – 8.1)

View:   X$KCCRS
          [K]ernel [C]ache [C]ontrolfile management
             controlfile [R]ecord [S]ection directory

  Column      Type           Description
  --------    ----           -----------
  ADDR        RAW(4)         address of this row/entry in the SGA

  INDX        NUMBER         control file record type
    The following are the non-circular-reuse record types:
       KCCDEDBI     0             DataBase Info record
       KCCDECKP     1             Checkpoint progress
       KCCDERTH     2             Redo THread record
       KCCDELOG     3             LOgFile record
       KCCDEDBF     4             DataBase File record
       KCCDENAM     5             file NAMe record
       KCCDETBS     6     8.x     TaBleSpace record
       KCCDERS1     7     8.0     reserved for future use. non-circular re-use
       KCCDETFL     7     8.1     Temporary File record
       KCCDERS2     8     8.x     reserved for future use. non-circular re-use
       KCCDERMC     8     9.x     RMan Configuration record

    The following are the circular-Reuse record types:
       KCCDELHR     9     8.x     Log History Record
       KCCDEORR    10     8.x     Offline Range Record
       KCCDEALR    11     8.x     Archived Log Record
       KCCDEBSR    12     8.x     Backup Set Record
       KCCDEBPR    13     8.x     Backup Piece Record
       KCCDEBFR    14     8.x     Backup dataFile Record
       KCCDEBLR    15     8.x     Backup redoLog Record
       KCCDEDCR    16     8.x     Datafile Copy Record
       KCCDEFCR    17     8.x     backup dataFile Corruption Record
       KCCDECCR    18     8.x     datafile Copy Corruption Record
       KCCDEDLR    19     8.x     DeLeted object Record
       KCCDERS3    20     8.0      reserved for future use. circular re-use.
       KCCDEPCR    20     8.1     proxy copy record
       KCCDERS4    21     8.x     reserved for future use. circular re-use.
       KCCDENEN     6     7.3     actual # entry types in control file
       KCCDEMEN    10     7.3     max possible # entry types in control file
       KCCDEMNR     9     8.x     MiNimum circular-Reuse record type
       KCCDEMXR    21     8.x     MaXimum circular-Reuse record type
       KCCDEMAX    22     8.x     MAX # record types in current format

  INST_ID     NUMBER         oracle instance number
  RSLBN       NUMBER         Logical Blk Number (base 1) of section start
  RSRSZ       NUMBER         Record SiZe in bytes
  RSNUM       NUMBER         NUMber of usable record slots in section
  RSNUS       NUMBER         circ-reuse: Number of in-USe slots in section
                             non-circ-reuse: highest USed slot Number
  RSIOL       NUMBER         circ-reuse: Index (base 1) of OLdest (init 0)
  RSILW       NUMBER         circ-reuse: Index of Last Written    (init 0)
  RSRLW       NUMBER         circ-reuse: Recid of Last Written    (init 0)
                             non-circ-reuse: incr'd by kccicr()   (init 0)

沪ICP备14014813号

沪公网安备 31010802001379号