全部产品
数据传输服务DTS

查看初始化详情

更新时间:2017-08-18 14:00:22   分享:   

描述

同步实例处于任何状态,都可以调用这个接口查看同步初始化详情。

请求参数

参数说明 数据类型 参数说明
Action String 系统默认参数,这个接口的接口定义,取值为:DescribeDataLoadStatus
SynchronizationJobId String
参数说明 数据类型 是否必须 参数说明
Action String 系统默认参数,这个接口的接口定义,取值为:DescribeDataLoadStatus
SynchronizationJobId String 同步实例ID
StructureInitialization Boolean 查看结构初始化详情
DataInitialization Boolean 查看全量数据初始化详情
DataSynchronization Boolean 查看增量初始化详情
PageSize Integer 每页记录数,取值:30/50/100默认值:30,只有当配置项:StructureInitialization、DataInitialization、DataSynchronization 只有一个为True时,这个配置项才生效
PageNum Integer 页码,大于0,且不超过Integer的最大值,默认值:1。只有当配置项:StructureInitialization、DataInitialization、DataSynchronization 只有一个为True时,这个配置项才生效

返回参数

参数名称 数据类型 参数说明
<公共参数> 接口请求ID

示例

下面简单演示通过JAVA SDK 查询同步初始化详情的示例:

  1. public void descInitStatus(String SyncJobId, DefaultAcsClient client) {
  2. DescribeInitializationStatusRequest request = new DescribeInitializationStatusRequest();
  3. request.setSynchronizationJobId(SyncJobId);
  4. DescribeInitializationStatusResponse response = new DescribeInitializationStatusResponse();
  5. try {
  6. response = client.getAcsResponse(request);
  7. System.out.println("Describe Initialization Detail of Synchronization Job "+SyncJobId+" Succeed!");
  8. List<StructureInitializationDetail> strucInitDetails = response.getStructureInitializationDetails();
  9. List<DataInitializationDetail> dataInitDetails = response.getDataInitializationDetails();
  10. List<com.aliyuncs.dts.model.v20160801.DescribeInitializationStatusResponse.DataSynchronizationDetail> dataSynchronizationDetails = response.getDataSynchronizationDetails();
  11. System.out.println("Structure Initialization Detail:");
  12. for (int i = 0; i < strucInitDetails.size(); i++) {
  13. System.out.println("ObjectName:"+strucInitDetails.get(i).getObjectName()
  14. +"; ObjectType:"+strucInitDetails.get(i).getObjectType()
  15. +"; SRCDBName:"+strucInitDetails.get(i).getSourceOwnerDBName()
  16. +"; DESTDBName:"+strucInitDetails.get(i).getDestinationOwnerDBName()
  17. +"; Status:"+strucInitDetails.get(i).getStatus()
  18. +"; ErrMSG:"+strucInitDetails.get(i).getErrorMessage());
  19. }
  20. System.out.println("Data Initialization Detail:");
  21. for (int i = 0; i < dataInitDetails.size(); i++) {
  22. System.out.println("TableName:"+dataInitDetails.get(i).getTableName()
  23. +"; SRCDBName:"+dataInitDetails.get(i).getSourceOwnerDBName()
  24. +"; DESTDBName:"+dataInitDetails.get(i).getDestinationOwnerDBName()
  25. +"; Status:"+dataInitDetails.get(i).getStatus()
  26. +"; TotalRows:"+dataInitDetails.get(i).getTotalRowNum()
  27. +"; FinishedRows:"+dataInitDetails.get(i).getFinishRowNum()
  28. +"; UsedTime:"+dataInitDetails.get(i).getUsedTime()
  29. +"; ErroMSG:"+dataInitDetails.get(i).getErrorMessage());
  30. }
  31. System.out.println("Data Synchronization Detail:");
  32. for (int i = 0; i < dataSynchronizationDetails.size(); i++) {
  33. System.out.println("TableName:"+dataSynchronizationDetails.get(i).getTableName()
  34. +"; SRCDBName:"+dataSynchronizationDetails.get(i).getSourceOwnerDBName()
  35. +"; DESTDBName:"+dataSynchronizationDetails.get(i).getDestinationOwnerDBName()
  36. +"; Status:"+dataSynchronizationDetails.get(i).getStatus()
  37. +"; ErrMSG:"+dataSynchronizationDetails.get(i).getErrorMessage());
  38. }
  39. } catch (Exception e) {
  40. // TODO: handle exception
  41. System.out.println("Describe Initialization Status of Synchronization Job "+SyncJobId+" Failed!");
  42. System.out.println(e.toString());
  43. }
  44. }
本文导读目录
本文导读目录
以上内容是否对您有帮助?