Skip to content

Instantly share code, notes, and snippets.

@rmoff
Last active December 14, 2015 22:59
Show Gist options
  • Save rmoff/5162390 to your computer and use it in GitHub Desktop.
Save rmoff/5162390 to your computer and use it in GitHub Desktop.
An example of using JMeter to send Logical SQL to OBIEE via JDBC

To use, download the jmeter_jdbc_obi_simple.jmx file from this gist, and open it in JMeter.

For it to work, you must make the OBIEE JDBC driver availabel to JMeter, which can be done in two ways. Put jdk16/bijdbc.jar in the JMeter classpath, or specify it directly using Add directory or jar to classpath option in the top level Test Plan step.

You will find jdk16/bijdbc.jar in $FMW_HOME/Oracle_BI1/bifoundation/jdbc/

<?xml version="1.0" encoding="UTF-8"?>
<jmeterTestPlan version="1.2" properties="2.3" jmeter="2.8 r1393162">
<hashTree>
<TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="OBIEE Logical SQL test" enabled="true">
<stringProp name="TestPlan.comments">[[ RNM 2013-03 ]]</stringProp>
<boolProp name="TestPlan.functional_mode">false</boolProp>
<boolProp name="TestPlan.serialize_threadgroups">false</boolProp>
<elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
<collectionProp name="Arguments.arguments"/>
</elementProp>
<stringProp name="TestPlan.user_define_classpath"></stringProp>
</TestPlan>
<hashTree>
<Arguments guiclass="ArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
<collectionProp name="Arguments.arguments">
<elementProp name="LSQL" elementType="Argument">
<stringProp name="Argument.name">LSQL</stringProp>
<stringProp name="Argument.value">SET VARIABLE QUERY_SRC_CD=&apos;Report&apos;,SAW_DASHBOARD=&apos;/shared/3. Analysis and Dashboards/_portal/3.10 Query Building&apos;,SAW_DASHBOARD_PG=&apos;Hierarchical Columns&apos;,SAW_SRC_PATH=&apos;/shared/3. Analysis and Dashboards/Query Elements/Hier Columns/Value Based (Parent Child) Hierarchy&apos;,PREFERRED_CURRENCY=&apos;USD&apos;;SELECT s_0, s_1, s_2, s_3, s_4, s_5, s_6, s_7, s_8, s_9 FROM ( SELECT 0 s_0, &quot;A - Sample Sales&quot;.&quot;Sales Person&quot;.&quot;E1 Sales Rep Name&quot; s_1, CAST(NULL AS VARCHAR(1)) s_2, &apos;Total Time&apos; s_3, CASE WHEN ISLEAF(&quot;A - Sample Sales&quot;.&quot;Sales Person&quot;.&quot;Sales Rep Hierarchy&quot;) THEN 1 ELSE 0 END s_4, IDOF(&quot;A - Sample Sales&quot;.&quot;Sales Person&quot;.&quot;Sales Rep Hierarchy&quot;) s_5, IDOF(&quot;A - Sample Sales&quot;.&quot;Time&quot;.&quot;Time Hierarchy&quot;.&quot;Total Time&quot;) s_6, CAST(NULL AS VARCHAR(1)) s_7, PARENT(&quot;A - Sample Sales&quot;.&quot;Sales Person&quot;.&quot;Sales Rep Hierarchy&quot;) s_8, &quot;A - Sample Sales&quot;.&quot;Base Facts&quot;.&quot;1- Revenue&quot; s_9 FROM &quot;A - Sample Sales&quot; WHERE (ISROOT(&quot;A - Sample Sales&quot;.&quot;Sales Person&quot;.&quot;Sales Rep Hierarchy&quot;)) OR (ISCHILD(&quot;A - Sample Sales&quot;.&quot;Sales Person&quot;.&quot;Sales Rep Hierarchy&quot;,(27,26))) UNION ALL SELECT 1 s_0, &quot;A - Sample Sales&quot;.&quot;Sales Person&quot;.&quot;E1 Sales Rep Name&quot; s_1, &quot;A - Sample Sales&quot;.&quot;Time&quot;.&quot;T05 Per Name Year&quot; s_2, &apos;Total Time&apos; s_3, CASE WHEN ISLEAF(&quot;A - Sample Sales&quot;.&quot;Sales Person&quot;.&quot;Sales Rep Hierarchy&quot;) THEN 1 ELSE 0 END s_4, IDOF(&quot;A - Sample Sales&quot;.&quot;Sales Person&quot;.&quot;Sales Rep Hierarchy&quot;) s_5, IDOF(&quot;A - Sample Sales&quot;.&quot;Time&quot;.&quot;Time Hierarchy&quot;.&quot;Total Time&quot;) s_6, IDOF(&quot;A - Sample Sales&quot;.&quot;Time&quot;.&quot;Time Hierarchy&quot;.&quot;Year&quot;) s_7, PARENT(&quot;A - Sample Sales&quot;.&quot;Sales Person&quot;.&quot;Sales Rep Hierarchy&quot;) s_8, &quot;A - Sample Sales&quot;.&quot;Base Facts&quot;.&quot;1- Revenue&quot; s_9 FROM &quot;A - Sample Sales&quot; WHERE (IDOF(&quot;A - Sample Sales&quot;.&quot;Time&quot;.&quot;Time Hierarchy&quot;.&quot;Total Time&quot;) IN (1)) AND ((ISROOT(&quot;A - Sample Sales&quot;.&quot;Sales Person&quot;.&quot;Sales Rep Hierarchy&quot;)) OR (ISCHILD(&quot;A - Sample Sales&quot;.&quot;Sales Person&quot;.&quot;Sales Rep Hierarchy&quot;,(27,26)))) ) djm ORDER BY 1 FETCH FIRST 5000001 ROWS ONLY</stringProp>
<stringProp name="Argument.metadata">=</stringProp>
</elementProp>
</collectionProp>
</Arguments>
<hashTree/>
<ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="Thread Group" enabled="true">
<stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
<elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true">
<boolProp name="LoopController.continue_forever">false</boolProp>
<stringProp name="LoopController.loops">1</stringProp>
</elementProp>
<stringProp name="ThreadGroup.num_threads">1</stringProp>
<stringProp name="ThreadGroup.ramp_time">1</stringProp>
<longProp name="ThreadGroup.start_time">1363271818000</longProp>
<longProp name="ThreadGroup.end_time">1363271818000</longProp>
<boolProp name="ThreadGroup.scheduler">false</boolProp>
<stringProp name="ThreadGroup.duration"></stringProp>
<stringProp name="ThreadGroup.delay"></stringProp>
</ThreadGroup>
<hashTree>
<JDBCDataSource guiclass="TestBeanGUI" testclass="JDBCDataSource" testname="JDBC Connection Configuration" enabled="true">
<boolProp name="autocommit">true</boolProp>
<stringProp name="checkQuery"></stringProp>
<stringProp name="connectionAge">5000</stringProp>
<stringProp name="dataSource">OBI</stringProp>
<stringProp name="dbUrl">jdbc:oraclebi://sampleapp:9703/</stringProp>
<stringProp name="driver">oracle.bi.jdbc.AnaJdbcDriver</stringProp>
<boolProp name="keepAlive">true</boolProp>
<stringProp name="password">Admin123</stringProp>
<stringProp name="poolMax">1</stringProp>
<stringProp name="timeout">10000</stringProp>
<stringProp name="transactionIsolation">DEFAULT</stringProp>
<stringProp name="trimInterval">60000</stringProp>
<stringProp name="username">Prodney</stringProp>
</JDBCDataSource>
<hashTree/>
<JDBCSampler guiclass="TestBeanGUI" testclass="JDBCSampler" testname="JDBC Request" enabled="true">
<stringProp name="dataSource">OBI</stringProp>
<stringProp name="query">${LSQL}</stringProp>
<stringProp name="queryArguments"></stringProp>
<stringProp name="queryArgumentsTypes"></stringProp>
<stringProp name="queryType">Select Statement</stringProp>
<stringProp name="resultVariable"></stringProp>
<stringProp name="variableNames"></stringProp>
</JDBCSampler>
<hashTree/>
</hashTree>
<ResultCollector guiclass="TableVisualizer" testclass="ResultCollector" testname="View Results in Table" enabled="true">
<boolProp name="ResultCollector.error_logging">false</boolProp>
<objProp>
<name>saveConfig</name>
<value class="SampleSaveConfiguration">
<time>true</time>
<latency>true</latency>
<timestamp>true</timestamp>
<success>true</success>
<label>true</label>
<code>true</code>
<message>true</message>
<threadName>true</threadName>
<dataType>true</dataType>
<encoding>false</encoding>
<assertions>true</assertions>
<subresults>true</subresults>
<responseData>false</responseData>
<samplerData>false</samplerData>
<xml>true</xml>
<fieldNames>false</fieldNames>
<responseHeaders>false</responseHeaders>
<requestHeaders>false</requestHeaders>
<responseDataOnError>false</responseDataOnError>
<saveAssertionResultsFailureMessage>false</saveAssertionResultsFailureMessage>
<assertionsResultsToSave>0</assertionsResultsToSave>
<bytes>true</bytes>
</value>
</objProp>
<stringProp name="filename"></stringProp>
</ResultCollector>
<hashTree/>
<ResultCollector guiclass="ViewResultsFullVisualizer" testclass="ResultCollector" testname="View Results Tree" enabled="true">
<boolProp name="ResultCollector.error_logging">false</boolProp>
<objProp>
<name>saveConfig</name>
<value class="SampleSaveConfiguration">
<time>true</time>
<latency>true</latency>
<timestamp>true</timestamp>
<success>true</success>
<label>true</label>
<code>true</code>
<message>true</message>
<threadName>true</threadName>
<dataType>true</dataType>
<encoding>false</encoding>
<assertions>true</assertions>
<subresults>true</subresults>
<responseData>false</responseData>
<samplerData>false</samplerData>
<xml>true</xml>
<fieldNames>false</fieldNames>
<responseHeaders>false</responseHeaders>
<requestHeaders>false</requestHeaders>
<responseDataOnError>false</responseDataOnError>
<saveAssertionResultsFailureMessage>false</saveAssertionResultsFailureMessage>
<assertionsResultsToSave>0</assertionsResultsToSave>
<bytes>true</bytes>
</value>
</objProp>
<stringProp name="filename"></stringProp>
</ResultCollector>
<hashTree/>
</hashTree>
</hashTree>
</jmeterTestPlan>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment