Home / Repstance User Guide / 7. COMMANDS TO BE USED / 7.1 Prepare Source and Target Databases / 7.1.2 Prepare Oracle Database as Source Database

7.1.2 Prepare Oracle Database as Source Database

The “prepare” database command is used to configure Oracle database in order to use it as a Source. It enables the necessary level of supplemental logging and creates the database objects necessary for any Capture Processes.

Note – In order to use the “prepare” database command the database user must have sufficient privileges.

There are two possible connection types – EZCONNECT and TNS. Depending on which one is chosen, there will be a different set of possible parameters.

REST API:

  • Endpoint: https://repstance_url/configure/database
  • Method: POST
  • Header:
    • Content-Type: application/json
    • X-Token: token
  • Body:
    {
      "command":"prepare",
      "parameters":[
         ["database","source"],
         ["dbtype","oracle"],
         ["connectiontype","tns|ezconnect"],
         ["tnsname","tns_alias"],
         ["server","host_name"],
         ["port","port_number"],
         ["servicename","service_or_SID"],
         ["dbname","database_name"],
         ["user","db_user_name"],
         ["password","db_user_password"],
         ["createlogdirs","0|1"]
      ]
    }

Server response:

  • HTTP Status – status of the command, possible codes are:
    • 200 – if no error occurs
    • 422 – if error occurs
  • Body:
    {
     "Status":"{Completed|Failed}",
     "Message":"The command execution details"
    }

CLI Syntax:

repcli prepare database=source dbtype=oracle \
connectiontype=tns|ezconnect tnsname=tns_alias \
server=databaseHost port=databasePort \
servicename=service_or_SID \
user=username password=password \
dbname=databaseName createlogdirs=0|1

The input parameters are:

  • database – Database role, the possible value is source – to insert Capture Process Objects
  • dbtype – Type of RDBMS, the only possible value is oracle
  • connectiontype – Specifies the Oracle connection method, the possible values are:
  • tns – Local Naming Method to be used
  • ezconnect – EZCONNECT to be used
  • tnsname – Name of the TNS alias, valid only if connectiontype=tns
  • server – Host name or IP address of the database server, valid only if connectiontype=ezconnect
  • port – Database port number, valid only if connectiontype=ezconnect
  • servicename – Database service name or SID, valid only if connectiontype=ezconnect
  • dbname – Name of either container or pluggable database, valid only if database=source and for any Oracle versions 12c-19c but excluding RDS instances
  • user – Database User name
  • password – Database User password
  • createlogdirs – The parameter determines if the “ONLINELOG_DIR” and “ARCHIVELOG_DIR” Oracle directories need to be created. The possible values are:
    • 0 – do not run create the directories (default value),
    • 1 – create the directories.

Note – The directories are used if the Capture Process is configured to extract changes in the “DirectLog” mode (see chapter 7.4.2 Prepare Capture Process for Oracle Database for the details).