Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Oracle db support #379

Merged
merged 24 commits into from
Dec 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
45eb56e
Oracle DB support workflow test
ngbanguyen Oct 6, 2023
913b417
Oracle DB service name
ngbanguyen Oct 6, 2023
b9c0355
Move user reset to sql script inside Docker
ngbanguyen Oct 6, 2023
77ef9e2
Error rate fix for tpcc/resourcestresser
ngbanguyen Oct 6, 2023
ec0efe0
Templated benchmark default oracle config. Oracle workflow with templ…
ngbanguyen Oct 12, 2023
d1c6e47
Move to Oracle 21 XE
ngbanguyen Oct 18, 2023
20419c9
Update src/main/resources/benchmarks/sibench/ddl-oracle.sql
ngbanguyen Nov 7, 2023
09f92a9
Remove unnecessary file change
ngbanguyen Oct 18, 2023
700aba9
Moved copyright to contributor file
ngbanguyen Nov 7, 2023
07b2cb2
Address comments
ngbanguyen Nov 7, 2023
9484adc
Update src/main/resources/benchmarks/auctionmark/ddl-oracle.sql
ngbanguyen Nov 14, 2023
0d8540f
Merge branch 'main' into oracle-db-support
apavlo Nov 14, 2023
253f021
Update src/main/java/com/oltpbenchmark/benchmarks/auctionmark/Auction…
bpkroth Nov 14, 2023
ece5606
Update src/main/java/com/oltpbenchmark/util/SQLUtil.java
bpkroth Nov 14, 2023
b03cdc5
Merge branch 'main' into oracle-db-support
apavlo Nov 16, 2023
63fcf6b
Update reset.sql location for GitHub Actions
ngbanguyen Nov 22, 2023
583c395
Moved after load functionality to BenchmarkModule. Added test for aft…
ngbanguyen Nov 23, 2023
592e5ef
Merge branch 'main' into oracle-db-support
ngbanguyen Dec 4, 2023
d4be869
Merge branch 'main' into oracle-db-support
ngbanguyen Dec 6, 2023
e1a4b12
Merge branch 'main' into oracle-db-support
bpkroth Dec 6, 2023
e827b3d
Merge branch 'main' into oracle-db-support
bpkroth Dec 6, 2023
efd02ba
Apply suggestions
ngbanguyen Dec 7, 2023
2d06e75
Address comments
ngbanguyen Dec 7, 2023
892e37a
Merge branch 'main' into oracle-db-support
ngbanguyen Dec 7, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 78 additions & 1 deletion .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
profile: [ 'cockroachdb', 'mariadb', 'mysql', 'postgres', 'spanner', 'phoenix', 'sqlserver', 'sqlite' ]
profile: [ 'cockroachdb', 'mariadb', 'mysql', 'oracle', 'phoenix', 'postgres', 'spanner', 'sqlite', 'sqlserver' ]
steps:
- name: Checkout repo
uses: actions/checkout@v4
Expand Down Expand Up @@ -271,6 +271,83 @@ jobs:
fi
./scripts/check_histogram_results.sh results/histograms.json $ERRORS_THRESHOLD

## ----------------------------------------------------------------------------------
## ORACLE
## ----------------------------------------------------------------------------------
oracle:
needs: package-and-upload
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
benchmark: [ 'auctionmark', 'epinions', 'hyadapt', 'otmetrics', 'resourcestresser', 'seats', 'sibench', 'smallbank', 'tatp', 'tpcc', 'twitter', 'voter', 'wikipedia', 'ycsb', 'templated' ]
services:
oracle:
image: gvenzl/oracle-xe:21.3.0-slim-faststart
bpkroth marked this conversation as resolved.
Show resolved Hide resolved
ports:
- "1521:1521"
- "5500:5500"
env:
ORACLE_PASSWORD: password
ORACLE_CHARACTERSET: AL32UTF8
APP_USER: benchbase
APP_USER_PASSWORD: password
options: >-
--name oracle
--health-cmd "echo exit | sqlplus benchbase/password@xepdb1 | grep Connected"
--health-interval 10s
--health-timeout 5s
--health-retries 5
--health-start-period 5s
steps:
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: benchbase-oracle

- name: Extract artifact
run: |
tar xvzf benchbase-oracle.tgz --strip-components=1

- name: Delete artifact
run: |
rm -rf benchbase-oracle.tgz

- name: Set up user reset script
run: |
docker cp config/oracle/scripts/reset.sql oracle:/opt/oracle/reset.sql

- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: ${{env.JAVA_VERSION}}
distribution: 'temurin'

- name: Run benchmark
run: |
docker exec oracle sqlplus "sys/password@xepdb1 as sysdba" @reset.sql
# For templated benchmarks, we need to preload some data for the test since by design, templated benchmarks do not support the 'load' operation
# In this case, we load the tpcc data.
if [[ ${{matrix.benchmark}} == templated ]]; then
java -jar benchbase.jar -b tpcc -c config/oracle/sample_tpcc_config.xml --create=true --load=true --execute=false --json-histograms results/histograms.json
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
else
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
fi
# FIXME: Reduce the error rate so we don't need these overrides.
if [ ${{matrix.benchmark}} == auctionmark ]; then
ERRORS_THRESHOLD=0.04
elif [ ${{matrix.benchmark}} == tatp ]; then
ERRORS_THRESHOLD=0.05
elif [ ${{matrix.benchmark}} == tpcc ]; then
ERRORS_THRESHOLD=0.03
elif [ ${{matrix.benchmark}} == resourcestresser ]; then
ERRORS_THRESHOLD=0.04
elif [ ${{matrix.benchmark}} == wikipedia ]; then
ERRORS_THRESHOLD=0.02
fi
./scripts/check_histogram_results.sh results/histograms.json $ERRORS_THRESHOLD

## ----------------------------------------------------------------------------------
## POSTGRESQL
## ----------------------------------------------------------------------------------
Expand Down
56 changes: 56 additions & 0 deletions config/oracle/sample_auctionmark_config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<?xml version="1.0"?>
<parameters>

<!-- Connection details -->
<type>ORACLE</type>
<driver>oracle.jdbc.OracleDriver</driver>
<url>jdbc:oracle:thin:@localhost:1521/xepdb1</url>
<username>benchbase</username>
<password>password</password>
<isolation>TRANSACTION_SERIALIZABLE</isolation>
<batchsize>128</batchsize>

<!-- Scalefactor in AuctionMark scales by *1000 the number of customers-->
<scalefactor>1</scalefactor>

<!-- The workload -->
<terminals>1</terminals>
<works>
<work>
<time>60</time>
<rate>10000</rate>
<weights>45, 10, 20, 2, 1, 4, 10, 5, 3</weights>
</work>
</works>

<!-- AuctionMark Procedures declaration -->
<transactiontypes>
<transactiontype>
<name>GetItem</name>
</transactiontype>
<transactiontype>
<name>GetUserInfo</name>
</transactiontype>
<transactiontype>
<name>NewBid</name>
</transactiontype>
<transactiontype>
<name>NewComment</name>
</transactiontype>
<transactiontype>
<name>NewCommentResponse</name>
</transactiontype>
<transactiontype>
<name>NewFeedback</name>
</transactiontype>
<transactiontype>
<name>NewItem</name>
</transactiontype>
<transactiontype>
<name>NewPurchase</name>
</transactiontype>
<transactiontype>
<name>UpdateItem</name>
</transactiontype>
</transactiontypes>
</parameters>
166 changes: 166 additions & 0 deletions config/oracle/sample_chbenchmark_config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
<?xml version="1.0"?>
<parameters>

<!-- Connection details -->
<type>ORACLE</type>
<driver>oracle.jdbc.OracleDriver</driver>
<url>jdbc:oracle:thin:@localhost:1521/xepdb1</url>
<username>benchbase</username>
<password>password</password>
<isolation>TRANSACTION_SERIALIZABLE</isolation>
<batchsize>128</batchsize>

<!-- Scale factor is the number of warehouses in TPCC -->
<scalefactor>1</scalefactor>

<!-- The workload -->
<!-- Number of terminal per workload -->
<terminals>1</terminals>

<!-- Gather schema stats after loading to improve performance -->
<!-- See src/main/resources/benchmarks/gather_schema_stats_oracle.sql -->
<afterload>/benchmarks/gather_schema_stats_oracle.sql</afterload>

<!-- Extra Features (Commented Out) -->
<!-- Can be workload-specific -->
<!-- <terminals bench="tpcc">2</terminals> -->

<!-- Workload-specific options a marked with @bench=[workload_name] -->
<!-- Workload-specific number of terminals -->
<!-- <terminals bench="chbenchmark">2</terminals> -->

<works>

<!-- A Basic WorkPhase for Mixed Workloads -->
<work>
<time>60</time>

<!-- Note: The rate can be set to UNLIMITED or DISABLED -->
<rate>200</rate>

<!-- Need to Specify transaction weights for each workload .. Otherwise the number of fields won't match -->
<weights bench="tpcc">45,43,4,4,4</weights>
<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>
</work>

<!-- Extra features showcase -->
<!-- Extra features showcase -->
<!-- <work> -->
<!-- <time>60</time> -->

<!-- <rate>200</rate> -->
<!-- <rate bench="chbenchmark">disabled</rate> -->

<!-- NOTE: TPCC workers won't be distributed evenly between warehouses if not all workers are active -->
<!-- <active_terminals>1</active_terminals> -->
<!-- <active_terminals bench="chbenchmark">1</active_terminals> -->

<!-- Specifies transaction weight for each workload. -->
<!-- <weights bench="tpcc">45,43,4,4,4</weights> -->
<!-- <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> -->
<!-- </work> -->

<!-- Extra features -->
<!--
<work>
<time>60</time>

<rate>100</rate>
<rate bench="chbenchmark">unlimited</rate>

<weights bench="tpcc">45,43,4,4,4</weights>
<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>
</work>
-->
</works>


<!-- CH specific -->
<transactiontypes bench="chbenchmark">
<transactiontype>
<name>Q1</name>
</transactiontype>
<transactiontype>
<name>Q2</name>
</transactiontype>
<transactiontype>
<name>Q3</name>
</transactiontype>
<transactiontype>
<name>Q4</name>
</transactiontype>
<transactiontype>
<name>Q5</name>
</transactiontype>
<transactiontype>
<name>Q6</name>
</transactiontype>
<transactiontype>
<name>Q7</name>
</transactiontype>
<transactiontype>
<name>Q8</name>
</transactiontype>
<transactiontype>
<name>Q9</name>
</transactiontype>
<transactiontype>
<name>Q10</name>
</transactiontype>
<transactiontype>
<name>Q11</name>
</transactiontype>
<transactiontype>
<name>Q12</name>
</transactiontype>
<transactiontype>
<name>Q13</name>
</transactiontype>
<transactiontype>
<name>Q14</name>
</transactiontype>
<transactiontype>
<name>Q15</name>
</transactiontype>
<transactiontype>
<name>Q16</name>
</transactiontype>
<transactiontype>
<name>Q17</name>
</transactiontype>
<transactiontype>
<name>Q18</name>
</transactiontype>
<transactiontype>
<name>Q19</name>
</transactiontype>
<transactiontype>
<name>Q20</name>
</transactiontype>
<transactiontype>
<name>Q21</name>
</transactiontype>
<transactiontype>
<name>Q22</name>
</transactiontype>
</transactiontypes>

<!-- TPCC specific -->
<transactiontypes bench="tpcc">
<transactiontype>
<name>NewOrder</name>
</transactiontype>
<transactiontype>
<name>Payment</name>
</transactiontype>
<transactiontype>
<name>OrderStatus</name>
</transactiontype>
<transactiontype>
<name>Delivery</name>
</transactiontype>
<transactiontype>
<name>StockLevel</name>
</transactiontype>
</transactiontypes>
</parameters>
56 changes: 56 additions & 0 deletions config/oracle/sample_epinions_config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<?xml version="1.0"?>
<parameters>

<!-- Connection details -->
<type>ORACLE</type>
<driver>oracle.jdbc.OracleDriver</driver>
<url>jdbc:oracle:thin:@localhost:1521/xepdb1</url>
<username>benchbase</username>
<password>password</password>
<isolation>TRANSACTION_SERIALIZABLE</isolation>
<batchsize>128</batchsize>

<!-- Scalefactor in Epinions scales by *2000 the number of users-->
<scalefactor>1</scalefactor>

<!-- The workload -->
<terminals>1</terminals>
<works>
<work>
<time>60</time>
<rate>10000</rate>
<weights>10,10,10,10,10,10,10,10,20</weights>
</work>
</works>

<!-- Epinions Procedures Declaration -->
<transactiontypes>
<transactiontype>
<name>GetReviewItemById</name>
</transactiontype>
<transactiontype>
<name>GetReviewsByUser</name>
</transactiontype>
<transactiontype>
<name>GetAverageRatingByTrustedUser</name>
</transactiontype>
<transactiontype>
<name>GetItemAverageRating</name>
</transactiontype>
<transactiontype>
<name>GetItemReviewsByTrustedUser</name>
</transactiontype>
<transactiontype>
<name>UpdateUserName</name>
</transactiontype>
<transactiontype>
<name>UpdateItemTitle</name>
</transactiontype>
<transactiontype>
<name>UpdateReviewRating</name>
</transactiontype>
<transactiontype>
<name>UpdateTrustRating</name>
</transactiontype>
</transactiontypes>
</parameters>
Loading