OracleExecutor Operator

This page introduces the OracleExecutor operator, a workflow operator that allows executing custom queries on an Oracle instance.

Prerequisites

This section provides the minimum requirements that you should meet in order to use the Oracle Executor operator.

Supported versions

  • Oracle 12c or later

Network requirements

  • The OracleExecutor operator must be able to connect to the Oracle URL or IP address and port (default port is 1521)

Permissions

  • The user used to log into the database must have enough privilege to perform the required queries

Operator arguments

When you define a task that uses the Oracle Executor operator you should specify some configuration information to allow the operator to connect to the Oracle instance and execute queries.

The operator inherits the connection arguments from the properties of the component when referenced in the task definition. The Akamas user can also override the properties of the component or not reference it at all defining the connection fields directly in the configuration of the task.

The following table provides the list of all properties required to define a task that uses the OracleExecutor operator.

FieldTypeDescriptionDefault ValueRestrictionsRequiredSource

connection.dsn

String

The DSN or EasyConnect string

Is possible to define only one of the following sets of configurations:

  • dsn

  • host, service and optionally port

  • host, sid and optionally port

task, component

connection.host

String

The address of the database instance

task, component

connection.port

Integer

The listening port of the database instance

1521

task, component

connection.service

String

The database service name

task, component

connection.sid

String

The database SID

task, component

connection.user

String

The user name

Yes

task, component

connection.password

String

The user password

Yes

task, component

connection.mode

String

The connection mode

sysdba, sysoper

task, component

sql

List[String]

The list of queries to update the database status before or after the workload execution. Queries can be templatized, containing tokens referencing parameters of any component in the system.

Yes

task

autocommit

boolean

A Flag to enable the auto-commit feature

False

No

task

component

String

The name of the component to fetch properties from

No

task

Notice: it is a good practice to define only queries that update the state of the database. Is not possible to use SELECT queries to extract data from the database.

Examples

Truncate tables after a load test

In the following example the operator performs a cleanup action on a table of the database:

tasks:
- name: clean database
  operator: OracleExecutor
  arguments:
    sql:
    - TRUNCATE TABLE user_action
    - DELETE FROM user WHERE id LIKE 'test%'
    connection:
      user: application
      password: password
      dsn: oradb.dev.akamas.io/XE

Update database entries

In the following example, the operator leverages its templating features to update a table:

tasks:
- name: set value
  operator: OracleExecutor
  arguments:
    sql:
    - UPDATE rs_component_pros SET value='${app.max_connections}' WHERE property='maxconn'
    component: oracledb

The referenced oracledb component contains properties that specify how to connect to the Oracle database instance:

name: oracledb
componentType: Oracle Database 18c
properties:
  connection:
    user: application
    password: password
    host: oradb.dev.akamas.io
    service: XE

Last updated