0

Hi I am looking to get some help on ideas (or existing tools) on how to have a script that generate sample (fake) names, addresses, phone numbers, etc and populate a csv or mysql db. The purpose for this is to test a script that can identify or extract certain PII.

I hope that makes sense. I am looking forward to any ideas

Many thanks

  • https://stackoverflow.com/a/57461845/3010171 Should give you the data.. It should be easy to create a script with this, and populate a db. – Christian Moen Dec 05 '19 at 13:23
  • Why did you add the `db2` tag to the question? Is this question related to ibm db2? – Mark Barinstein Dec 05 '19 at 13:35
  • the end goal is to have this work with db2 as well – tajomaru007 Dec 05 '19 at 14:25
  • Do you want to use db2 for data generation? If yes, then you should provide some references for names, addresses at least, if you don't want to get them as arbitrary sets of letters & numbers. If no, then I don't see any reason why externally generated data in csv format can't be loaded into any database including db2. But there is no any specific with particular database type in the latter case, and it's not related to any database at all. So, if you want to generate data with db2, then provide more detailed description and source of reference data you want to use for such a generation. – Mark Barinstein Dec 05 '19 at 15:43
  • Does this answer your question? [Best way to generate random data into a database](https://stackoverflow.com/questions/5531313/best-way-to-generate-random-data-into-a-database) – Peter O. Dec 06 '19 at 00:40
  • Various tools can do this. DBeaver is just one of many examples out there – Paul Vernon Dec 10 '19 at 11:02

1 Answers1

0

Here is one of sample case on any Db2 LUW:

$ db2stop ; db2start ; db2sampl  
  =>> will create **sample** database

$ db2 connect to sample  
  =>> connect to it

$ db2 "select * from employee"  
  =>> will return rows from a sample employee table as below

EMPNO  FIRSTNME     MIDINIT LASTNAME        WORKDEPT PHONENO HIREDATE   JOB      EDLEVEL SEX BIRTHDATE  SALARY      BONUS       COMM
------ ------------ ------- --------------- -------- ------- ---------- -------- ------- --- ---------- ----------- ----------- -----------
000010 CHRISTINE    I       HAAS            A00      3978    01/01/1995 PRES          18 F   08/24/1963   152750.00     1000.00     4220.00
000020 MICHAEL      L       THOMPSON        B01      3476    10/10/2003 MANAGER       18 M   02/02/1978    94250.00      800.00     3300.00
000030 SALLY        A       KWAN            C01      4738    04/05/2005 MANAGER       20 F   05/11/1971    98250.00      800.00     3060.00
000050 JOHN         B       GEYER           E01      6789    08/17/1979 MANAGER       16 M   09/15/1955    80175.00      800.00     3214.00
000060 IRVING       F       STERN           D11      6423    09/14/2003 MANAGER       16 M   07/07/1975    72250.00      500.00     2580.00
000070 EVA          D       PULASKI         D21      7831    09/30/2005 MANAGER       16 F   05/26/2003    96170.00      700.00     2893.00
    :
  snip

As above, db2sampl command will create a sample database and some tables with sample rows as above.

Hope this helps.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
hidehy
  • 179
  • 5