swingbench-免費的oracle效能壓測工具

來源:互聯網
上載者:User

標籤:oracle   swingbench   

    SwingBench介紹:

    SwingBench由負載產生器,協調器和叢集概述組成。該軟體使得能夠產生負載並且將圖表的事務/回應時間映射。

    SwingBench可用於示範和測試諸如實際應用叢集,線上表重建,備用資料庫,線上備份和恢複等技術

    SwingBench附帶的程式碼封裝括6個基準,OrderEntry,SalesHistory,TPC-DS Like,JSON,CallingCircle和StressTest ..

    OrderEntry基於Oracle11g / Oracle12c附帶的“oe”模式。它已被修改,以便不需要安裝Spatial,Intermedia架構。它可以連續運行(直到你用完了空間)。它在少量表上引入了大量爭用,旨在強調互連和記憶體。它使用位於bin目錄中的“oewizard”進行安裝。基準測試都存在純jdbc和pl / sql(較低的網路開銷)變體。

    SalesHistory基於Oracle11g / Oracle12c附帶的“sh”架構,旨在測試複雜查詢在對大型表進行運行時的效能。它是唯讀,可以按照從1GB到1TB的預設大小進行縮放。自訂模式還允許建立更小和更大的模式

    CallingCircle(不建議使用)類比為線上電信應用程式產生的SQL。它需要在每次運行之前將資料檔案從資料庫伺服器產生並複製到負載產生器,通常需要1到8 GB的磁碟空間。兩個基準都是CPU密集型。經驗表明,您至少需要1台處理器的負載發生器到資料庫伺服器的每兩個處理器。它旨在強調CPU和記憶體,而不需要強大的I / O子系統。它使用位於bin目錄中的“ccwizard”進行安裝

    StressTest只是根據一個熟知的表來觸發隨機插入,更新,選擇和更新。

    JSON Stresstest基於對機場之間飛行的人員進行建模的簡單JSON文檔。它遵循基本的CRUD模型。

    TPC-DS喜歡Benchmark是類似於TPC-DS的基準。它在單獨的設定檔中具有查詢和事務工作負載。

    SwingBench下載:

    SwingBench官方網址:http://www.dominicgiles.com/swingbench.html,可以download下最新2.6版本的SwingBench,需要先安裝好jdk8,可以直接從oracle官網下載rpm安裝即可。SwingBench包檔案解壓後如下:

    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圖片20170801111918.png" alt="wKioL1mAH66Tu6jfAABw2dC3Nq0785.png-wh_50" />

    產生測試資料:

    以order entry為樣本:

    圖形介面產生測試資料和壓測:

    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 位元-2017-08-01-12-58-45.png" alt="wKiom1mAIOvRTr9yAAGgACMP7fc651.png-wh_50" />

    選擇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 位元-2017-08-01-13-00-17.png" alt="wKioL1mAIOvRDR6ZAAGYcmCUvYk335.png-wh_50" />

    選擇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 位元-2017-08-01-13-00-50.png" alt="wKiom1mAIS7T1CMHAAGKzwDR9s4350.png-wh_50" />

    配置connect string、username和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 位元-2017-08-01-13-02-55.png" alt="wKiom1mAIS_BK4y2AAG0EHiuWUY624.png-wh_50" />

    配置tablespaces的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 位元-2017-08-01-13-03-33.png" alt="wKioL1mAITDQ3XK1AAGepHvt7_o842.png-wh_50" />

    配置schema的size, 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 位元-2017-08-01-13-03-47.png" alt="wKioL1mAITHBPGq4AAG-urt05v8832.png-wh_50" />

    預設值為CPU個數*2, 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 位元-2017-08-01-13-03-59.png" alt="wKiom1mAITLQ3R5JAAGZveV91-Q754.png-wh_50" />

    點擊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 位元-2017-08-01-13-04-09.png" alt="wKioL1mAITOwDpO6AAGBu6-oL2g148.png-wh_50" />

    開始運行sql指令碼生產測試資料,這裡需要等待。

    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 位元-2017-08-01-13-04-16.png" alt="wKiom1mAITPxje7dAAE9YrSiuRA643.png-wh_50" />

    資料已成功產生,接下來可以做壓測了。

    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 位元-2017-08-01-13-12-53.png" alt="wKioL1mAITShJCoMAAHojWoiXAg998.png-wh_50" />


    開始效能壓測:

    cd /tmp/swingbench/bin

    ./swingbench

    修改connect string,配置server monitoring相關配置參數,調整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 位元-2017-08-01-13-18-03.png" alt="wKiom1mAImSDm4-8AAIGr3Z2WhI400.png-wh_50" />

    可以收集資料庫資訊,產生awr報告。啟動壓測

    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 位元-2017-08-01-13-23-19.png" alt="wKioL1mAImWiTqh-AAJCSlKENhc681.png-wh_50" />

    可以在output標籤上查看壓測結果

    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 位元-2017-08-01-14-48-35.png" alt="wKiom1mAJGngEKVfAAK5HL7PJYo782.png-wh_50" />

    也可以在將結果儲存在bin目錄下,XML格式

    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 位元-2017-08-01-14-53-37.png" alt="wKioL1mAJb2wmcXoAALEwMUs1Dk163.png-wh_50" />

    測試結果對比產生html檔案,用bmcompare工具

    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 位元-2017-08-01-15-03-27.png" alt="wKiom1mAJ87DCE4VAAIqoX3QNrg048.png-wh_50" />


    命令列介面產生測試資料和壓測:

[[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 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

    

    SwingBench官網上除了提供swingbench壓測工具外,還提供了其他監控oracle資料庫的小工具,例如cpumonitor、dbtimemonitor、monitorDB、datagenerator等

    monitorDB工具:

    cd /tmp/MonitorDB/bin

    修改設定檔monitordb.xml,將Username、Password和ConnectString進行配置後儲存,啟動程式。

    ./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 位元-2017-08-01-13-55-20.png" alt="wKiom1mAImaSOSMCAAF9FL2OUdQ975.png-wh_50" />

    如dbtimemonitor工具:

    cd /tmp/dbtimemonitor/bin

    修改設定檔databases.xml,將Username、Password和ConnectString進行配置後儲存,啟動程式。

    ./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 位元-2017-08-01-13-58-14.png" alt="wKiom1mAImeCtPJiAAJVxO-i5c8894.png-wh_50" />

    如cpumonitor工具:

    cd /tmp/cpumonitor/bin

    修改設定檔cpu.xml,將HostName、Username和Password修改後儲存,啟動程式

    ./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 位元-2017-08-01-15-12-31.png" alt="wKioL1mAKgGiFoRcAAIw9Bm__GM802.png-wh_50" />


    參考資料:

    http://blog.csdn.net/xiaofan23z/article/details/7978998

    http://www.dominicgiles.com/swingbench.html

    



    

本文出自 “林志堅的部落格” 部落格,請務必保留此出處http://linzhijian.blog.51cto.com/1047212/1952637

swingbench-免費的oracle效能壓測工具

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.