Commit 07214f4c authored by Stanley Clark's avatar Stanley Clark
Browse files

Add initial setup for comparison to Oracle DB

parent f4fbe535
......@@ -7,3 +7,6 @@
[submodule "experiments/pg-cuckoo"]
path = experiments/pg-cuckoo
url = ../pg-cuckoo.git
[submodule "comparison/tpc-ds"]
path = comparison/tpc-ds
url = ../tpc-ds.git
# Comparison
## Oracle VPD
* Build the DB [Server](https://github.com/oracle/docker-images/tree/main/OracleDatabase/SingleInstance)
docker image (19.3.0)
* Install the DB [Client](https://www.oracle.com/database/technologies/instant-client.html)
and additionally the SQL*Plus Package, and the Tools Package
* Start the server Docker container using
```
docker run --name OracleDB \
-p 1521:1521 -p 5500:5500 \
-e ORACLE_SID=ORCLCDB \
-e ORACLE_PDB=ORCLPDB1 \
-e ORACLE_PWD=password \
-v OracleDBData:/opt/oracle/oradata \
oracle/database:19.3.0-ee
```
* Run `oracle/make_tpc.bash`
Connect via JDBC using username `sys as sysdba` and password `password`.
## IBM DB2
drop table dbgen_version;
drop table customer_address;
drop table customer_demographics;
drop table date_dim;
drop table warehouse;
drop table ship_mode;
drop table time_dim;
drop table reason;
drop table income_band;
drop table item;
drop table store;
drop table call_center;
drop table customer;
drop table web_site;
drop table store_returns;
drop table household_demographics;
drop table web_page;
drop table promotion;
drop table catalog_page;
drop table inventory;
drop table catalog_returns;
drop table web_returns;
drop table web_sales;
drop table catalog_sales;
drop table store_sales;
\ No newline at end of file
*.log
\ No newline at end of file
LOAD DATA
INFILE '../../tpc-ds/tools/call_center.dat'
INSERT INTO TABLE CALL_CENTER
FIELDS TERMINATED BY "|" OPTIONALLY ENCLOSED BY '"' TRAILING NULLCOLS
(cc_call_center_sk,cc_call_center_id,cc_rec_start_date DATE "YYYY-MM-DD",cc_rec_end_date DATE "YYYY-MM-DD",cc_closed_date_sk,cc_open_date_sk,cc_name,cc_class,cc_employees,cc_sq_ft,cc_hours,cc_manager,cc_mkt_id,cc_mkt_class,cc_mkt_desc,cc_market_manager,cc_division,cc_division_name,cc_company,cc_company_name,cc_street_number,cc_street_name,cc_street_type,cc_suite_number,cc_city, cc_county,cc_state,cc_zip,cc_country,cc_gmt_offset,cc_tax_percentage)
\ No newline at end of file
LOAD DATA
INFILE '../../tpc-ds/tools/catalog_page.dat'
INSERT INTO TABLE CATALOG_PAGE
FIELDS TERMINATED BY "|" OPTIONALLY ENCLOSED BY '"' TRAILING NULLCOLS
(cp_catalog_page_sk,cp_catalog_page_id,cp_start_date_sk,cp_end_date_sk,cp_department,cp_catalog_number,cp_catalog_page_number,cp_description,cp_type )
LOAD DATA
INFILE '../../tpc-ds/tools/inventory.dat'
INSERT INTO TABLE INVENTORY
FIELDS TERMINATED BY "|" OPTIONALLY ENCLOSED BY '"' TRAILING NULLCOLS
(inv_date_sk,inv_item_sk,inv_warehouse_sk,inv_quantity_on_hand )
LOAD DATA
INFILE '../../tpc-ds/tools/item.dat'
INSERT INTO TABLE ITEM
FIELDS TERMINATED BY "|" OPTIONALLY ENCLOSED BY '"' TRAILING NULLCOLS
(i_item_sk,i_item_id,i_rec_start_date DATE "YYYY-MM-DD",i_rec_end_date DATE "YYYY-MM-DD",i_item_desc,i_current_price,i_wholesale_cost,i_brand_id,i_brand,i_class_id,i_class,i_category_id,i_category,i_manufact_id,i_manufact,i_size,i_formulation,i_color,i_units,i_container,i_manager_id,i_product_name )
LOAD DATA
INFILE '../../tpc-ds/tools/promotion.dat'
INSERT INTO TABLE PROMOTION
FIELDS TERMINATED BY "|" OPTIONALLY ENCLOSED BY '"' TRAILING NULLCOLS
(p_promo_sk,p_promo_id,p_start_date_sk,p_end_date_sk,p_item_sk,p_cost,p_response_target,p_promo_name,p_channel_dmail,p_channel_email,p_channel_catalog,p_channel_tv,p_channel_radio,p_channel_press,p_channel_event,p_channel_demo,p_channel_details,p_purpose,p_discount_active )
LOAD DATA
INFILE '../../tpc-ds/tools/reason.dat'
INSERT INTO TABLE REASON
FIELDS TERMINATED BY "|" OPTIONALLY ENCLOSED BY '"' TRAILING NULLCOLS
(r_reason_sk,r_reason_id,r_reason_desc )
LOAD DATA
INFILE '../../tpc-ds/tools/ship_mode.dat'
INSERT INTO TABLE SHIP_MODE
FIELDS TERMINATED BY "|" OPTIONALLY ENCLOSED BY '"' TRAILING NULLCOLS
(sm_ship_mode_sk,sm_ship_mode_id,sm_type,sm_code,sm_carrier,sm_contract )
LOAD DATA
INFILE '../../tpc-ds/tools/store.dat'
INSERT INTO TABLE STORE
FIELDS TERMINATED BY "|" OPTIONALLY ENCLOSED BY '"' TRAILING NULLCOLS
(s_store_sk,s_store_id,s_rec_start_date DATE "YYYY-MM-DD",s_rec_end_date DATE "YYYY-MM-DD",s_closed_date_sk,s_store_name,s_number_employees,s_floor_space,s_hours,s_manager,s_market_id,s_geography_class,s_market_desc,s_market_manager,s_division_id,s_division_name,s_company_id,s_company_name,s_street_number,s_street_name,s_street_type,s_suite_number,s_city,s_county,s_state,s_zip,s_country,s_gmt_offset,s_tax_precentage )
LOAD DATA
INFILE '../../tpc-ds/tools/store_returns.dat'
INSERT INTO TABLE STORE_RETURNS
FIELDS TERMINATED BY "|" OPTIONALLY ENCLOSED BY '"' TRAILING NULLCOLS
(sr_returned_date_sk,sr_return_time_sk,sr_item_sk,sr_customer_sk,sr_cdemo_sk,sr_hdemo_sk,sr_addr_sk,sr_store_sk,sr_reason_sk,sr_ticket_number,sr_return_quantity,sr_return_amt,sr_return_tax,sr_return_amt_inc_tax,sr_fee,sr_return_ship_cost,sr_refunded_cash,sr_reversed_charge,sr_store_credit,sr_net_loss )
LOAD DATA
INFILE '../../tpc-ds/tools/store_sales.dat'
INSERT INTO TABLE STORE_SALES
FIELDS TERMINATED BY "|" OPTIONALLY ENCLOSED BY '"' TRAILING NULLCOLS
(ss_sold_date_sk,ss_sold_time_sk,ss_item_sk,ss_customer_sk,ss_cdemo_sk,ss_hdemo_sk,ss_addr_sk,ss_store_sk,ss_promo_sk,ss_ticket_number,ss_quantity,ss_wholesale_cost,ss_list_price,ss_sales_price,ss_ext_discount_amt,ss_ext_sales_price,ss_ext_wholesale_cost,ss_ext_list_price,ss_ext_tax,ss_coupon_amt,ss_net_paid,ss_net_paid_inc_tax,ss_net_profit )
LOAD DATA
INFILE '../../tpc-ds/tools/time_dim.dat'
INSERT INTO TABLE TIME_DIM
FIELDS TERMINATED BY "|" OPTIONALLY ENCLOSED BY '"' TRAILING NULLCOLS
(t_time_sk,t_time_id,t_time,t_hour,t_minute,t_second,t_am_pm,t_shift,t_sub_shift,t_meal_time)
LOAD DATA
INFILE '../../tpc-ds/tools/warehouse.dat'
INSERT INTO TABLE WAREHOUSE
FIELDS TERMINATED BY "|" OPTIONALLY ENCLOSED BY '"' TRAILING NULLCOLS
(w_warehouse_sk,w_warehouse_id,w_warehouse_name,w_warehouse_sq_ft,w_street_number,w_street_name,w_street_type,w_suite_number,w_city,w_county,w_state,w_zip,w_country,w_gmt_offset )
LOAD DATA
INFILE '../../tpc-ds/tools/catalog_returns.dat'
INSERT INTO TABLE CATALOG_RETURNS
FIELDS TERMINATED BY "|" OPTIONALLY ENCLOSED BY '"' TRAILING NULLCOLS
(cr_returned_date_sk,cr_returned_time_sk,cr_item_sk,cr_refunded_customer_sk,cr_refunded_cdemo_sk,cr_refunded_hdemo_sk,cr_refunded_addr_sk,cr_returning_customer_sk,cr_returning_cdemo_sk,cr_returning_hdemo_sk,cr_returning_addr_sk,cr_call_center_sk,cr_catalog_page_sk,cr_ship_mode_sk,cr_warehouse_sk,cr_reason_sk,cr_order_number,cr_return_quantity,cr_return_amount,cr_return_tax,cr_return_amt_inc_tax,cr_fee,cr_return_ship_cost,cr_refunded_cash,cr_reversed_charge,cr_store_credit,cr_net_loss )
LOAD DATA
INFILE '../../tpc-ds/tools/web_page.dat'
INSERT INTO TABLE WEB_PAGE
FIELDS TERMINATED BY "|" OPTIONALLY ENCLOSED BY '"' TRAILING NULLCOLS
(wp_web_page_sk,wp_web_page_id,wp_rec_start_date DATE "YYYY-MM-DD",wp_rec_end_date DATE "YYYY-MM-DD",wp_creation_date_sk,wp_access_date_sk,wp_autogen_flag,wp_customer_sk,wp_url,wp_type,wp_char_count,wp_link_count,wp_image_count,wp_max_ad_count )
LOAD DATA
INFILE '../../tpc-ds/tools/web_returns.dat'
INSERT INTO TABLE WEB_RETURNS
FIELDS TERMINATED BY "|" OPTIONALLY ENCLOSED BY '"' TRAILING NULLCOLS
(wr_returned_date_sk,wr_returned_time_sk,wr_item_sk,wr_refunded_customer_sk,wr_refunded_cdemo_sk,wr_refunded_hdemo_sk,wr_refunded_addr_sk,wr_returning_customer_sk,wr_returning_cdemo_sk,wr_returning_hdemo_sk,wr_returning_addr_sk,wr_web_page_sk,wr_reason_sk,wr_order_number,wr_return_quantity,wr_return_amt,wr_return_tax,wr_return_amt_inc_tax,wr_fee,wr_return_ship_cost,wr_refunded_cash,wr_reversed_charge,wr_account_credit,wr_net_loss )
LOAD DATA
INFILE '../../tpc-ds/tools/web_sales.dat'
INSERT INTO TABLE WEB_SALES
FIELDS TERMINATED BY "|" OPTIONALLY ENCLOSED BY '"' TRAILING NULLCOLS
(ws_sold_date_sk,ws_sold_time_sk,ws_ship_date_sk,ws_item_sk,ws_bill_customer_sk,ws_bill_cdemo_sk,ws_bill_hdemo_sk,ws_bill_addr_sk,ws_ship_customer_sk,ws_ship_cdemo_sk,ws_ship_hdemo_sk,ws_ship_addr_sk,ws_web_page_sk,ws_web_site_sk,ws_ship_mode_sk,ws_warehouse_sk,ws_promo_sk,ws_order_number,ws_quantity,ws_wholesale_cost,ws_list_price,ws_sales_price,ws_ext_discount_amt,ws_ext_sales_price,ws_ext_wholesale_cost,ws_ext_list_price,ws_ext_tax,ws_coupon_amt,ws_ext_ship_cost,ws_net_paid,ws_net_paid_inc_tax,ws_net_paid_inc_ship,ws_net_paid_inc_ship_tax,ws_net_profit )
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment