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

7.1.4 Prepare Oracle Database as Target Database

The “prepare” database command is used to configure Oracle database as a Target. The command must be executed before running Apply Process. It creates the necessary database objects for any Apply 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","target"],
         ["dbtype","oracle"],
         ["connectiontype","tns|ezconnect"],
         ["tnsname","tns_alias"],
         ["server","host_name"],
         ["port","port_number"],
         ["servicename","service_or_SID"],
         ["user","db_user_name"],
         ["password","db_user_password"],
         ["tablespace","user_tablespace"]
      ]
    }

Server response:

  • HTTP Status – status of the command, the 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=target dbtype=oracle \
connectiontype=tns|ezconnect tnsname=tns_alias \
server=databaseHost port=databasePort \
servicename=service_or_SID \
user=username password=password \
tablespace=user_tablespace

The input parameters are:

  • database – Database role, the only possible value is target – to insert Apply 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
  • user – Database User name
  • password – Database User password
  • tablespace – Name of the tablespace that the Repstance’s objects are to be installed in. The default is the USERS tablespace if no alternative has been specified.