ODC 数据归档任务执行失败

请问使用 ODC 创建 oracle 到 ob oracle 模式的数据归档时遇到这个报错该如何处理?
之前创建时报错缺少唯一键,源库加上主键之后报错如下:

ODC的版本为:【 4.3.2-1727344158000 】
【问题描述】ODC 创建数据归档任务失败,报错信息: tableUniqueIndexColumns is empty
【日志信息】
[2024-10-24 10:37:37 CST] [115] [INFO] Start task, id=115.
[2024-10-24 10:37:37 CST] [115] [INFO] Init task parameters success, id=115.
[2024-10-24 10:37:37 CST] [115] [INFO] Cloud object storage not supported
[2024-10-24 10:37:37 CST] [115] [INFO] get MetaDB configuration, config=ConnectionConfig(id=null, ownerId=null, organizationId=null, creatorId=null, creatorName=null, name=null, serviceName=null, sid=null, userRole=null, catalogName=null, type=OB_MYSQL, visibleScope=ORGANIZATION, host=10.52.6.108, port=2883, clusterName=metadb, tenantName=odc_meta, username=root, setTop=false, labelIds=null, sysTenantUsername=null, readonlyUsername=null, defaultSchema=odc, queryTimeoutSeconds=10, createTime=null, updateTime=null, lastAccessTime=null, enabled=true, passwordSaved=true, properties=null, cipher=null, copyFromId=null, permittedActions=null, status=null, temp=false, supportedOperations=null, endpoint=null, OBTenantName=odc_meta, instanceType=null, instanceRoleType=null, attributes=null, sslConfig=ConnectionConfig.SSLConfig(enabled=false, clientCertObjectId=null, clientKeyObjectId=null, CACertObjectId=null), environmentId=null, environmentName=null, environmentStyle=null, projectId=null, projectName=null, dbObjectLastSyncTime=null)
[2024-10-24 10:37:37 CST] [115] [INFO] Init data-archive job env succeed,jobIdentity=115
[2024-10-24 10:37:37 CST] [115] [INFO] Update task status, id=115, status=RUNNING.
[2024-10-24 10:37:37 CST] [115] [INFO] Sample plugin is started
[2024-10-24 10:37:37 CST] [115] [INFO] Begin to create dlm job,params=HistoryJob(id=MIGRATE-44-81-0, jobType=MIGRATE, jobParameter=DlmTableUnitParameters(syncDBObjectType=[]), tableId=-1, sourceDs=null, targetDs=null, printSqlTrace=false, taskGeneratorId=null, dateStart=null, dateEnd=null, sourceTable=T_UMP_SUPPLIER_STATUS_VIEW, targetTable=T_HIS_SUPPLIER_STATUS_VIEW_BAK, logicTableId=null, childJobs=[], shardingParametersMap=null)
[2024-10-24 10:37:38 CST] [115] [INFO] set sleep time = 50
[2024-10-24 10:37:38 CST] [115] [WARN] Get table unique key failed.
com.oceanbase.tools.migrator.common.exception.UnExpectedException: tableUniqueIndexColumns is empty
at com.oceanbase.tools.migrator.common.meta.TableMetaManager.initUniqueKey(TableMetaManager.java:70) ~[data-lifecycle-manager-1.1.6.jar!/:?]
at com.oceanbase.tools.migrator.common.meta.TableMetaManager.getTableMeta(TableMetaManager.java:50) ~[data-lifecycle-manager-1.1.6.jar!/:?]
at com.oceanbase.tools.migrator.core.JobMetaFactory.initTableMeta(JobMetaFactory.java:180) ~[data-lifecycle-manager-1.1.6.jar!/:?]
at com.oceanbase.tools.migrator.core.JobMetaFactory.create(JobMetaFactory.java:65) ~[data-lifecycle-manager-1.1.6.jar!/:?]
at com.oceanbase.tools.migrator.core.JobFactory.createJob(JobFactory.java:37) ~[data-lifecycle-manager-1.1.6.jar!/:?]
at com.oceanbase.odc.service.dlm.DLMJobFactory.createJob(DLMJobFactory.java:59) ~[odc-service-4.3.2-20240927.jar!/:?]
at com.oceanbase.odc.service.task.executor.task.DataArchiveTask.doStart(DataArchiveTask.java:118) ~[odc-service-4.3.2-20240927.jar!/:?]
at com.oceanbase.odc.service.task.executor.task.BaseTask.start(BaseTask.java:73) ~[odc-service-4.3.2-20240927.jar!/:?]
at com.oceanbase.odc.service.task.executor.server.ThreadPoolTaskExecutor.lambda$execute$0(ThreadPoolTaskExecutor.java:71) ~[odc-service-4.3.2-20240927.jar!/:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:1.8.0_422]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_422]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[?:1.8.0_422]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[?:1.8.0_422]
at com.oceanbase.odc.common.trace.TraceDecorator.lambda$decorate$0(TraceDecorator.java:40) ~[odc-common-4.3.2-20240927.jar!/:?]
at java.lang.Thread.run(Thread.java:750) [?:1.8.0_422]
[2024-10-24 10:37:38 CST] [115] [WARN] Create job meta failed,error=
com.oceanbase.tools.migrator.common.exception.TableMetaInitException: com.oceanbase.tools.migrator.common.exception.UnExpectedException: Get table unique key failed.
at com.oceanbase.tools.migrator.core.JobMetaFactory.initTableMeta(JobMetaFactory.java:182) ~[data-lifecycle-manager-1.1.6.jar!/:?]
at com.oceanbase.tools.migrator.core.JobMetaFactory.create(JobMetaFactory.java:65) ~[data-lifecycle-manager-1.1.6.jar!/:?]
at com.oceanbase.tools.migrator.core.JobFactory.createJob(JobFactory.java:37) ~[data-lifecycle-manager-1.1.6.jar!/:?]
at com.oceanbase.odc.service.dlm.DLMJobFactory.createJob(DLMJobFactory.java:59) ~[odc-service-4.3.2-20240927.jar!/:?]
at com.oceanbase.odc.service.task.executor.task.DataArchiveTask.doStart(DataArchiveTask.java:118) ~[odc-service-4.3.2-20240927.jar!/:?]
at com.oceanbase.odc.service.task.executor.task.BaseTask.start(BaseTask.java:73) ~[odc-service-4.3.2-20240927.jar!/:?]
at com.oceanbase.odc.service.task.executor.server.ThreadPoolTaskExecutor.lambda$execute$0(ThreadPoolTaskExecutor.java:71) ~[odc-service-4.3.2-20240927.jar!/:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:1.8.0_422]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_422]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[?:1.8.0_422]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[?:1.8.0_422]
at com.oceanbase.odc.common.trace.TraceDecorator.lambda$decorate$0(TraceDecorator.java:40) ~[odc-common-4.3.2-20240927.jar!/:?]
at java.lang.Thread.run(Thread.java:750) [?:1.8.0_422]
Caused by: com.oceanbase.tools.migrator.common.exception.UnExpectedException: Get table unique key failed.
at com.oceanbase.tools.migrator.common.meta.TableMetaManager.getTableMeta(TableMetaManager.java:53) ~[data-lifecycle-manager-1.1.6.jar!/:?]
at com.oceanbase.tools.migrator.core.JobMetaFactory.initTableMeta(JobMetaFactory.java:180) ~[data-lifecycle-manager-1.1.6.jar!/:?]
… 12 more
[2024-10-24 10:37:38 CST] [115] [WARN] Create job failed
com.oceanbase.tools.migrator.common.exception.TableMetaInitException: com.oceanbase.tools.migrator.common.exception.UnExpectedException: Get table unique key failed.
at com.oceanbase.tools.migrator.core.JobMetaFactory.initTableMeta(JobMetaFactory.java:182) ~[data-lifecycle-manager-1.1.6.jar!/:?]
at com.oceanbase.tools.migrator.core.JobMetaFactory.create(JobMetaFactory.java:65) ~[data-lifecycle-manager-1.1.6.jar!/:?]
at com.oceanbase.tools.migrator.core.JobFactory.createJob(JobFactory.java:37) ~[data-lifecycle-manager-1.1.6.jar!/:?]
at com.oceanbase.odc.service.dlm.DLMJobFactory.createJob(DLMJobFactory.java:59) ~[odc-service-4.3.2-20240927.jar!/:?]
at com.oceanbase.odc.service.task.executor.task.DataArchiveTask.doStart(DataArchiveTask.java:118) ~[odc-service-4.3.2-20240927.jar!/:?]
at com.oceanbase.odc.service.task.executor.task.BaseTask.start(BaseTask.java:73) ~[odc-service-4.3.2-20240927.jar!/:?]
at com.oceanbase.odc.service.task.executor.server.ThreadPoolTaskExecutor.lambda$execute$0(ThreadPoolTaskExecutor.java:71) ~[odc-service-4.3.2-20240927.jar!/:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:1.8.0_422]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_422]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[?:1.8.0_422]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[?:1.8.0_422]
at com.oceanbase.odc.common.trace.TraceDecorator.lambda$decorate$0(TraceDecorator.java:40) ~[odc-common-4.3.2-20240927.jar!/:?]
at java.lang.Thread.run(Thread.java:750) [?:1.8.0_422]
Caused by: com.oceanbase.tools.migrator.common.exception.UnExpectedException: Get table unique key failed.
at com.oceanbase.tools.migrator.common.meta.TableMetaManager.getTableMeta(TableMetaManager.java:53) ~[data-lifecycle-manager-1.1.6.jar!/:?]
at com.oceanbase.tools.migrator.core.JobMetaFactory.initTableMeta(JobMetaFactory.java:180) ~[data-lifecycle-manager-1.1.6.jar!/:?]
… 12 more
[2024-10-24 10:37:38 CST] [115] [ERROR] MIGRATE job failed,DLMJobId=MIGRATE-44-81-0,errorMsg=com.oceanbase.tools.migrator.common.exception.UnExpectedException: Create job failed
[2024-10-24 10:37:38 CST] [115] [INFO] Update task status, id=115, status=DONE.
[2024-10-24 10:37:38 CST] [115] [WARN] Close meta datasource failed,errorMsg=null
[2024-10-24 10:37:38 CST] [115] [INFO] Task completed, id=115, status=DONE.

2 个赞

表唯一字段为空,看看表是否有主键呢

2 个赞

你好,唯一键是有的,这是源端的表结构,没有唯一键创建任务预检查就会报错,任务无法创建。这个是启动任务之后报的错。

1 个赞

目前只有 obmyql 支持唯一键,其他类型必须是主键

3 个赞

哦哦,我的表述有点问题,源库是有主键的

2 个赞

麻烦提供一份表结构信息附件形式

2 个赞

你好,源、目标端的表结构已上传
表结构.txt (9.5 KB)

2 个赞

你好,好像找到问题了,可能是目标表没有设置主键的原因,新建了一个带主键的目标表是可以的 :joy: 原目标表有点大,主键还没加成功,等加完了再验证一下

3 个赞

目前成功了么

2 个赞

不好意思,还没有加完,这表目前有三十多亿数据 :joy:

2 个赞

老师问题有进度了可以在帖子里反馈一下

2 个赞

你好,主键加上了,现在启动不报之前那个错误了,新报错为:java.sql.SQLRecoverableException: IO Error: Socket read timed out,请问这个应该往哪个方向排查呢?
ODC_LOG.txt (59.3 KB)

1 个赞

io失败 可以先看看路径目录是否都有权限

请问是哪个路径目录?

这边看你应该是oracle模式企业版建议去咨询企业工单同学,更新到 4.3.2bp1 试试,延长了oracle连接的默认超时配置。

好的,谢谢您