2012-10-16 11gR2 concepts page 245 - 292


Row Format


Row Header
The row header contains information such as the following:
 -- Columns in the row piece
 -- Pieces of the row located in other data blocks
If an entire row can be inserted into a single data block, then Oracle Database
stores the row as one row piece. However, if all of the row data cannot be inserted
into a single block or an update causes an existing row to outgrow its block, then
the database stores the row in multiple row pieces (see "Chained and Migrated
Rows" on page 12-16). A data block usually contains only one row piece per row.
 -- Cluster keys for table clusters (see "Overview of Table Clusters" on page 2-20)

Each row has a slot in the row directory of the data block header. The slot points to the
beginning of the row.

 

Rowid Format

 

Coalescing Fragmented Space
Oracle Database automatically and transparently coalesces the free space of a data
block only when the following conditions are true:
 -- An INSERT or UPDATE statement attempts to use a block that contains sufficient
free space to contain a new row piece.
 -- The free space is fragmented so that the row piece cannot be inserted in a
contiguous section of the block.

 

User Segments -- 用户段
Examples of user segments include:
 -- Table, table partition, or table cluster 表,表分区,簇表
 -- LOB or LOB partition -- LOB
 -- Index or index partition -- 索引和索引分区

 

User Segment Creation -- 段的创建
By default, the database uses deferred segment creation to update only database
metadata when creating tables and indexes. Starting in Oracle Database 11g Release 2
(11.2.0.2), the database also defers segment creation when creating partitions. When a
user inserts the first row into a table or partition, the database creates segments for the
table or partition, its LOB columns, and its indexes.

11GR2,段延迟创建。

 

You can use the DBMS_SPACE_ADMIN package to manage segments for empty objects.
Starting with Oracle Database 11g Release 2 (11.2.0.2), you can use this PL/SQL
package to do the following:
 -- Manually materialize segments for empty tables or partitions that do not have
segments created
 -- Remove segments from empty tables or partitions that currently have an empty
segment allocated

 

Undo Segments -- 回滚段
Oracle Database uses undo to do the following:
 -- Roll back an active transaction
 -- Recover a terminated transaction
 -- Provide read consistency
 -- Perform some logical flashback operations


How an Instance Is Started -- 实例的启动过程
When Oracle Database starts an instance, it performs the following basic steps:
1. Searches for a server parameter file in a platform-specific default location and, if
not found, for a text initialization parameter file (specifying STARTUP 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
4. Starts the Oracle background processes
5. Opens the alert log and trace files and writes all explicit parameter settings to the
alert log in valid parameter syntax


Purpose of Checkpoints -- 检查点的作用
Oracle Database uses checkpoints to achieve the following goals:
 -- Reduce the time required for recovery in case of an instance or media failure
 -- Ensure that dirty buffers in the buffer cache are written to disk regularly
 -- Ensure that all committed data is written to disk during a consistent shutdown

 

When Oracle Database Initiates Checkpoints -- 发检查点的几个条件
Oracle Database uses the following types of checkpoints:
 -- Thread checkpoints
The database writes to disk all buffers modified by redo in a specific thread before
a certain target. The set of thread checkpoints on all instances in a database is a
database checkpoint. Thread checkpoints occur in the following situations:
– Consistent database shutdown -- 完全关机
– ALTER SYSTEM CHECKPOINT statement
– Online redo log switch -- 日志切换
– ALTER DATABASE BEGIN BACKUP statement


 -- Tablespace and data file checkpoints
The database writes to disk all buffers modified by redo before a specific target. A
tablespace checkpoint is a set of data file checkpoints, one for each data file in the
tablespace. These checkpoints occur in a variety of situations, including making a
tablespace read-only or taking it offline normal, shrinking a data file, or executing
ALTER TABLESPACE BEGIN BACKUP.


 -- Incremental checkpoints -- 增量检查点
An incremental checkpoint is a type of thread checkpoint partly intended to avoid
writing large numbers of blocks at online redo log switches. DBWn checks at least
every three seconds to determine whether it has work to do. When DBWn writes
dirty buffers, it advances the checkpoint position, causing CKPT to write the
checkpoint position to the control file, but not to the data file headers.
Other types of checkpoints include instance and media recovery checkpoints and
checkpoints when schema objects are dropped or truncated.

Instance Recovery Phases -- 实例恢复的过程
The first phase of instance recovery is called cache recovery or rolling forward, and
involves reapplying all of the changes recorded in the online redo log to the data files.
Because rollback data is recorded in the online redo log, rolling forward also
regenerates the corresponding undo segments.

首先,ROLLING FORWARD,走日志。

 

After the roll forward, any changes that were not committed must be undone. Oracle
Database uses the checkpoint position, which guarantees that every committed change
with an SCN lower than the checkpoint SCN is saved on disk. Oracle Database applies
undo blocks to roll back uncommitted changes in data blocks that were written before
the failure or introduced during cache recovery. This phase is called rolling back or
transaction recovery.

再来,才是ROLL FORWARD。回滚。

 

 

 

 

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值