Does anyone know of a tool that can inspect a specified schema and generate random data based on the tables and columns of that schema?
SELECT columns FROM table ORDER BY RAND() LIMIT n; The RAND() function generates a random number between 0 and 1 for each row in the table and the ORDER BY clause will order the rows by their random number.
SAMPLE SQL Clause Oracle Database provides the SAMPLE clause that can be used with a SELECT statement over a table. In the following query, we're randomly selecting records from the CUSTOMERS table with a 20% probability.
Once the file is downloaded, simply right click on the Tables node in SQL Developer's tree, and select 'Import Data…' Then navigate to the file you've downloaded (you'll need to extract it from the Zip after your torrent has finished.) You should be here now.
Option 1: Perform a SQL-Loader with direct=TRUE loading the flat file into a temp table first. Then, create an index. After that load the data using Informatica PUSH Transformation into Fact table. Option 2: Using Informatica directly reading the flat file and load the data into Oracle table.
Another alternative is Swingbench Data Generator
It is useful to use the SAMPLE clause (for example generating order lines for a random combination of orders and products)
This is an interesting question. It is easy enough to generate random values - a simple loop round the data dictionary with calls to DBMS_RANDOM would do the trick.
Except for two things.
One is, as @FrustratedWithForms points out, there is the complication of foreign key constraints. Let's tip lookup values (reference data) into the mix too.
The second is, random isn't very realistic. The main driver for using random data is a need for large volumes of data, probably for performance testing. But real datasets aren't random, they contain skews and clumps, variable string lengths, and of course patterns (especially where dates are concerned).
So, rather than trying to generate random data I suggest you try to get a real dataset. Ideally your user/customer will be able to provide one, preferably anonymized. Otherwise try taking something which is already in the public domain, and massage it to fit your specific requirements. The Info Chimps are the top bananas when it comes to these matters. Check them out.
Allround Automation's PL/SQL Developer has a data generator tool. But be warned: it's a bit flaky - it seems to work fine on a single-table basis but gets tripped up when there are dependencies between tables.
I admit that eventually I just started writing my own SQL scripts to generate data. Turned out to be much more stable.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With