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

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.


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

WEBINAR:

On-Demand

Application Security Testing: An Integral Part of DevOps


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
×
We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.
Thanks for your registration, follow us on our social networks to keep up-to-date