Build [Dell DVD Store] sample database for your postgresql

Struggled almost 30 minutes to get through all the steps. It seems the read me was disconnected with current build.

Here is the steps I tried out:

  1. Download ds21.tar.gz and ds21_postgresql.tar.gz from
  2. Extract them out, in one directory or different directories. If in different directories, just move the [data_files] directory from what you extracted from ds21.tar.gz to the directory extracted from ds21_postgresql.tar.gz.
  3. Navigate to the data_files directory we just highlighted in previous step.
  4. Go to each sub-directory under data_files and use gcc to recompile data generator executable. No need to install ActiveState or Cgwin. GCC is enough. But you need add -lm switch when you compile the c code, e.g. gcc ds2_create_cust.c -lm -o ds2_create_cust.
  5. Under cust directory, use chmod to enable execution on the sh file which matched your size requirement.
  6. Under orders directory, run the sh file to generate orders first. Then run ds2_create_inv to generate invoices, e.g ./ds2_create_inv 100000 0 > ../prod/inv.csv. The first parameter is size of product table, 100K is for medium size. The second parameter is os type. 0 means Linux, 1 means Windows.
  7. Under prod directory, run ds_create_prod command. There are two parameters ./ds2_create_prod 100000 0 > prod.csv.
  8. Navigate to top directory and run ./ (You may need to modify the data file path in sql scripts under [load] directory. In my download, the data file reference path is three levels up so I removed one level. And there is one redundant back slash in the data file path of products load script.)

Here is complete commands for medium size build (I extracted the file to [Downloads] directory):

cd /home/ryan/Downloads/ds2/pgsqlds2/data_files/cust
gcc ds2_create_cust.c -lm -o ds2_create_cust
chmod +x
cd ../orders
gcc ds2_create_orders.c -lm -o ds2_create_orders
gcc ds2_create_inv.c -lm -o ds2_create_inv
chmod +x
./ds2_create_inv 100000 0 > ../prod/inv.csv
cd ../prod/
gcc ds2_create_prod.c -lm -o ds2_create_prod
./ds2_create_prod 100000 0 > prod.csv
cd ../../

Hope it can save your time.

Post a comment or leave a trackback: Trackback URL.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: