为我自己的数据库创建测试数据?

时间:2010-12-28 22:18:13

标签: sql

我在这里检查了几个关于生成测试数据的问题,大部分建议都是关于Red gate ..我已经安装了但它给了我一个错误“SQL toolbelt verification failed”..包含exe的文件isn没签了?!?

因此,如果您有其他建议,我如何轻松地将数据生成到我的数据库中,或者如果您曾经遇到过这个问题,请帮助我。

谢谢:)

3 个答案:

答案 0 :(得分:2)

结帐GenerateData.com。它是免费的。

功能

  • (支持JS)浏览器友好。
  • 许多可用的数据类型:名称, 电话号码,电子邮件地址, 城市,州,省,
    县,日期,街道地址,
    数字范围,字母数字字符串, lorem ipsum text等等。
  • 以XML格式生成数据的选项, Excel,HTML,CSV或SQL。
  • 国家/地区特定数据(州/ 省/县)为加拿大,美国,
    荷兰和英国。
  • 洗衣服。
  • 保存您的数据生成表单 稍后使用

答案 1 :(得分:0)

Drop Red Gate支持邮件支持@ red-gate.com - 它们可以帮助您解决您看到的错误。

答案 2 :(得分:0)

<强> 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";