Create test data for my own database?
I checked few questions here about generating test data, and the most of the recommendations were about Red gate .. I've installed it but it gave me an error "SQL toolbelt verification failed" .. the file containing the exe isn't signed?!?
So, if you have another suggestions how can I generate data easily into my database, or if you've faced this problem once, please help me.
开发者_开发知识库Thanks :)
Check out GenerateData.com. It's free.
Features
- (JS-enabled) browser-friendly.
- Many data types available: names,
phone numbers, email addresses,
cities, states, provinces,
counties, dates, street addresses,
number ranges, alphanumeric strings, lorem ipsum text and more. - Option to generate data in XML, Excel, HTML, CSV or SQL.
- Country specific data (state /
province / county) for Canada, US,
Netherlands and UK. - Does your laundry.
- Saves your data generation forms for later use
Drop Red Gate Support a mail on support @ red-gate.com - they'll help you to troubleshoot the error you've seen.
PL/SQL:
select
e."level",
e."random",
b."random",
ROUND(DBMS_RANDOM.VALUE (0, 999999),6) "float",
ROUND(DBMS_RANDOM.VALUE (1, 99999999999)) "number",
dbms_random.string('X', 21) "string",
dbms_random.string('U', 1) || dbms_random.string('L', 5) "firstname",
dbms_random.string('U', 1) || dbms_random.string('L', 5) "lastname",
TO_CHAR(TO_DATE(b."random",'J'),'ddmmyy')||'-'||ROUND(DBMS_RANDOM.VALUE (1, 99999)) "personal code",
TO_DATE(b."random",'J') "date random",
TO_TIMESTAMP(TO_DATE(b."random",'J')) "timestamp generic",
l."lipsum"
from
(SELECT level "level",TRUNC(DBMS_RANDOM.VALUE(2451545,5373484)) "random" FROM DUAL CONNECT BY LEVEL < 100) e
,(SELECT level "level",TRUNC(DBMS_RANDOM.VALUE(2451545,5373484)) "random" FROM DUAL CONNECT BY LEVEL < 100) b
,(SELECT rownum "id", e.* FROM(SELECT
LISTAGG(p."phrase",' ') WITHIN GROUP(ORDER BY p."phrases", p."phrase") "lipsum"
FROM (
SELECT
r."level", r."random", r."phrases", p."phrase"
FROM
(SELECT level "level",ROUND(DBMS_RANDOM.VALUE (0, 9)) "random", ROUND(DBMS_RANDOM.VALUE (1, 750)) "phrases" FROM dual CONNECT BY LEVEL < 1000 /* paragraphs / 10 */) r,
(SELECT rownum "rownum",COLUMN_VALUE "phrase" FROM TABLE(CAST(MULTISET(
SELECT 'Pack my box with five dozen liquor jugs.' AS strval FROM DUAL UNION
SELECT 'The five boxing wizards jump quickly.' AS strval FROM DUAL UNION
SELECT 'A quick brown fox jumps over the lazy dog.' AS strval FROM DUAL UNION
SELECT 'The quick brown fox jumps over the lazy dog.' AS strval FROM DUAL UNION
SELECT 'The quick brown fox jumped over the lazy dogs.' AS strval FROM DUAL UNION
SELECT 'Pack my red box with five dozen quality jugs.' AS strval FROM DUAL UNION
SELECT 'Who packed five dozen old quart jugs in my box?' AS strval FROM DUAL UNION
SELECT 'My girl wove six dozen plaid jackets before she quit.' AS strval FROM DUAL UNION
SELECT 'Few black taxis drive up major roads on quiet hazy nights.' AS strval FROM DUAL UNION
SELECT 'A quick movement of the enemy will jeopardize six gunboats.' AS strval FROM DUAL
)AS T_VARCHAR))) p
WHERE r."random" = p."rownum"
) p
GROUP BY p."phrases") e) l
WHERE e."level" = b."level" AND e."level" = l."id";
精彩评论