Configures a change tracking task.

When you call this operation, the change tracking task must be in the Not Configured state.
Note If you do not have a change tracking task, you can call the CreateSubscriptionInstance operation to create a change tracking task.

Precautions

  • Before you call the StartSubscriptionInstance operation to start a change tracking task, you can call the ConfigureSubscriptionInstance operation multiple times to modify the configurations of the task.
  • To use the new version, you must specify the SubscriptionInstanceNetworkType parameter. If you use the previous version, you do not need to specify the SubscriptionInstanceNetworkType parameter.
    Note
    • The previous version of the change tracking feature supports self-managed MySQL databases, ApsaraDB RDS for MySQL instances, and DRDS instances.
    • The new version of the change tracking feature supports self-managed MySQL databases, ApsaraDB RDS for MySQL instances, PolarDB for MySQL clusters, and Oracle databases.

Request parameters

Parameter Type Required Example Description
Action String Yes ConfigureSubscriptionInstance The operation that you want to perform. Set the value to ConfigureSubscriptionInstance.
SubscriptionInstanceId String Yes dtsxxxxxxxx The ID of the change tracking instance.
SourceEndpointInstanceId String Yes rm-mxxxxxxxx The ID of the source instance.
SubscriptionObjects List Yes [{"DBName":"dtstestdata","TableIncludes":[{"TableName":"customer"}]}]
Note If you configure the objects by using the SDK, you must set this parameter to [{"DBName":"dtstestdata","NewDBName":"dtstestdata","TableIncludes":[{"TableName":"customer","NewTableName":"customer"}]}]. The values of the NewDBName and DBName parameters must be the same. The values of the NewTableName and TableName parameters must be the same.
The objects from which you want to track data changes. The value is a JSON string. For more information, see SubscriptionObjects.
SubscriptionInstanceName String No Test MySQL The name of the change tracking task.
SourceEndpointInstanceType String No RDS The instance type of the data source. Valid values:
  • RDS: ApsaraDB RDS instance
  • PolarDB: PolarDB for MySQL cluster
Note The default value is RDS.
SubscriptionInstanceNetworkType String No vpc The network type of the change tracking task. Valid values:
  • classic: classic network
  • vpc: virtual private cloud (VPC)
Note
  • To use the new version of the change tracking feature, you must specify this parameter. If you use the previous version, you do not need to specify this parameter.
  • The previous version of the change tracking feature supports self-managed MySQL databases, ApsaraDB RDS for MySQL instances, and DRDS instances. The new version of the change tracking feature supports self-managed MySQL databases, ApsaraDB RDS for MySQL instances, PolarDB for MySQL clusters, and Oracle databases.
  • If you set this parameter to vpc, you must also specify the SubscriptionInstance.VPCId and SubscriptionInstance.VSwitchID parameters.
SubscriptionInstance.VPCId String No vpc-bpxxxxxxxx The ID of the VPC where the change tracking instance is deployed.
Note This parameter is available only when you set the SubscriptionInstanceNetworkType parameter to vpc.
SubscriptionInstance. VSwitchID String No vsw-bpxxxxxxxx The ID of the vSwitch in the specified VPC.
Note This parameter is available only when you set the SubscriptionInstanceNetworkType parameter to vpc.
SubscriptionDataType.DML Boolean No True Specifies whether to retrieve data manipulation language (DML) statements. Valid values:
  • True
  • False
Note Default value: True.

Response parameters

Parameter Type Example Description
RequestId String 36923CC2-DDAB-4B48-A144-DA92C1E19537 The ID of the request.

Examples

    public void configureSubscriptionJob(String subscriptionJobId, String jobName, String region, String rdsInstanceId, String rdsUsername, String rdsPassword, String netType) throws Exception {
        ConfigureSubscriptionInstanceRequest request = new ConfigureSubscriptionInstanceRequest();

        // The subscription jobid created before
        request.setSubscriptionInstanceId(subscriptionJobId);

        // The subscription job name
        request.setSubscriptionInstanceName(jobName);

        request.setSourceEndpointInstanceType("RDS");
        request.setSourceEndpointUserName(rdsUsername);
        request.setSourceEndpointPassword(rdsPassword);
        request.setSourceEndpointInstanceID(rdsInstanceId);

        // Subscription DDL update
        request.setSubscriptionDataTypeDDL(Boolean.TRUE);
        // Subscription DML update
        request.setSubscriptionDataTypeDML(Boolean.TRUE);

        request.setSubscriptionObject("[{\"DBName\":\"portal_test\",\"NewDBName\":\"portal_test\",\"TableIncludes\":[{\"TableName\":\"test\",\"NewTableName\":\"test\"}]}]");

        request.setSubscriptionInstanceNetworkType(netType);

        ConfigureSubscriptionInstanceResponse response = client.getAcsResponse(request);
        if (!"true".equals(response.getSuccess())) {
            throw new Exception(response.getErrMessage() + " requestId=" + response.getErrCode());
        }
    }
            

Error codes

Error code Error message Description
InvalidParameter The Input Parameter${parameter} is not valid. The error message returned because the specified parameter is invalid.
InvalidParameterValid The Value of Input Parameter${parameter} is not valid. The error message returned because the specified value is invalid. Check whether the parameter is specified and whether the AccessKey pair is valid.
MissingParameter The parameter "<parameter name>" is needed but no provided. The error message returned because a required parameter is not specified. Check whether the parameter is specified and whether the AccessKey pair is valid. For more information, see DTS API Reference.
Forbidden.InstanceNotFound The specified Instance Not Found. The error message returned because the RDS instance does not exist or the current user does not have the permissions to manage the instance. Check the instance ID and the permissions.
OperationDenied.DBInstanceType The operation is not permitted due to the instance is Read only. The error message returned because the RDS instance is a read-only instance and the current operation is not allowed.
OperationDenied.DBInstanceStatus The operation is not permitted due to status of instance. The error message returned because the operation is not allowed when the instance is in the current state. Check the status of the instance.