DBAsupport.com Forums - Powered by vBulletin
Results 1 to 6 of 6

Thread: extracting data

  1. #1
    Join Date
    Aug 2000
    Location
    NY
    Posts
    37

    Red face

    Hello people,
    I want to extract say 50% of data from every table in the production database to the development database. I have written scripts that will do this(i.e. scripts to create the the tables in the developpment DB and extract the 50% data from Production DB to Develpment DB)
    My questios is can any one tell me how to go about this scenario?

    thanks,
    charity

  2. #2
    Join Date
    May 2000
    Location
    OHIO
    Posts
    20
    You could do this, when there is not a lot of users logged on to the database, so that way it does not effect performance

    If u are using a tool to extract Data, It would make it eazier
    Or if u are just running sql code, takes a long time.


    ETI

    Rahul Khana

  3. #3
    Join Date
    Aug 2000
    Location
    NY
    Posts
    37
    I am using a pl/sql script. But my question is how do I link the two databases? I'm assuming that I have to create a link. But after creating the link, what is my next step. Do I have to specify the DB_link in the pl/sql script and run the pl/sql script or what?

    I will be glad if you can go over this systematically(step by step)

  4. #4
    Join Date
    May 2000
    Location
    Alex, Egypt
    Posts
    41
    After you create the database link you will have to :

    insert into dev_table
    select * from prod_table@prod_link
    where rownum<1000

    prod_link is the name that you gave to the database link.

    dev_table is the name of the table on you r development environment,
    and prod_table, is the production table name,
    most probably dev_table=prod_table.
    Amir Magdy

  5. #5
    Join Date
    Jun 2000
    Posts
    417
    You could also export/import but it's kind of all or nothing, not 50%.

    You could also spool the output to a flatfile, or a sql file and insert it to the database if you didn't want to use the dblink.

  6. #6
    Join Date
    Nov 2000
    Posts
    15
    hello charity,

    just a warning... be sure to consider the foreign key constraints of every table that you are going to load.
    you might end up not loading all of them...i.e, if you are really sure to load only 50% data of every table....or maybe you could load first without the constraints then after inserting the records create the constraint...with this, you could easily determin what rows violated the constraints...

    good luck!!!

    Cardinal
    "Let's get it on..."

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