Skip to Main Content
  • Questions
  • Need to know difference between COPY command & Direct path inserts

Breadcrumb

Question and Answer

Tom Kyte

Thanks for the question, Sandeep.

Asked: September 20, 2004 - 8:02 am UTC

Last updated: September 20, 2004 - 10:37 am UTC

Version: 8.1.7

Viewed 1000+ times

You Asked

Hi,

I have gone through the questions regarding COPY command, previously asked on this site.

I was little bit confused about the difference between COPY and a insert /*+ APPEND*/ statement.

1. As I understand Insert with Append hint will bypass Buffer cahe, Undo generation
2. Direct path will always write after HWM
If huge amount of data is being loaded to a particular table and there are some deletions too, then this will be a disadvantage as it will never bring down the HWM.

I just wanted to confirm whether COPY also skips UNDO & buffer cache and it also always writes afte HWM? or whether it acts just like normal insert command with bulk fetch feature.

I did not find this information in the documentation. Please help.



and Tom said...

sqlplus COPY just array fetches from table1 and array inserts into table2 using conventional path inserts.


it is a normal insert with bulk collects.

Rating

  (2 ratings)

Is this answer out of date? If it is, please let us know via a Comment

Comments

sandeep, September 20, 2004 - 9:18 am UTC


using COPY from PL/SQL

sandeep, September 20, 2004 - 9:24 am UTC

Tom,

we need to do certain data cleansing operations on the data fetched using copy before it can be loaded to final table. DB link would have helped but it is not allowed due to some reason.

we also need to schedule data copying from one database to other on a weekly basis.

SO Is there any way we can execute COPY command from a PL/SQL procedure or package ?


Tom Kyte
September 20, 2004 - 10:37 am UTC

you can implement copy -- copy is a sqlplus command.

to do your own copy, you bulk collect and bulk insert.


copy, the command, is a SQLPlus command only. you would use sqlplus to invoke it.

More to Explore

Hints

Need more information on hints? Check out the complete hint descriptions