Skip to content

Commit 6ba8da3

Browse files
ngbanguyenbpkrothapavlo
authored
Oracle db support (#379)
Co-authored-by: Brian Kroth <[email protected]> Co-authored-by: Andy Pavlo <[email protected]>
1 parent 33c7925 commit 6ba8da3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+2536
-388
lines changed

.github/workflows/maven.yml

Lines changed: 78 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858
runs-on: ubuntu-latest
5959
strategy:
6060
matrix:
61-
profile: [ 'cockroachdb', 'mariadb', 'mysql', 'postgres', 'spanner', 'phoenix', 'sqlserver', 'sqlite' ]
61+
profile: [ 'cockroachdb', 'mariadb', 'mysql', 'oracle', 'phoenix', 'postgres', 'spanner', 'sqlite', 'sqlserver' ]
6262
steps:
6363
- name: Checkout repo
6464
uses: actions/checkout@v4
@@ -271,6 +271,83 @@ jobs:
271271
fi
272272
./scripts/check_histogram_results.sh results/histograms.json $ERRORS_THRESHOLD
273273
274+
## ----------------------------------------------------------------------------------
275+
## ORACLE
276+
## ----------------------------------------------------------------------------------
277+
oracle:
278+
needs: package-and-upload
279+
runs-on: ubuntu-latest
280+
strategy:
281+
fail-fast: false
282+
matrix:
283+
benchmark: [ 'auctionmark', 'epinions', 'hyadapt', 'otmetrics', 'resourcestresser', 'seats', 'sibench', 'smallbank', 'tatp', 'tpcc', 'twitter', 'voter', 'wikipedia', 'ycsb', 'templated' ]
284+
services:
285+
oracle:
286+
image: gvenzl/oracle-xe:21.3.0-slim-faststart
287+
ports:
288+
- "1521:1521"
289+
- "5500:5500"
290+
env:
291+
ORACLE_PASSWORD: password
292+
ORACLE_CHARACTERSET: AL32UTF8
293+
APP_USER: benchbase
294+
APP_USER_PASSWORD: password
295+
options: >-
296+
--name oracle
297+
--health-cmd "echo exit | sqlplus benchbase/password@xepdb1 | grep Connected"
298+
--health-interval 10s
299+
--health-timeout 5s
300+
--health-retries 5
301+
--health-start-period 5s
302+
steps:
303+
- name: Download artifact
304+
uses: actions/download-artifact@v3
305+
with:
306+
name: benchbase-oracle
307+
308+
- name: Extract artifact
309+
run: |
310+
tar xvzf benchbase-oracle.tgz --strip-components=1
311+
312+
- name: Delete artifact
313+
run: |
314+
rm -rf benchbase-oracle.tgz
315+
316+
- name: Set up user reset script
317+
run: |
318+
docker cp config/oracle/scripts/reset.sql oracle:/opt/oracle/reset.sql
319+
320+
- name: Set up JDK
321+
uses: actions/setup-java@v3
322+
with:
323+
java-version: ${{env.JAVA_VERSION}}
324+
distribution: 'temurin'
325+
326+
- name: Run benchmark
327+
run: |
328+
docker exec oracle sqlplus "sys/password@xepdb1 as sysdba" @reset.sql
329+
# For templated benchmarks, we need to preload some data for the test since by design, templated benchmarks do not support the 'load' operation
330+
# In this case, we load the tpcc data.
331+
if [[ ${{matrix.benchmark}} == templated ]]; then
332+
java -jar benchbase.jar -b tpcc -c config/oracle/sample_tpcc_config.xml --create=true --load=true --execute=false --json-histograms results/histograms.json
333+
java -jar benchbase.jar -b ${{matrix.benchmark}} -c config/oracle/sample_${{matrix.benchmark}}_config.xml --create=false --load=false --execute=true --json-histograms results/histograms.json
334+
else
335+
java -jar benchbase.jar -b ${{matrix.benchmark}} -c config/oracle/sample_${{matrix.benchmark}}_config.xml --create=true --load=true --execute=true --json-histograms results/histograms.json
336+
fi
337+
# FIXME: Reduce the error rate so we don't need these overrides.
338+
if [ ${{matrix.benchmark}} == auctionmark ]; then
339+
ERRORS_THRESHOLD=0.04
340+
elif [ ${{matrix.benchmark}} == tatp ]; then
341+
ERRORS_THRESHOLD=0.05
342+
elif [ ${{matrix.benchmark}} == tpcc ]; then
343+
ERRORS_THRESHOLD=0.03
344+
elif [ ${{matrix.benchmark}} == resourcestresser ]; then
345+
ERRORS_THRESHOLD=0.04
346+
elif [ ${{matrix.benchmark}} == wikipedia ]; then
347+
ERRORS_THRESHOLD=0.02
348+
fi
349+
./scripts/check_histogram_results.sh results/histograms.json $ERRORS_THRESHOLD
350+
274351
## ----------------------------------------------------------------------------------
275352
## POSTGRESQL
276353
## ----------------------------------------------------------------------------------
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<?xml version="1.0"?>
2+
<parameters>
3+
4+
<!-- Connection details -->
5+
<type>ORACLE</type>
6+
<driver>oracle.jdbc.OracleDriver</driver>
7+
<url>jdbc:oracle:thin:@localhost:1521/xepdb1</url>
8+
<username>benchbase</username>
9+
<password>password</password>
10+
<isolation>TRANSACTION_SERIALIZABLE</isolation>
11+
<batchsize>128</batchsize>
12+
13+
<!-- Scalefactor in AuctionMark scales by *1000 the number of customers-->
14+
<scalefactor>1</scalefactor>
15+
16+
<!-- The workload -->
17+
<terminals>1</terminals>
18+
<works>
19+
<work>
20+
<time>60</time>
21+
<rate>10000</rate>
22+
<weights>45, 10, 20, 2, 1, 4, 10, 5, 3</weights>
23+
</work>
24+
</works>
25+
26+
<!-- AuctionMark Procedures declaration -->
27+
<transactiontypes>
28+
<transactiontype>
29+
<name>GetItem</name>
30+
</transactiontype>
31+
<transactiontype>
32+
<name>GetUserInfo</name>
33+
</transactiontype>
34+
<transactiontype>
35+
<name>NewBid</name>
36+
</transactiontype>
37+
<transactiontype>
38+
<name>NewComment</name>
39+
</transactiontype>
40+
<transactiontype>
41+
<name>NewCommentResponse</name>
42+
</transactiontype>
43+
<transactiontype>
44+
<name>NewFeedback</name>
45+
</transactiontype>
46+
<transactiontype>
47+
<name>NewItem</name>
48+
</transactiontype>
49+
<transactiontype>
50+
<name>NewPurchase</name>
51+
</transactiontype>
52+
<transactiontype>
53+
<name>UpdateItem</name>
54+
</transactiontype>
55+
</transactiontypes>
56+
</parameters>
Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
<?xml version="1.0"?>
2+
<parameters>
3+
4+
<!-- Connection details -->
5+
<type>ORACLE</type>
6+
<driver>oracle.jdbc.OracleDriver</driver>
7+
<url>jdbc:oracle:thin:@localhost:1521/xepdb1</url>
8+
<username>benchbase</username>
9+
<password>password</password>
10+
<isolation>TRANSACTION_SERIALIZABLE</isolation>
11+
<batchsize>128</batchsize>
12+
13+
<!-- Scale factor is the number of warehouses in TPCC -->
14+
<scalefactor>1</scalefactor>
15+
16+
<!-- The workload -->
17+
<!-- Number of terminal per workload -->
18+
<terminals>1</terminals>
19+
20+
<!-- Gather schema stats after loading to improve performance -->
21+
<!-- See src/main/resources/benchmarks/gather_schema_stats_oracle.sql -->
22+
<afterload>/benchmarks/gather_schema_stats_oracle.sql</afterload>
23+
24+
<!-- Extra Features (Commented Out) -->
25+
<!-- Can be workload-specific -->
26+
<!-- <terminals bench="tpcc">2</terminals> -->
27+
28+
<!-- Workload-specific options a marked with @bench=[workload_name] -->
29+
<!-- Workload-specific number of terminals -->
30+
<!-- <terminals bench="chbenchmark">2</terminals> -->
31+
32+
<works>
33+
34+
<!-- A Basic WorkPhase for Mixed Workloads -->
35+
<work>
36+
<time>60</time>
37+
38+
<!-- Note: The rate can be set to UNLIMITED or DISABLED -->
39+
<rate>200</rate>
40+
41+
<!-- Need to Specify transaction weights for each workload .. Otherwise the number of fields won't match -->
42+
<weights bench="tpcc">45,43,4,4,4</weights>
43+
<weights bench="chbenchmark">3, 2, 3, 2, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5</weights>
44+
</work>
45+
46+
<!-- Extra features showcase -->
47+
<!-- Extra features showcase -->
48+
<!-- <work> -->
49+
<!-- <time>60</time> -->
50+
51+
<!-- <rate>200</rate> -->
52+
<!-- <rate bench="chbenchmark">disabled</rate> -->
53+
54+
<!-- NOTE: TPCC workers won't be distributed evenly between warehouses if not all workers are active -->
55+
<!-- <active_terminals>1</active_terminals> -->
56+
<!-- <active_terminals bench="chbenchmark">1</active_terminals> -->
57+
58+
<!-- Specifies transaction weight for each workload. -->
59+
<!-- <weights bench="tpcc">45,43,4,4,4</weights> -->
60+
<!-- <weights bench="chbenchmark">3, 2, 3, 2, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5</weights> -->
61+
<!-- </work> -->
62+
63+
<!-- Extra features -->
64+
<!--
65+
<work>
66+
<time>60</time>
67+
68+
<rate>100</rate>
69+
<rate bench="chbenchmark">unlimited</rate>
70+
71+
<weights bench="tpcc">45,43,4,4,4</weights>
72+
<weights bench="chbenchmark">3, 2, 3, 2, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5</weights>
73+
</work>
74+
-->
75+
</works>
76+
77+
78+
<!-- CH specific -->
79+
<transactiontypes bench="chbenchmark">
80+
<transactiontype>
81+
<name>Q1</name>
82+
</transactiontype>
83+
<transactiontype>
84+
<name>Q2</name>
85+
</transactiontype>
86+
<transactiontype>
87+
<name>Q3</name>
88+
</transactiontype>
89+
<transactiontype>
90+
<name>Q4</name>
91+
</transactiontype>
92+
<transactiontype>
93+
<name>Q5</name>
94+
</transactiontype>
95+
<transactiontype>
96+
<name>Q6</name>
97+
</transactiontype>
98+
<transactiontype>
99+
<name>Q7</name>
100+
</transactiontype>
101+
<transactiontype>
102+
<name>Q8</name>
103+
</transactiontype>
104+
<transactiontype>
105+
<name>Q9</name>
106+
</transactiontype>
107+
<transactiontype>
108+
<name>Q10</name>
109+
</transactiontype>
110+
<transactiontype>
111+
<name>Q11</name>
112+
</transactiontype>
113+
<transactiontype>
114+
<name>Q12</name>
115+
</transactiontype>
116+
<transactiontype>
117+
<name>Q13</name>
118+
</transactiontype>
119+
<transactiontype>
120+
<name>Q14</name>
121+
</transactiontype>
122+
<transactiontype>
123+
<name>Q15</name>
124+
</transactiontype>
125+
<transactiontype>
126+
<name>Q16</name>
127+
</transactiontype>
128+
<transactiontype>
129+
<name>Q17</name>
130+
</transactiontype>
131+
<transactiontype>
132+
<name>Q18</name>
133+
</transactiontype>
134+
<transactiontype>
135+
<name>Q19</name>
136+
</transactiontype>
137+
<transactiontype>
138+
<name>Q20</name>
139+
</transactiontype>
140+
<transactiontype>
141+
<name>Q21</name>
142+
</transactiontype>
143+
<transactiontype>
144+
<name>Q22</name>
145+
</transactiontype>
146+
</transactiontypes>
147+
148+
<!-- TPCC specific -->
149+
<transactiontypes bench="tpcc">
150+
<transactiontype>
151+
<name>NewOrder</name>
152+
</transactiontype>
153+
<transactiontype>
154+
<name>Payment</name>
155+
</transactiontype>
156+
<transactiontype>
157+
<name>OrderStatus</name>
158+
</transactiontype>
159+
<transactiontype>
160+
<name>Delivery</name>
161+
</transactiontype>
162+
<transactiontype>
163+
<name>StockLevel</name>
164+
</transactiontype>
165+
</transactiontypes>
166+
</parameters>
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<?xml version="1.0"?>
2+
<parameters>
3+
4+
<!-- Connection details -->
5+
<type>ORACLE</type>
6+
<driver>oracle.jdbc.OracleDriver</driver>
7+
<url>jdbc:oracle:thin:@localhost:1521/xepdb1</url>
8+
<username>benchbase</username>
9+
<password>password</password>
10+
<isolation>TRANSACTION_SERIALIZABLE</isolation>
11+
<batchsize>128</batchsize>
12+
13+
<!-- Scalefactor in Epinions scales by *2000 the number of users-->
14+
<scalefactor>1</scalefactor>
15+
16+
<!-- The workload -->
17+
<terminals>1</terminals>
18+
<works>
19+
<work>
20+
<time>60</time>
21+
<rate>10000</rate>
22+
<weights>10,10,10,10,10,10,10,10,20</weights>
23+
</work>
24+
</works>
25+
26+
<!-- Epinions Procedures Declaration -->
27+
<transactiontypes>
28+
<transactiontype>
29+
<name>GetReviewItemById</name>
30+
</transactiontype>
31+
<transactiontype>
32+
<name>GetReviewsByUser</name>
33+
</transactiontype>
34+
<transactiontype>
35+
<name>GetAverageRatingByTrustedUser</name>
36+
</transactiontype>
37+
<transactiontype>
38+
<name>GetItemAverageRating</name>
39+
</transactiontype>
40+
<transactiontype>
41+
<name>GetItemReviewsByTrustedUser</name>
42+
</transactiontype>
43+
<transactiontype>
44+
<name>UpdateUserName</name>
45+
</transactiontype>
46+
<transactiontype>
47+
<name>UpdateItemTitle</name>
48+
</transactiontype>
49+
<transactiontype>
50+
<name>UpdateReviewRating</name>
51+
</transactiontype>
52+
<transactiontype>
53+
<name>UpdateTrustRating</name>
54+
</transactiontype>
55+
</transactiontypes>
56+
</parameters>

0 commit comments

Comments
 (0)