设为首页 加入收藏

TOP

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

FORALL i IN 1..numrecords
  INSERT /*+ APPEND_VALUES */ INTO orderdata 
  VALUES(ordernum(i), custid(i), orderdate(i),shipmode(i), paymentid(i));
COMMIT;
Parallel Mode Inserts with SQL Statements

When you are inserting in parallel mode, direct-path INSERT is the default. However, you can insert in parallel mode using conventionalINSERT by using the NOAPPEND PARALLEL hint.

##如果你使用并行模式插入,那么默认就是直接路径。然而,你也可以通过使用NOAPPEND PARALLEL提示来强制使用传统路径进行数据插入。

To run in parallel DML mode, the following requirements must be met:

##为了运行并行模式的DML,必须满足下面的条件:

You must have Oracle Enterprise Edition installed.##你必须安装的是oracle企业版

You must enable parallel DML in your session. To do this, submit the following statement:##你必须启用会话级并行DML

ALTER SESSION { ENABLE | FORCE } PARALLEL DML;

You must meet at least one of the following requirements:##同时你必须满足下面条件中的一个

Specify the parallel attribute for the target table, either at create time or subsequently##为目标表指定并行属性(建表时指定或建表后指定)

Specify the PARALLEL hint for each insert operation##在insert插入时加aprallel提示

Set the database initialization parameter PARALLEL_DEGREE_POLICY toAUTO##把PARALLEL_DEGREE_POLICY参数设为AUTO

To disable direct-path INSERT, specify the NOAPPEND hint in eachINSERT statement. Doing so overrides parallel DML mode.

##我们可以通过使用NOAPPEND提示来禁用直接路径插入。

Note:

You cannot query or modify data inserted using direct-path INSERT immediately after the insert is complete. If you attempt to do so, an ORA-12838 error is generated. You must first issue aCOMMIT statement before attempting to read or modify the newly-inserted data. ##在direct-path INSERT完成之后,你应该首先执行commit,然后再去查询和修改表中数据。如果你在还没有提交时就去查询或者修改数据,那么会报ORA-12838错误(注意,这里说的情况是在同一个会话下,如果你在另一个会话中还是可以对表进行查询的,当前你查到数据时插入之前的数据。但是就算是另一个会话你也不能完成dml操作,因为直接路径加载会给表加排他锁)

See Also:

"Using Conventional Inserts to Load Tables"

Oracle Database Performance Tuning Guide for more information on using hints

Oracle Database SQL Language Reference for more information on the subquery syntax ofINSERT statements and for additional restrictions on using direct-pathINSERT

Specifying the Logging Mode for Direct-Path INSERT

Direct-path INSERT lets you choose whether to log redo and undo information during the insert operation.

##Direct-path INSERT允许你选择是否记录redo和undo的日志信息(这里的意思应该是指是否写redo和undo)

You can specify logging mode for a table, partition, index, or LOB storage at create time (in aCREATE statement) or subsequently (in an ALTER statement).

If you do not specify either LOGGING or NOLOGGING at these times:

The logging attribute of a partition defaults to the logging attribute of its table.##如果明确给分区指定日志属性,那么分区会继承表的日志属性

The logging attribute of a table or index defaults to the logging attribute of the tablespace in which it resides.##如果表或索引没有指定日志属性,那么会继承所在表空间的日志属性

The logging attribute of LOB storage defaults to LOGGING if you specifyCACHE for LOB storage. If you do not specify CACHE, then the logging attributes defaults to that of the tablespace in which theLOB values resides.##LOB存储要看CACHE模式,如果是CACHE模式,则默认为LOGGING属性,如果为NOCACHE,则要看其所属表空间的LOGGING属性

You set the logging attribute of a tablespace in a CREATE TABLESPACE orALTER TABLESPACE statements.

Note:

If the database or tablespace is in FORCE LOGGING mode, then direct pathINSERT always logs, regardless of the logging setting.##如果数据库或者表空间处于FORCELOGGING模式,那么无论其他的日志属性怎么设置,直接路径加载都会记录日志。
Direct-Path INSERT with Logging

In this mode, Orac

首页 上一页 1 2 3 4 5 下一页 尾页 4/5/5
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇linux中ERROR:Thepartitionwith/v.. 下一篇GoldenGate之update操作节点间不..

评论

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