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?
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.
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)
After you create the database link you will have to :
insert into dev_table
select * from prod_table@prod_link
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.
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.
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...
"Let's get it on..."
Click Here to Expand Forum to Full Width