Solved

loading 20 million rows in Oracle

Posted on 2011-03-03
5
659 Views
Last Modified: 2012-06-14
A batch process needs to load 20 million rows from a database table on server 1 , to a database table on server 2.  Both databses are running  on Oracle 10.1.0.5  .
The database column names, definitions and attributes on source and target tables are identical. Other than data pump, do we have any other tools/options available within Oacle to do this?

Thanks...
0
Comment
Question by:Veera_8
5 Comments
 
LVL 4

Expert Comment

by:MarioAlcaide
ID: 35028385
Hi,

You could make a DBlink from server2 to server1, and make a CREATE TABLE AS SELECT * FROM table_name@db_link;

I think that will be the fastest way.

Regards
0
 
LVL 18

Accepted Solution

by:
sventhan earned 250 total points
ID: 35028432
You can use SQL Plus COPY command.

This does not require DBlink and its over the wire and please check for any restrictions

http://download.oracle.com/docs/cd/B10501_01/server.920/a90842/apb.htm
0
 
LVL 23

Expert Comment

by:paquicuba
ID: 35031868
Use NOLOGGING with CTAS if you cannot use Oracle data pump as advised above

create table tab nologging as select * from tab@link
0
 
LVL 2

Assisted Solution

by:choukssa
choukssa earned 250 total points
ID: 35041347
If possible, you can use imp/exp or impdp/expdp to get the data exported from source db and imported in destination db.  I am demonstrating expdp

You will have to create a directory
CREATE OR REPLACE DIRECTORY SCOTT_EXP_DIR  AS '/data/backups/scott'

Open in new window


Export the table from the schema

expdp schemas=SCOTT directory=SCOTT_EXP_DIR TABLES=MY_TAB1 dumpfile=MY_TAB1.dmp logfile=MY_TAB1.log

Open in new window


Import the table from the schema

impdp schemas=MARTIN directory=SCOTT_EXP_DIR TABLES=MY_TAB1 dumpfile=MY_TAB1.dmp logfile=MY_TAB1.log TABLE_EXISTS_ACTION=REPLACE

Open in new window

if the table name is same then use the switch TABLE_EXISTS_ACTION =  APPEND or REPLACE
else if it a different then get this table imported when do a  insert from select query and get rid of the table once done

--choukssa
0
 
LVL 76

Expert Comment

by:slightwv (䄆 Netminder)
ID: 35041351
choukssa,

From the original question: "Other than data pump,"
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question