Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


advertisement
 

Cloning Data Accurately and Randomly

This task of data cloning is quite common in any testing or tuning environment. Obviously, it requires some technique to automate it.


advertisement
ecently I encountered a couple of Oracle-tuning projects that required me to evaluate the performance of PL/SQL and SQL code. I had to generate a substantial amount of data from existing data in a table—say from 500 rows to 500,000 rows. In my case, each record represented a participant in a certain time period and any modification of the participant's attribute triggered the creation of a new record for the same participant at a new time period.

As you can see, the number of participants and the frequency of modifications determined the data size. My task was to develop a mechanism for generating data for different modifications scenarios: 10 percent of participants getting modified per time period, then 30 percent, 50 percent, etc. In addition, modifications had to be done randomly in order to emulate real-life data.

This task of data cloning is quite common in any testing or tuning environment. Obviously, it requires some technique to automate it.



How do you easily generate a random sample of data from existing data in a table?



Develop code that clones your data:

  1. Use Oracle's standard DBMS_RANDOM package to create a random number generator.
  2. Create a custom package that extracts sample data accurately and randomly.


Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date