Advertisement
Guest User

Untitled

a guest
Apr 22nd, 2019
276
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.66 KB | None | 0 0
  1. -- sccsid: @(#)dss.ri 2.1.8.1
  2. -- tpch benchmark version 8.0
  3.  
  4. -- connect to tpch;
  5.  
  6. -- alter table tpch.region drop primary key;
  7. -- alter table tpch.nation drop primary key;
  8. -- alter table tpch.part drop primary key;
  9. -- alter table tpch.supplier drop primary key;
  10. -- alter table tpch.partsupp drop primary key;
  11. -- alter table tpch.orders drop primary key;
  12. -- alter table tpch.lineitem drop primary key;
  13. -- alter table tpch.customer drop primary key;
  14.  
  15.  
  16. -- for table region
  17. alter table tpch.region add constraint tpch_region_pk primary key (r_regionkey) disable novalidate;
  18.  
  19. -- for table nation
  20. alter table tpch.nation add constraint tpch_nation_pk primary key (n_nationkey) disable novalidate;
  21.  
  22. alter table tpch.nation add constraint tpch_nation_fk1 foreign key (n_regionkey) references tpch.region (r_regionkey) disable novalidate rely;
  23.  
  24. -- for table part
  25. alter table tpch.part add constraint tpch_part_pk primary key (p_partkey) disable novalidate;
  26.  
  27. -- for table supplier
  28. alter table tpch.supplier
  29. add constraint tpch_supplier_pk primary key (s_suppkey) disable novalidate;
  30.  
  31. alter table tpch.supplier
  32. add constraint tpch_supplier_fk1 foreign key (s_nationkey) references tpch.nation (n_nationkey) disable novalidate rely;
  33.  
  34. -- for table partsupp
  35. alter table tpch.partsupp
  36. add constraint tpch_partsupp_pk primary key (ps_partkey,ps_suppkey) disable novalidate;
  37.  
  38. -- for table customer
  39. alter table tpch.customer
  40. add constraint tpch_customer_pk primary key (c_custkey) disable novalidate;
  41.  
  42. alter table tpch.customer
  43. add constraint tpch_customer_fk1 foreign key (c_nationkey) references tpch.nation (n_nationkey) disable novalidate rely;
  44.  
  45. -- for table lineitem
  46. alter table tpch.lineitem
  47. add constraint tpch_lineitem_pk primary key (l_orderkey,l_linenumber) disable novalidate;
  48.  
  49. -- for table orders
  50. alter table tpch.orders
  51. add constraint tpch_orders_pk primary key (o_orderkey) disable novalidate;
  52.  
  53. -- for table partsupp
  54. alter table tpch.partsupp
  55. add constraint tpch_partsupp_fk1 foreign key (ps_suppkey) references tpch.supplier (s_suppkey) disable novalidate rely;
  56.  
  57. alter table tpch.partsupp
  58. add constraint tpch_partsupp_fk2 foreign key (ps_partkey) references tpch.part (p_partkey) disable novalidate rely;
  59.  
  60. -- for table orders
  61. alter table tpch.orders
  62. add constraint tpch_orders_fk1 foreign key (o_custkey) references tpch.customer (c_custkey) disable novalidate rely;
  63.  
  64. -- for table lineitem
  65. alter table tpch.lineitem
  66. add constraint tpch_lineitem_fk1 foreign key (l_orderkey) references tpch.orders (o_orderkey) disable novalidate rely;
  67.  
  68. alter table tpch.lineitem
  69. add constraint tpch_lineitem_fk2 foreign key (l_partkey,l_suppkey) references
  70. tpch.partsupp (ps_partkey, ps_suppkey) disable novalidate rely;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement