Inserting a large set of INSERT Sql Script ?
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 5 of 5

Thread: Inserting a large set of INSERT Sql Script ?

  1. #1
    Join Date
    Jan 2006
    Posts
    5

    Unhappy Inserting a large set of INSERT Sql Script ?

    Hi !

    I had exported the data from a table using TOAD's export utility, which actually just created an Insert statement SQL Script for each of the 250,000 records. Now the problem is its too big a file for me to run to do the inserts.

    Is there anyway i can use this sql script to be run without timing out or hanging? I'm kind of new, so dont know how to use the bulk insert or sql*plus to do this, any help would be appreciated. Thanks!

  2. #2
    Join Date
    Sep 2002
    Location
    England
    Posts
    7,331
    have TOAD save the data as a csv file, then use sqlloader to load the data into the db, will be much much quicker than single row inserts.

    I doublt sqlplus is hanging, it it just doing a lot of work

  3. #3
    Join Date
    Nov 2001
    Location
    UK
    Posts
    152
    If you are generating millions of individual insert statements and trying to run them, this will be very inefficient. Each statement will have to be individually parsed and executed, which is a substantial overhead. If you want to load a lot of data, then you would be better off with something like sql*loader, as davey23uk says.

  4. #4
    Join Date
    Mar 2002
    Posts
    534
    depending on what you want to do you may also just create a database link in your target database refering the source database. To copy the data you would just have to execute an:
    insert /*+ append */ into target_table from source_table@source_db

  5. #5
    Join Date
    Jan 2006
    Posts
    5
    Thanks for the replies. I have a slight bit of a problem, i have deleted the table data (which is why i had exported it). I'll have to see a workaround to that.

    I ran the scripts in SQL Server, and they ran fine. So i have the data in SQL Server, so manybe i can generate CSV from there and use the sql*loader.

    I know i should have done a better job at exporing.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width