The Requirement is to load test Oracle and Postgres Databases using JMeter (Apache Open source) load testing tool.
I need to work on two scripts one pointing to Postgres Database and the other script pointing to Oracle Database.
- Postgres Database:
- Oracle Database:
- Query using bind variables
- Executing a procedure with bind variables
Creating a JMeter script is same in both Postgres and Oracle Databases. There are few subtle differences.
- Add the jdbc jar (download the jdbc jar from the internet) file related to the version of database to the test plan as shown below:
- From the config element, add JDBC Connection Configuration as shown below for the Postgres database:
- Incase Oracle Database, replace database URL to: jdbc:oracle:thin:@//<ip:port>/dbname and JDBC Driver class to: oracle.jdbc.OracleDriver
- Under Connection Pool Configuration, I have set Max Number of Connection to 0, which means that each JMeter thread will use a single dedicated database connection.
- Variable name is the name of the pool you choose to have. You will be using the same name JDBC Request.
- Add JDBC Request sampler to the thread group:
- In case of Oracle query use:
- Incase of Oracle stored procedure: