直接路径INSERT Oracle [英] Direct-Path INSERT Oracle

查看:180
本文介绍了直接路径INSERT Oracle的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在阅读Oracle文档加载表格

I am reading about Direct-Path INSERT in oracle documentation Loading Tables

据记载: 在direct-path INSERT操作期间,数据库appends在表中现有数据之后插入数据.数据被直接写入数据文件,从而绕过缓冲区高速缓存.表中的可用空间不会被重复使用,并且referential integrity constraints are ignored.直接路径INSERT的性能明显优于常规插入.

It is written that : During direct-path INSERT operations, the database appends the inserted data after existing data in the table. Data is written directly into datafiles, 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.

任何人都可以向我解释一下,如何忽略参照完整性约束,根据我的理解,它将忽略referential constraint将数据加载到表中.插入后将检查参照约束.

Can anyone explain me ,how referential integrity constraints is been ignored,According to my understanding it will load the data into the table ignoring the referential constraint .and after insert it will check for referential constraint.

如果是这样,如果我这样使用.

If this is so ,if i use like this .

  FORALL i IN v_temp.first..v_temp.last save exceptions
  INSERT /*+ APPEND_VALUES */ INTO orderdata 
  VALUES(v_temp(i).id,v_temp(i).name);
 COMMIT;

Will this will gave me correct index ,in case of any exceptions and how ?.

很抱歉在一个问题中问了这么多问题,但它们相互依存.

Sorry to ask so many questions in one ,but they are releated to each other.

  1. 如何忽略约束
  2. 什么是上表中的可用空间
  3. 在出现任何异常的情况下如何给出正确的索引.

推荐答案

第一个问题确实应该是(我要/需要使用直接路径插入吗?",第二个问题应该是我的查询是否使用直接路径插入吗? ?"

The first question should really be (Do I want/need to use direct path insert?", and the second should be "Did my query use direct path insert?"

如果需要引用完整性检查,则不要使用直接路径插入.

If you need referential integrity checks, then you do not use direct path insert.

如果您不希望表被独占锁定以进行修改,则不要使用直接路径插入.

If you do not want the table to be exclusively locked for modifications, then do not use direct path insert.

如果通过删除删除数据而仅使用此代码插入,则不要使用直接路径插入.

If you remove data by deletion and only insert with this code, then do not use direct path insert.

一种快速简便的检查是否使用直接路径插入的方法是,在提交插入之前,立即从表中发出对一行的选择.如果成功,则不使用直接路径插入-如果是因为必须在会话读取表之前提交更改,则会收到一条错误消息.

One quick and easy check on whether direct path insert was used is to immediately, before committing the insert, issue a select of one row from the table. If it succeeds then direct path insert was not used -- you will receive an error message if it was because your change has to be commited before your session can read the table.

这篇关于直接路径INSERT Oracle的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆