Swingbench Introduction:
The swingbench consists of a load generator, a coordinator, and a cluster overview. The software makes it possible to generate loads and map the transaction/response time of the chart.
Swingbench can be used to demonstrate and test technologies such as real application clusters, online table rebuilds, standby databases, online backup and recovery, etc.
The code included with the Swingbench includes 6 benchmarks, Orderentry,saleshistory,tpc-ds like,json,callingcircle and Stresstest.
OrderEntry is based on the "OE" mode included with the oracle11g/oracle12c. It has been modified so that you do not need to install the Spatial,intermedia schema. It works continuously (until you run out of space). It introduces a lot of contention on a few tables, with the aim of emphasizing interconnection and memory. It is installed using "Oewizard" located in the Bin directory. Benchmarks have both pure JDBC and PL/SQL (lower network overhead) variants.
Saleshistory is based on the "SH" architecture included with ORACLE11G/ORACLE12C to test the performance of complex queries as they run against large tables. It is read-only and can be scaled by the default size from 1GB to 1TB. Custom mode also allows you to create smaller and larger patterns
Callingcircle (not recommended) simulates SQL generated for online telecom applications. It requires a data file to be generated from the database server and copied to the load generator before each run, typically requiring 1 to 8 GB of disk space. The two benchmarks are CPU intensive. Experience shows that you need at least 1 processor load generators to every two processors on the database server. It is designed to emphasize CPU and memory without the need for a strong I/O subsystem. It is installed using "Ccwizard" located in the bin directory
Stresstest only triggers random insertions, updates, selections, and updates based on a well-known table.
The JSON Stresstest is based on a simple JSON document modeled on people flying between airports. It follows the basic CRUD model.
Tpc-ds like Benchmark is a benchmark similar to Tpc-ds. It has query and transactional workloads in a separate configuration file.
Swingbench Download:
Swingbench Official website: http://www.dominicgiles.com/ swingbench.html, you can download the latest 2.6 version of the swingbench, you need to install a good jdk8, you can download the RPM installation directly from the Oracle official website. Swingbench package file after decompression as follows:
650) this.width=650; "Src=" https://s4.51cto.com/wyfs02/M00/9D/6F/wKioL1mAH66Tu6jfAABw2dC3Nq0785.png-wh_500x0-wm_ 3-wmp_4-s_42154859.png "title=" qq picture 20170801111918.png "alt=" Wkiol1mah66tu6jfaabw2dc3nq0785.png-wh_50 "/>
To generate test data:
As an example of order entry:
Graphical interface to generate test data and pressure measurement:
Cd/tmp/swingbench/bin
./oewizard
650) this.width=650; "Src=" https://s5.51cto.com/wyfs02/M00/9D/6F/wKiom1mAIOvRTr9yAAGgACMP7fc651.png-wh_500x0-wm_ 3-wmp_4-s_2662797300.png "style=" Float:none; "title=" CentOS 64-bit -2017-08-01-12-58-45.png "alt=" Wkiom1maiovrtr9yaaggacmp7fc651.png-wh_50 "/>
Choose Version2.0, Next
650) this.width=650; "Src=" https://s5.51cto.com/wyfs02/M00/9D/6F/wKioL1mAIOvRDR6ZAAGYcmCUvYk335.png-wh_500x0-wm_ 3-wmp_4-s_2920412658.png "style=" Float:none; "title=" CentOS 64-bit -2017-08-01-13-00-17.png "alt=" Wkiol1maiovrdr6zaagycmcuvyk335.png-wh_50 "/>
Select Create the order entry Schema,next
650) this.width=650; "Src=" https://s5.51cto.com/wyfs02/M01/9D/6F/wKiom1mAIS7T1CMHAAGKzwDR9s4350.png-wh_500x0-wm_ 3-wmp_4-s_2049952013.png "style=" Float:none; "title=" CentOS 64-bit -2017-08-01-13-00-50.png "alt=" Wkiom1mais7t1cmhaagkzwdr9s4350.png-wh_50 "/>
Configure connect string, username, and password, next
650) this.width=650; "Src=" https://s4.51cto.com/wyfs02/M01/9D/6F/wKiom1mAIS_BK4y2AAG0EHiuWUY624.png-wh_500x0-wm_ 3-wmp_4-s_2019115324.png "style=" Float:none; "title=" CentOS 64-bit -2017-08-01-13-02-55.png "alt=" Wkiom1mais_ Bk4y2aag0ehiuwuy624.png-wh_50 "/>
Configuring Tablespaces's DataFile, next
650) this.width=650; "Src=" https://s4.51cto.com/wyfs02/M01/9D/6F/wKioL1mAITDQ3XK1AAGepHvt7_o842.png-wh_500x0-wm_ 3-wmp_4-s_2479872268.png "style=" Float:none; "title=" CentOS 64-bit -2017-08-01-13-03-33.png "alt=" Wkiol1maitdq3xk1aagephvt7_o842.png-wh_50 "/>
Configure the size of the schema, next
650) this.width=650; "Src=" https://s4.51cto.com/wyfs02/M01/9D/6F/wKioL1mAITHBPGq4AAG-urt05v8832.png-wh_500x0-wm_ 3-wmp_4-s_1344587525.png "style=" Float:none; "title=" CentOS 64-bit -2017-08-01-13-03-47.png "alt=" Wkiol1maithbpgq4aag-urt05v8832.png-wh_50 "/>
The default value is the number of CPUs * *, Next
650) this.width=650; "Src=" https://s3.51cto.com/wyfs02/M02/9D/6F/wKiom1mAITLQ3R5JAAGZveV91-Q754.png-wh_500x0-wm_ 3-wmp_4-s_15110621.png "style=" Float:none; "title=" CentOS 64-bit -2017-08-01-13-03-59.png "alt=" Wkiom1maitlq3r5jaagzvev91-q754.png-wh_50 "/>
Click Yes, next
650) this.width=650; "Src=" https://s2.51cto.com/wyfs02/M02/9D/6F/wKioL1mAITOwDpO6AAGBu6-oL2g148.png-wh_500x0-wm_ 3-wmp_4-s_2347207238.png "style=" Float:none; "title=" CentOS 64-bit -2017-08-01-13-04-09.png "alt=" Wkiol1maitowdpo6aagbu6-ol2g148.png-wh_50 "/>
Start to run the SQL script production test data and wait here.
650) this.width=650; "Src=" https://s2.51cto.com/wyfs02/M00/9D/6F/wKiom1mAITPxje7dAAE9YrSiuRA643.png-wh_500x0-wm_ 3-wmp_4-s_3223022596.png "style=" Float:none; "title=" CentOS 64-bit -2017-08-01-13-04-16.png "alt=" Wkiom1maitpxje7daae9yrsiura643.png-wh_50 "/>
The data has been successfully generated and can then be measured.
650) this.width=650; "Src=" https://s5.51cto.com/wyfs02/M00/9D/6F/wKioL1mAITShJCoMAAHojWoiXAg998.png-wh_500x0-wm_ 3-wmp_4-s_461793762.png "style=" Float:none; "title=" CentOS 64-bit -2017-08-01-13-12-53.png "alt=" Wkiol1maitshjcomaahojwoixag998.png-wh_50 "/>
Start Performance pressure test:
Cd/tmp/swingbench/bin
./swingbench
Modify the connect string, configure the server monitoring related configuration parameters, adjust the transtions load ratio, number of users.
650) this.width=650; "Src=" https://s3.51cto.com/wyfs02/M00/9D/6F/wKiom1mAImSDm4-8AAIGr3Z2WhI400.png-wh_500x0-wm_ 3-wmp_4-s_663059761.png "style=" Float:none; "title=" CentOS 64-bit -2017-08-01-13-18-03.png "alt=" Wkiom1maimsdm4-8aaigr3z2whi400.png-wh_50 "/>
You can collect database information and generate an AWR report. Start-Up pressure measurement
650) this.width=650; "Src=" https://s3.51cto.com/wyfs02/M00/9D/6F/wKioL1mAImWiTqh-AAJCSlKENhc681.png-wh_500x0-wm_ 3-wmp_4-s_3671113386.png "style=" Float:none; "title=" CentOS 64-bit -2017-08-01-13-23-19.png "alt=" Wkiol1maimwitqh-aajcslkenhc681.png-wh_50 "/>
Test results can be viewed on the Output tab
650) this.width=650; "Src=" https://s2.51cto.com/wyfs02/M00/9D/6F/wKiom1mAJGngEKVfAAK5HL7PJYo782.png-wh_500x0-wm_ 3-wmp_4-s_1308131402.png "title=" CentOS 64-bit -2017-08-01-14-48-35.png "alt=" Wkiom1majgngekvfaak5hl7pjyo782.png-wh_ "/>
You can also save the results in the bin directory, in XML format
650) this.width=650; "Src=" https://s2.51cto.com/wyfs02/M02/9D/6F/wKioL1mAJb2wmcXoAALEwMUs1Dk163.png-wh_500x0-wm_ 3-wmp_4-s_2411162482.png "title=" CentOS 64-bit -2017-08-01-14-53-37.png "alt=" Wkiol1majb2wmcxoaalewmus1dk163.png-wh_ "/>
Test results compare to generate HTML file, with Bmcompare tool
650) this.width=650; "Src=" https://s5.51cto.com/wyfs02/M00/9D/6F/wKiom1mAJv-S07FIAAAyh-V8Jg0464.png-wh_500x0-wm_ 3-wmp_4-s_3427222925.png "title=" Qq.png "alt=" Wkiom1majv-s07fiaaayh-v8jg0464.png-wh_50 "/>
650) this.width=650; "Src=" https://s2.51cto.com/wyfs02/M00/9D/70/wKiom1mAJ87DCE4VAAIqoX3QNrg048.png-wh_500x0-wm_ 3-wmp_4-s_1806021206.png "title=" CentOS 64-bit -2017-08-01-15-03-27.png "alt=" Wkiom1maj87dce4vaaiqox3qnrg048.png-wh_ "/>
The command-line interface generates test data and pressure measurements:
[[Email protected] bin]# time ./oewizard -cl -create -scale 1 -cs //oracle:1521/xcky -dba system -dbap oracle -u soe1 -p soe1 -ts soe -df /u01/app/oracle/oradata/xcky/soe.dbf -tc 4 -s The following Statement failed : grant execute on dbms_lock to soe1 : due to : ora-01031: insufficient privilegesthe following statement failed : begin $IF dbms_db_version. ver_le_10_2 $THEN -- use&Nbsp;the default stats collection approach dbms_stats.gather_ Schema_stats ( OWNNAME=> ' SOE1 ' ,estimate_percent=>dbms_stats. auto_sample_size ,BLOCK_SAMPLE=>TRUE ,METHOD_OPT=> ' for all columns size skewonly ' ,degree=> 4 , Granularity=> ' All ' ,cascade=>true); $ELSIF dbms_db_version. ver_le_11_2 $THEN -- oracle 11g release 2. emable concurrent stats collection dbms_ Output.put_line (' database version is less than or equal to 11.2 '); dbms_stats. Set_global_prefs (' CONCURRENT ', ' TRUE '); dbms_stats. Set_table_prefs (' SOE1 ', ' warehouses ', ' INCREMENTAL ', ' TRUE '); dbms_stats. Set_table_prefs (' SOE1 ', ' inventories ', ' INCREMENTAL ', ' TRUE '); dbms_stats. Set_table_prefs (' SOE1 ', ' product_information ', ' INCREMENTAL ', ' TRUE '); dbms_ STATS. Set_table_prefs (' SOE1 ', ' product_descriptions ', ' INCREMENTAL ', ' TRUE '); dbms_ STATS. Set_tabLe_prefs (' SOE1 ', ' orderentry_metadata ', ' INCREMENTAL ', ' TRUE '); dbms_stats. Set_table_prefs (' SOE1 ', ' CUSTOMERS ', ' INCREMENTAL ', ' TRUE '); dbms_stats. Set_table_prefs (' SOE1 ', ' ADDRESSES ', ' INCREMENTAL ', ' TRUE '); dbms_stats. Set_table_prefs (' SOE1 ', ' order_items ', ' INCREMENTAL ', ' TRUE '); dbms_stats. Set_table_prefs (' SOE1 ', ' ORDERS ', ' INCREMENTAL ', ' TRUE '); dbms_stats. Set_table_prefs (' SOE1 ', ' LOGON ', ' INCREMENTAL ', ' TRUE '); dbms_stats. Gather_schema_stats (' SOE1 '); $ELSIF dbms_db_version. ver_le_12 $THEN -- oracle 12c. concurrent Stats collection work slightly different in this release execute immediate q ' [alter system set resource_manager_plan = ' Default_plan '; execute immediate q ' [alter system set job_queue_processes = 4 ] '; dbms_stats. Set_global_prefs (' CONCURRENT ', ' MANUAL '); dbms_stats. Set_table_prefs (' SOE1 ', ' warehouses ', ' INCREMENTAL ', ' TRUE '); dbms_stats. Set_table_prefs (' SOE1 ', ' inventories ', ' INCREMENTAL ', ' TRUE '); dbms_stats. Set_table_prefs (' SOE1 ', ' product_information ', ' INCREMENTAL ', ' TRUE '); dbms_ STATS. Set_table_prefs (' SOE1 ', ' product_descriptions ', ' INCREMENTAL ', ' TRUE '); dbms_ STATS. Set_table_prefs (' SOE1 ', ' orderentry_metadata ', ' INCREMENTAL ', ' TRUE '); dbms_ STATS. Set_table_prefs (' SOE1 ', ' CUSTOMERS ', ' INCREMENTAL ', ' TRUE '); dbms_stats. Set_table_prefs (' SOE1 ', ' ADDRESSES ', ' INCREMENTAL ', ' TRUE '); dbms_stats. Set_table_prefs (' SOE1 ', ' order_items ', ' INCREMENTAL ', ' TRUE '); dbms_stats. Set_table_prefs (' SOE1 ', ' ORDERS ', ' INCREMENTAL ', ' TRUE '); dbms_stats. Set_table_prefs (' SOE1 ', ' LOGON ', ' INCREMENTAL ', ' TRUE '); dbms_stats. Gather_schema_stats (' SOE1 '); $END end; : Due to : ora-20001: invalid input values for pnameora-06512: at "SYS. Dbms_stats ", line 26595ora-06512: at " SYS. Dbms_stats ", line 26751ora-06512: at line 17========================================= ===| datagenerator run stats |============================================connection time 0:00:00.004Data Generation Time 0:03:18.996DDL Creation Time 0:03:47.528Total Run Time 0:07:06.530rows inserted per sec 60,836Data Generated ( MB) per sec 5.0actual rows generated 13,002,033post creation validation report================== =============the creation of the schema appears to have been Unsuccessful. see the following sections for further details. valid objects=============valid tables : ' ORDERS ', ' order_items ', ' CUSTOMERS ', ' warehouses ', ' Orderentry_metadata ', ' inventories ', ' product_information ', ' product_descriptions ', ' ADDRESSES ', ' card_details ' valid indexes : ' prd_desc_pk ', ' Prod_name_ix ', ' product_information_pk ', ' PROD_SUPPLIER_IX ', ' PROD_ Category_ix ', ' inventory_pk ', ' Inv_product_ix ', ' Inv_warehouse_ix ', ' order_pk ', ' Ord_sales_rep_ix ', ' ORD_CUSTOMER_IX ' ', ' Ord_order_date_ix ', ' Ord_warehouse_ix ', ' order_items_pk ', ' Item_order_ix ', ' Item_product_ix ', ' WAREHOUSES_PK ', ' Whs_location_ix ', ' customers_pk ', ' cust_Email_ix ', ' Cust_account_manager_ix ', ' Cust_func_lower_name_ix ', ' address_pk ', ' Address_cust_ix ', ' CARD_DETAILS_PK ' , ' Carddetails_cust_ix ' valid views : ' products ', ' product_prices ' valid sequences : ' customer_seq ', ' orders_seq ', ' address_seq ', ' logon_seq ', ' Card_details_seq ' valid code : invalid objects (1) ================invalid tables : invalid indexes : invalid views : invalid sequences : invalid code : ' ORDERENTRY ' missing objects (0) ================missing tables : missing indexes : missing views : missing sequences : missing code : schema createdreal 7m51.663suser 3m23.913ssys 0m24.096s[[email protected] bin]# ./charbench -u soe1 -p soe1 - Uc 1 -min 10 -max 200 -rt 00:01 -a -s -r scale1_100user.xml
In addition to the Swingbench tool, Swingbench provides other widgets for monitoring Oracle databases such as Cpumonitor, Dbtimemonitor, Monitordb, DataGenerator, etc.
MONITORDB Tools:
Cd/tmp/monitordb/bin
Modify the configuration file Monitordb.xml, username, password, and ConnectString are configured to save, start the program.
./monitordb
650) this.width=650; "Src=" https://s3.51cto.com/wyfs02/M01/9D/6F/wKiom1mAImaSOSMCAAF9FL2OUdQ975.png-wh_500x0-wm_ 3-wmp_4-s_2233412268.png "style=" Float:none; "title=" CentOS 64-bit -2017-08-01-13-55-20.png "alt=" Wkiom1maimasosmcaaf9fl2oudq975.png-wh_50 "/>
such as Dbtimemonitor tools:
Cd/tmp/dbtimemonitor/bin
Modify the configuration file Databases.xml, username, password, and ConnectString are configured to save, start the program.
./dbtimemonitor
650) this.width=650; "Src=" https://s2.51cto.com/wyfs02/M02/9D/6F/wKiom1mAImeCtPJiAAJVxO-i5c8894.png-wh_500x0-wm_ 3-wmp_4-s_829645294.png "style=" Float:none; "title=" CentOS 64-bit -2017-08-01-13-58-14.png "alt=" Wkiom1maimectpjiaajvxo-i5c8894.png-wh_50 "/>
such as Cpumonitor tools:
Cd/tmp/cpumonitor/bin
Modify the configuration file Cpu.xml, save hostname, username, and password, and start the program
./cpumonitor
650) this.width=650; "Src=" https://s5.51cto.com/wyfs02/M00/9D/70/wKioL1mAKgGiFoRcAAIw9Bm__GM802.png-wh_500x0-wm_ 3-wmp_4-s_3258586953.png "title=" CentOS 64-bit -2017-08-01-15-12-31.png "alt=" Wkiol1makggiforcaaiw9bm__gm802.png-wh_ "/>
Resources:
http://blog.csdn.net/xiaofan23z/article/details/7978998
Http://www.dominicgiles.com/swingbench.html
This article is from the "Lin Zhijian blog" blog, make sure to keep this source http://linzhijian.blog.51cto.com/1047212/1952637
swingbench-Free Oracle Performance pressure measurement tool