Chinaunix首页 | 论坛 | 博客
  • 博客访问: 313323
  • 博文数量: 54
  • 博客积分: 1400
  • 博客等级: 上尉
  • 技术积分: 606
  • 用 户 组: 普通用户
  • 注册时间: 2006-12-03 22:43
文章分类
文章存档

2011年(3)

2010年(26)

2009年(2)

2008年(23)

我的朋友

分类: Oracle

2008-12-10 11:02:35

声明:
以下内容为网络整理的结果
+++++++++++++++++++++++++++++++++++++
oracle Rdb
oracle Rdb是一种功能完备的关系数据库管理系统,用于OpenVMS平台上主要的应用程序。
在1994年Rdb并入oracle公司。oracle已经对它进行了很大的增强(oracle已经开发超过50%的代码库),它专注于支持大规模生产应用程序和高性能的事务处理。
Rdb的技术优势包括:
  1. 极其卓越的性能,可提供满足实际需要的超打吞吐率
  2. 极高的可靠性,可提供数据安全性和数据库正常运行时间
  3. 极高的的可用性,使计划维护所造成的停机时间需求降至最少
  4. 简便的可维护性
  5. 每项事务成本降低

 

oracle为rdb制定的将来计划非常直接-保持对质量和稳定性的严格关注,同时对客户已经在世界范围的生产环境中所部署的特性进行增强。
同时,oracle还通过支持其他的oracle技术增加了对rdb的投入,包括oracle9/数据库和oracle/应用服务器。开发人员和最红用户可使用oracle工具进行应用程序的开发,即席查询,决策支持和Internet应用程序的部署。

++++++++++++++++++++++++++++++++++++++++

oracle的隔离级别

 

SET TRANSACTION
[NAME hostvar]
[READ WRITE | READ ONLY]
[ [ISOLATION LEVEL] { SNAPSHOT [TABLE STABILITY]| READ COMMITTED [[NO] RECORD_VERSION] } ]
   [WAIT | NO WAIT]
   [LOCK TIMEOUT seconds]
   [NO AUTO UNDO]
   [IGNORE LIMBO]
   [RESERVING <tables> | USING <dbhandles>]

<tables> ::= <table_spec> [, <table_spec> ...]

<table_spec> ::= tablename [, tablename …]
                      [FOR [SHARED | PROTECTED] {READ | WRITE}]

<dbhandles> ::= dbhandle [, dbhandle …]

l         隔离级别了事与事的隔离程度。

l         隔离级别与并性是互矛盾的:隔离程度越高,数据的并性越差;隔离程度越低,数据的并性越好。

l         ANSI/ISO SQL92准定了一些数据操作的隔离级别

l          未提交read uncommitted

l          提交read committed

l          复读repeatable read

l          序列化(serializable

l         一些象,可以反映出隔离级别的效果。象有:

l          更新失(lost update):当系两个事更新同一数据是,生更新失。

l          脏读dirty read):当一个事务读取另一个事尚未提交的修改脏读

l          非重复读nonrepeatable read):同一查询在同一事中多次行,由于其他提交事所做的修改或除,次返回不同的果集,此时发生非重复读(A transaction rereads data it has previously read and finds that another committed transaction has modified or deleted the data.  )

l          幻像(phantom read):同一查询在同一事中多次行,由于其他提交事所做的插入操作,次返回不同的果集,此时发生幻像(A transaction reexecutes a query returning a set of rows that satisfies a search condition and finds that another committed transaction has inserted additional rows that satisfy the condition.  )

l         下面是隔离级别及其对应的可能出或不可能出

 

Dirty Read 

NonRepeatable Read 

Phantom Read 

Read uncommitted

Possible

Possible

Possible

Read committed

Not possible

Possible

Possible

Repeatable read

Not possible

Not possible

Possible

Serializable

Not possible

Not possible

Not possible

 

 

ORACLE的隔离级别

 

l         ORACLE提供了SQL92准中的read committedserializable,同提供了非SQL92准的read-only

l          read committed

l         ORACLE缺省的事隔离级别

l         中的一条句都遵从一致性。

l         不会脏读;但可能出非重复读和幻像。

l          serializable

l         简单serializable就是使事看起来象是一个接着一个地序地行。

l         仅仅能看在本事务开始前由其它事提交的更改和在本事中所做的更改。

l         不会出非重复读和幻像。

l         Serializable隔离级别提供了read-only所提供的一致性(事务级一致性),同又允DML操作。

l         如果有在serializable务开未提交的事serializable务结束之前修改了serializable将要修改的行并行了提交,serializable不会更,因此生无法序列化访问错误。(方法:只要在serializable务开始到束之有其他事务对serializable要修改的西行了修改并提交了修改,则发生无法序列化访问错误。)

l         If a serializable transaction contains data manipulation language (DML) that attempts to update any resource that may have been updated in a transaction uncommitted at the start of the serializable transaction, (并且修改在后来被提交而没有回),then the DML statement fails. 返回的错误ORA-08177: Cannot serialize access for this transaction

l         ORACLE在数据记录最近数据行行修改操作的N个事的信息,目的是确定是否有在本事务开未提交的事修改了本事将要修改的行。具体英文:Oracle permits a serializable transaction to modify a data row only if it can determine that prior changes to the row were made by transactions that had committed when the serializable transaction began. To make this determination efficiently, Oracle uses control information stored in the data block that indicates which rows in the block contain committed and uncommitted changes. In a sense, the block contains a recent history of transactions that affected each row in the block. The amount of history that is retained is controlled by the INITRANS parameter of CREATE TABLE and ALTER TABLE. Under some circumstances, Oracle may have insufficient history information to determine whether a row has been updated by a "too recent" transaction. This can occur when many transactions concurrently modify the same data block, or do so in a very short period. You can avoid this situation by setting higher values of INITRANS for tables that will experience many transactions updating the same blocks. Doing so will enable Oracle to allocate sufficient storage in each block to record the history of recent transactions that accessed the block.

l          The INITRANS ParameterOracle stores control information in each data block to manage access by concurrent transactions. Therefore, if you set the transaction isolation level to serializable, you must use the ALTER TABLE command to set INITRANS to at least 3. This parameter will cause Oracle to allocate sufficient storage in each block to record the history of recent transactions that accessed the block. Higher values should be used for tables that will undergo many transactions updating the same blocks.

l          read-only

l         遵从事务级一致性,仅仅能看在本事务开始前由其它事提交的更改。

l         不允在本事DML操作。

l         read onlyserializable的子集。它都避免了非重复读和幻像。区是在read only中是只;而在serializable中可以DML操作。

l         Export with CONSISTENT = Y sets the transaction to read-only.

l          read committedserializable的区系:

l         1先于事2始,并保持未提交状。事2想要修改正被事1修改的行。事2等待。如果事12(不read committedserializable方式)行它想要做的修改。如果事1提交,当事2read committed方式行它想要做的修改;当事2serializable方式,失报错“Cannot serialize access”2看不1提交的修改,且事2想在事一修改的基上再做修改。具体英文:Both read committed and serializable transactions use row-level locking, and both will wait if they try to change a row updated by an uncommitted concurrent transaction. The second transaction that tries to update a given row waits for the other transaction to commit or roll back and release its lock. If that other transaction rolls back, the waiting transaction (regardless of its isolation mode) can proceed to change the previously locked row, as if the other transaction had not existed. However, if the other (blocking) transaction commits and releases its locks, a read committed transaction proceeds with its intended update. A serializable transaction, however, fails with the error "Cannot serialize access", because the other transaction has committed a change that was made since the serializable transaction began.

l         read committedserializable可以在ORACLE并行服器中使用。

l          SET TRANSACTION READ WRITEread writeread committed 应该是一的。在方面,它都避免了脏读,但都无法实现复读然没有文档read write在写方面与read committed一致,但然它在写的候会加排他以避免更新失。在加程中,如果遇到待源无法定,应该是等待而不是放弃。read committed一致。

l         一致性

l          ORACLE证语一致性,即一个句所理的数据集是在时间点上的数据集,时间点是始的时间

l          一个句看不在它行后提交的修改。

l          DML句,它看不由自己所做的修改,即DML句看的是它本身行以前存在的数据。

l         务级一致性

l          务级一致性保了可重复读,并保不会出幻像。

l         置隔离级别

l          置一个事的隔离级别

l         SET TRANSACTION ISOLATION LEVEL READ COMMITTED;

l         SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;

l         SET TRANSACTION READ ONLY;

l         置增个会的隔离级别

l         ALTER SESSION SET ISOLATION_LEVEL SERIALIZABLE;

l         ALTER SESSION SET ISOLATION_LEVEL READ COMMITTED;

 

阅读(3276) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~