13
OraclePoint.com BenchmarkSQL -2.3.2 Installation and User Guide Environment: Server: Oracle 9.2.0.6 and Solaris 9 Client: Windows XP SP2 (have oracle listener ready) Step 1 : install Sun JDK 1.6 (jdk-6u3-windows-i586-p.exe is available at https://sdlc3e.sun.com/ECom/EComActionServlet;jsessionid=45F28B6E93FBCA3CF8B7C6C838 A77669# ) Step 2 : install Eclipse IDE for Java Developers available at http://www.eclipse.org/downloads/ Step 3 : Load Project BenchmarkSQL-2.3.2 to Eclipse 1. Create new Java Project BenchmarkSQL-2.3.2

Benchmark SQL Guide

Embed Size (px)

DESCRIPTION

BenchmarkSQL -232 Installation And User GuideSource: www.oraclepoint.com

Citation preview

Page 1: Benchmark SQL Guide

OraclePoint.com

BenchmarkSQL -2.3.2 Installation and User Guide

Environment: Server: Oracle 9.2.0.6 and Solaris 9Client: Windows XP SP2 (have oracle listener ready)

Step 1 : install Sun JDK 1.6

(jdk-6u3-windows-i586-p.exe is available at

https://sdlc3e.sun.com/ECom/EComActionServlet;jsessionid=45F28B6E93FBCA3CF8B7C6C838A77669# )

Step 2 : install Eclipse IDE for Java Developers

available at http://www.eclipse.org/downloads/

Step 3 : Load Project BenchmarkSQL-2.3.2 to Eclipse

1. Create new Java Project BenchmarkSQL-2.3.2

Page 2: Benchmark SQL Guide

OraclePoint.com

Page 3: Benchmark SQL Guide

OraclePoint.com

Page 4: Benchmark SQL Guide

OraclePoint.com

2. make sure the project created successfully

3. Change file oracle.properties for your database setting

We suggest you create a new oracle user with necessary DBA roles.

Page 5: Benchmark SQL Guide

OraclePoint.com

4. Run the "sqlTableCreates" to create the base tables

Here, we run runSQL oracle.properties sqlTableCreates as followings

C:\Program Files\BenchmarkSQL-2.3.2\run>runSQL oracle.properties sqlTableCreates

C:\Program Files\BenchmarkSQL-2.3.2\run>"C:\Program Files\Java\jdk1.6.0_03\bin\java" -cp ..\lib\edb-jdbc14-8_0_3_14.ja..\lib\ojdbc14-10.2.jar;..\lib\postgresql-8.0.309.jdbc3.jar;..\dist\BenchmarkSQL-2.3.jar -Dprop=oracle.properties -DcoandFile=sqlTableCreates ExecJDBC------------- ExecJDBC Start Date = Wed Dec 05 16:41:02 PST 2007-------------driver=oracle.jdbc.driver.OracleDriverconn=jdbc:oracle:thin:@140.161.2.143:1521:orcluser=tt_userpassword=******commandFile=sqlTableCreates-------------------------------------------------

create table warehouse (w_id integer not null,w_ytd decimal(12,2),w_tax decimal(4,4),w_name varchar(10),w_street_1 varchar(20),w_street_2 varchar(20),

Page 6: Benchmark SQL Guide

OraclePoint.com

w_city varchar(20),w_state char(2),w_zip char(9));-- SQL Success: Runtime = 517 ms --

commit;-- SQL Success: Runtime = 1 ms --

create table district (d_w_id integer not null,d_id integer not null,d_ytd decimal(12,2),d_tax decimal(4,4),d_next_o_id integer,d_name varchar(10),d_street_1 varchar(20),d_street_2 varchar(20),d_city varchar(20),d_state char(2),d_zip char(9));-- SQL Success: Runtime = 516 ms --

commit;-- SQL Success: Runtime = 1 ms --

create table customer (c_w_id integer not null,c_d_id integer not null,c_id integer not null,c_discount decimal(4,4),c_credit char(2),c_last varchar(16),c_first varchar(16),c_credit_lim decimal(12,2),c_balance decimal(12,2),c_ytd_payment float,c_payment_cnt integer,c_delivery_cnt integer,c_street_1 varchar(20),c_street_2 varchar(20),c_city varchar(20),c_state char(2),c_zip char(9),c_phone char(16),c_since timestamp,c_middle char(2),c_data varchar(500));-- SQL Success: Runtime = 533 ms --

commit;

Page 7: Benchmark SQL Guide

OraclePoint.com

-- SQL Success: Runtime = 1 ms --

create table history (h_c_id integer,h_c_d_id integer,h_c_w_id integer,h_d_id integer,h_w_id integer,h_date timestamp,h_amount decimal(6,2),h_data varchar(24));-- SQL Success: Runtime = 563 ms --

commit;-- SQL Success: Runtime = 1 ms --

create table oorder (o_w_id integer not null,o_d_id integer not null,o_id integer not null,o_c_id integer,o_carrier_id integer,o_ol_cnt decimal(2,0),o_all_local decimal(1,0),o_entry_d timestamp);-- SQL Success: Runtime = 532 ms --

commit;-- SQL Success: Runtime = 1 ms --

create table new_order (no_w_id integer not null,no_d_id integer not null,no_o_id integer not null);-- SQL Success: Runtime = 516 ms --

commit;-- SQL Success: Runtime = 1 ms --

create table order_line (ol_w_id integer not null,ol_d_id integer not null,ol_o_id integer not null,ol_number integer not null,ol_i_id integer not null,

Page 8: Benchmark SQL Guide

OraclePoint.com

ol_delivery_d timestamp,ol_amount decimal(6,2),ol_supply_w_id integer,ol_quantity decimal(2,0),ol_dist_info char(24));-- SQL Success: Runtime = 516 ms --

commit;-- SQL Success: Runtime = 1 ms --

create table stock (s_w_id integer not null,s_i_id integer not null,s_quantity decimal(4,0),s_ytd decimal(8,2),s_order_cnt integer,s_remote_cnt integer,s_data varchar(50),s_dist_01 char(24),s_dist_02 char(24),s_dist_03 char(24),s_dist_04 char(24),s_dist_05 char(24),s_dist_06 char(24),s_dist_07 char(24),s_dist_08 char(24),s_dist_09 char(24),s_dist_10 char(24));-- SQL Success: Runtime = 517 ms --

commit;-- SQL Success: Runtime = 1 ms --

create table item (i_id integer not null,i_name varchar(24),i_price decimal(5,2),i_data varchar(50),i_im_id integer);-- SQL Success: Runtime = 532 ms --

commit;-- SQL Success: Runtime = 1 ms --

------------- ExecJDBC End Date = Wed Dec 05 16:41:08 PST 2007-------------

C:\Program Files\BenchmarkSQL-2.3.2\run>

Page 9: Benchmark SQL Guide

OraclePoint.com

5. Run the "loadData" command file to load all of the default data for abenchmark

We run: runSQL oracle.properties sqlTableCopies as followings.

C:\Program Files\BenchmarkSQL-2.3.2\run>loadData oracle.propertiesnumWarehouses=10--

Elasped Time(ms): 0.171 Writing record 3359000 of 3400000Elasped Time(ms): 0.36 Writing record 3360000 of 3400000Elasped Time(ms): 0.109 Writing record 3361000 of 3400000Elasped Time(ms): 0.125 Writing record 3362000 of 3400000Elasped Time(ms): 0.125 Writing record 3363000 of 3400000Elasped Time(ms): 0.141 Writing record 3364000 of 3400000Elasped Time(ms): 0.109 Writing record 3365000 of 3400000Elasped Time(ms): 0.125 Writing record 3366000 of 3400000Elasped Time(ms): 0.141 Writing record 3367000 of 3400000Elasped Time(ms): 0.125 Writing record 3368000 of 3400000Elasped Time(ms): 0.125 Writing record 3369000 of 3400000Elasped Time(ms): 0.156 Writing record 3371000 of 3400000Elasped Time(ms): 0.234 Writing record 3372000 of 3400000Elasped Time(ms): 0.141 Writing record 3373000 of 3400000Elasped Time(ms): 0.141 Writing record 3374000 of 3400000Elasped Time(ms): 0.14 Writing record 3375000 of 3400000Elasped Time(ms): 0.125 Writing record 3376000 of 3400000Elasped Time(ms): 0.219 Writing record 3377000 of 3400000Elasped Time(ms): 0.125 Writing record 3378000 of 3400000Elasped Time(ms): 0.125 Writing record 3379000 of 3400000Elasped Time(ms): 0.141 Writing record 3380000 of 3400000Elasped Time(ms): 0.125 Writing record 3381000 of 3400000Elasped Time(ms): 0.156 Writing record 3382000 of 3400000Elasped Time(ms): 0.125 Writing record 3383000 of 3400000Elasped Time(ms): 0.141 Writing record 3384000 of 3400000Elasped Time(ms): 0.125 Writing record 3385000 of 3400000Elasped Time(ms): 0.14 Writing record 3386000 of 3400000Elasped Time(ms): 0.125 Writing record 3387000 of 3400000Elasped Time(ms): 0.141 Writing record 3388000 of 3400000Writing final records 3389440 of 3400000

End Orders Load @ Thu Jul 12 12:22:07 PDT 2007

------------- LoadJDBC Statistics --------------------Start Time = Thu Jul 12 11:50:37 PDT 2007

End Time = Thu Jul 12 12:22:07 PDT 2007Run Time = 1889 Seconds

Rows Loaded = 5089550 RowsRows Per Second = 2694 Rows/Sec------------------------------------------------------

6. Run the "runSQL" command file to execute the SQL script"sqlIndexCreates" to create the primary keys & other indexes on thetables

We run: runSQL oracle.properties sqlIndexCreates as followings.

Page 10: Benchmark SQL Guide

OraclePoint.com

C:\Program Files\BenchmarkSQL-2.3.2\run>runSQL oracle.propertiessqlIndexCreates

C:\Program Files\BenchmarkSQL-2.3.2\run>C:\ProgramFiles\Java\jdk1.5.0_11\bin\java" -cp ..\lib\edb-jdbc14-8_14-10.2.jar;..\lib\postgresql-8.0.309.jdbc3.jar;..\dist\BenchmarkSQL-2.3.jar -Dprop=oracle.properties -DcommandFile=sqlIndexCreates ExecJ------------- ExecJDBC Start Date = Wed Dec 05 16:50:02 PST 2007-------------driver=oracle.jdbc.driver.OracleDriverconn=jdbc:oracle:thin:@hostname:1521:dbuser=xxxxxpassword=xxxxxcommandFile=sqlIndexCreates-------------------------------------------------

alter table warehouse add constraint pk_warehouseprimary key (w_id);-- SQL Success: Runtime = 532 ms --

commit;-- SQL Success: Runtime = 1 ms --

alter table district add constraint pk_districtprimary key (d_w_id, d_id);-- SQL Success: Runtime = 32 ms --

commit;-- SQL Success: Runtime = 1 ms --

alter table customer add constraint pk_customerprimary key (c_w_id, c_d_id, c_id);-- SQL Success: Runtime = 9126 ms --

commit;-- SQL Success: Runtime = 1 ms --

create index ndx_customer_nameon customer (c_w_id, c_d_id, c_last, c_first);-- SQL Success: Runtime = 12079 ms --

commit;-- SQL Success: Runtime = 1 ms --

Page 11: Benchmark SQL Guide

OraclePoint.com

-- history table has no primary key-- commit;

alter table oorder add constraint pk_oorderprimary key (o_w_id, o_d_id, o_id);-- SQL Success: Runtime = 6283 ms --

commit;-- SQL Success: Runtime = 1 ms --

create unique index ndx_oorder_carrieron oorder (o_w_id, o_d_id, o_carrier_id, o_id);-- SQL Success: Runtime = 8329 ms --

commit;-- SQL Success: Runtime = 16 ms --

alter table new_order add constraint pk_new_orderprimary key (no_w_id, no_d_id, no_o_id);-- SQL Success: Runtime = 1939 ms --

commit;-- SQL Success: Runtime = 16 ms --

alter table order_line add constraint pk_order_lineprimary key (ol_w_id, ol_d_id, ol_o_id, ol_number);-- SQL Success: Runtime = 79736 ms --

commit;-- SQL Success: Runtime = 1 ms --

alter table stock add constraint pk_stockprimary key (s_w_id, s_i_id);-- SQL Success: Runtime = 23844 ms --

commit;

Page 12: Benchmark SQL Guide

OraclePoint.com

-- SQL Success: Runtime = 1 ms --

alter table item add constraint pk_itemprimary key (i_id);-- SQL Success: Runtime = 1814 ms --

commit;-- SQL Success: Runtime = 1 ms --

vacuum analyze;-- SQL Runtime Exception -----------------------------------------DBMS SqlCode=900 DBMS Msg=

ORA-00900: invalid SQL statement

------------------------------------------------------------------

------------- ExecJDBC End Date = Thu Jul 12 12:25:49 PDT 2007-------------

Among the output, you may experience ORA-00900 error as highlighted above in colorred. The command “vacuum analyze”is POSTGRESQL-specific command to analyzedatabase objects. In Oracle, we do as followings.

We run: analyze table customer compute statistics;

Make sure to analyze all of ten tables created above.

7. Run the "runBenchmark" command file to execute the swing GUIapplication to test the database

We run: runBenchmark oracle.properties as followings.

C:\Program Files\BenchmarkSQL-2.3.2\run>runBenchmark oracle.propertiesC:\Program Files\BenchmarkSQL-2.3.2\run>C:\ProgramFiles\Java\jdk1.5.0_11\bin\java" -server -Xms128M -Xmx128M -cp ..\lib\edb-jdbc14-8_0_3_14.jar;..\lib\ojdbc14-10.2.jar;..\lib\postgresql-8.0.309.jdbc3.jar;..\dist\BenchmarkSQL-2.3.jar -Dprop=oracle.properties jTPCCdriver=oracle.jdbc.driver.OracleDriverconn=jdbc:oracle:thin:@hostname:1521:dbuser=xxxxxpassword=xxxxx

Page 13: Benchmark SQL Guide

OraclePoint.com

And then, we’ll see Java Applet as following.

Based on that, you can freely setup the necessary parameters to got tpmC value on yoursystem.

For more information on tpmC, see http://www.tpc.org/information/benchmarks.asp

About Author

R. Wang currently works as Oracle DBA in Canada. He is responsible fordatabase performance tuning and high availability. With over 10 yearsexperience in architecting and building oracle systems, Rui is an evangelistfor oracle technology and products. Rui is OCP and received master degree incomputer science from Simon Fraser University in Canada.Visit Rui’s blog: www.oraclepoint.com/oralife and be member ofwww.oraclepoint.com for more resources.