Dataphin管道任务将数据同步到Oracle数据库选择表之后报错“获取元数据失败SQLTimeoutException: ORA-01013: user requested cancel of current operation ”
更新时间:
问题描述
Dataphin管道任务将数据同步到Oracle数据库选择表之后报错“获取元数据失败SQLTimeoutException: ORA-01013: user requested cancel of current operation ”。
问题原因
根据报错“ORA-01013: user requested cancel of current operation ”看是Dataphin侧主动断开了请求。导致该问题的原因有以下情况:
- Dataphin中读取数据库的元数据(比如表名、字段名)时后台有设置一个超时时间,如果读取元数据超过该超时时间,Dataphin就会主动断开请求。
- 数据库存在性能问题,比如数据库中对应的表被锁,导致读取元数据的请求执行时间比较长,从而出现该异常。
解决方案
- 对于读取元数据超过Dataphin平台设置的超时时间情况,可以在Oracle数据库中执行如下读取元数据的SQL,确认执行时间,如果比较久,需要联系Dataphin支持人员提交运维流程,修改读取元数据的超时时间:
SELECT
c.column_name AS name,
c.data_type AS dataType,
concat(c.data_type, concat('(', concat(c.data_length, ')'))) as rawDataType,
c.data_length as dataLength,
c.data_precision as dataPrecision,
c.data_scale as dataScale,
c.char_length as charLength,
c.column_id AS seqNumber,
CASE WHEN c.nullable = 'Y'
THEN 1
ELSE 0 END AS allowEmpty,
'0' as pt,
CASE WHEN d.constraint_type = 'P' THEN '1' ELSE '0' END as pk,
c_c.comments as "des"
FROM
ALL_TAB_COLUMNS c left join ALL_COL_COMMENTS c_c on c.owner = c_c.owner and c.table_name = c_c.table_name and c.column_name = c_c.column_name
LEFT JOIN (
SELECT
b.owner,
b.table_name,
column_name,
constraint_type
FROM
all_cons_columns b
JOIN all_constraints c
ON
b.CONSTRAINT_NAME = c.CONSTRAINT_NAME
AND b.table_name = c.table_name
AND b.owner = c.owner WHERE constraint_type = 'P'
) d ON c.owner = d.owner and c.table_name = d.table_name and c.column_name = d.column_name
WHERE LOWER(c.owner) = LOWER('您数据库的Schema') AND c.table_name = '您实际选择的表名称'
ORDER BY seqNumber
- 对于数据库中表被锁场景,需要参考如下方案排查并解锁:Oracle数据库表被锁,导致管道任务取数据报错ORA-01013
适用于
- Dataphin
文档内容是否对您有帮助?