Solved

loading 20 million rows in Oracle

Posted on 2011-03-03
5
657 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.

Join & Write a Comment

I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
Via a live example, show how to take different types of Oracle backups using RMAN.
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

707 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now