Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

table copy from one database to another 2

Status
Not open for further replies.

TheDash

MIS
Mar 25, 2004
171
US
Hello members,
In order to copy data from one table to another via dblink, using insert into select * from syntax, what are the limitations in doing that? Is it a slow approach? Thanks in advance.
 
TheDash said:
Is it a slow approach?
As you can imagine, "slow" is a relative term. Although there may be some faster alternative in terms of "bits per second", when you consider the time savings of ease of use of a db link, then it's probably comparatively fast.

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
[I provide low-cost, remote Database Administration services: www.dasages.com]
“Beware of those that seek to protect you from harm or risk. The cost will be your freedoms and your liberty.”
 
Or - as we all have probably said at least once - "it depends".
 
The most well-known limitation of the "insert into ... select * from" syntax is that it doesn't work with tables that contain a long or long raw column. You will get an "ORA-00997: illegal use of LONG datatype" error.
 
...but no one should be using LONG or LONG RAW anymore. They should be using some form of LOB such as CLOB, which does work with "INSERT INTO...SELECT...".

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
[I provide low-cost, remote Database Administration services: www.dasages.com]
“Beware of those that seek to protect you from harm or risk. The cost will be your freedoms and your liberty.”
 
Advising against the use of long and long raw columns is all very well, but doesn't exactly correspond to the real world. In fact, I note that in one of my 10g databases, there are 223 objects in the system catalog that have these two data types. That includes such well known catalog views as dba_triggers and dba_tab_columns.

In any case, this thread has to do with restrictions on copying data across a db link with "insert into ... select from" syntax. The problem with long and long raw columns is one such restriction. Because of it, it's best to have an alternative approach in mind for when it's needed. Export/import works with longs and, as I recall, Turkbear's suggestion of the SQL*Plus copy command does too.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top