设为首页 加入收藏

TOP

Direct-PathINSERT(直接路径插入)(一)
2014-11-24 00:44:03 来源: 作者: 【 】 浏览:43
Tags:Direct-PathINSERT 直接 路径 插入

下面我们来看一下到底什么是直接路径以及使用直接路径的优势和限制。文章截自“Oracle Database Administrator's Guide11g Release 2 (11.2)”(当然中文注解不是官方文档中的)

Improving INSERT Performance with Direct-Path INSERT

When loading large amounts of data, you can improve load performance by using direct-pathINSERT.

##当我们加载大量数据的时候,可以使用direct-path INSERT来提高处理性能

This section contains:

About Direct-Path INSERT

How Direct-Path INSERT Works

Loading Data with Direct-Path INSERT

Specifying the Logging Mode for Direct-Path INSERT

Additional Considerations for Direct-Path INSERT

About Direct-Path INSERT

Oracle Database inserts data into a table in one of two ways:

##Oracle数据库向表中插入数据有如下两种方式(传统路径和直接路径):

During conventional INSERT operations, the database reuses free space in the table, interleaving newly inserted data with existing data. During such operations, the database also maintains referential integrity constraints.##使用传统路径方式插入数据,数据库会利用表中已有的空闲空间,新老数据是交叉在一起的,同时在插入的过程中会维护引用完整性约束

During direct-path INSERT operations, the database appends the inserted data after existing data in the table. Data is written directly into data files, bypassing the buffer cache. Free space in the table is not reused, and referential integrity constraints are ignored. Direct-path INSERT can perform significantly better than conventional insert.##使用直接路径方式插入数据,数据库在表中已有数据之后追加数据(即直接使用高水位线以上的新块,不会像传统路径一样去扫描高水位线以下的空闲块使用)。数据绕过buffer cache直接写进数据文件。高水位线以下的空闲空间不会被使用,表的完整性约束会被忽略。相对于传统路径插入,直接路径插入效率提高很显著。

The database can insert data either in serial mode, where one process executes the statement, or in parallel mode, where multiple processes work together simultaneously to run a single SQL statement. The latter is referred to as parallel execution.

##数据库能够以串行模式插入数据,也能够以并行模式插入数据,并行模式也就是并行执行

The following are benefits of direct-path INSERT:

##下面列出了direct-path INSERT的优势:

During direct-path INSERT, you can disable the logging of redo and undo entries to reduce load time. Conventional insert operations, in contrast, must always log such entries, because those operations reuse free space and maintain referential integrity.##使用直接路径加载数据时你可以禁止产生redo和undo的日志,以此来缩短加载时间。相比之下传统路径加载总是会产生这些日志条目。

Direct-path INSERT operations ensure atomicity of the transaction, even when run in parallel mode. Atomicity cannot be guaranteed during parallel direct-path loads (using SQL*Loader).##Direct-pathINSERT操作能够确保事物的原子性,即使使用并行模式。但是direct-path loads(using SQL*Loader)不能保证事物的原子性。

When performing parallel direct-path loads, one notable difference between SQL*Loader andINSERT statements is the following: If errors occur during parallel direct-path loads with SQL*Loader, the load completes, but some indexes could be markedUNUSABLE at the end of the load. Parallel direct-path INSERT, in contrast, rolls back the statement if errors occur during index update.##当使用parallel direct-path loads时,需要注意的是,和direct-path INSERT不一样,如果在使用SQL*Loader进行parallel direct-path loads数据导入时出错,那么数据导入完成,但是索引会被标记为失效。相比之下Parallel direct-path INSERT如果在更新索引的时候出错,那么事物会回滚。

Note:

A conventional INSERT operation checks for violations of NOTNULL constraints during the insert. Therefore, if a NOTNULL constraint is violated for a conventional INSERT operation, then the error is returned during the insert. A direct-pathINSERT operation checks for violations of NOT NULL constraints before the insert. Therefore, if aNOT NULL constraint is violated for a direct-path IN
首页 上一页 1 2 3 4 5 下一页 尾页 1/5/5
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇linux中ERROR:Thepartitionwith/v.. 下一篇GoldenGate之update操作节点间不..

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: