GBase 8a
适配迁移
文章

Oracle导出数据迁移到gbase:text parser error

发表于2026-03-09 20:41:1216次浏览4个评论

1.源表23个字段,使用不可见字符,进行字段分隔,换行分隔,命令如下:

load data infile 'ftp://gbase:password0@ip//gbase/oraToGbase/dev_data/DND_DISCOUNT.txt' into table dbname.table_name data_format 3 null_value 'NULL' fields terminated by '\x02' lines  terminated by '\x03'
datetime format '%Y-%m-%d %H:%i:%s' date format '%Y-%m-%d'; 

在进行数据加载时,如果报错:text parser error 很可能字段之间存在特殊字符,还需要修改分隔符

修改后的导出命令:

/gbase/oraToGbase/tool/orato8a-9.5.3.046-centos8-x86_64 --user='user_name/"password"@ip:1521/server_name' --query="select * from db.table_name" --file='/gbase/oraToGbase/dev_data/table_name.txt'  --null_value 'NULL' --field="\xff"  --line_separator="xff\xff" --format=3

加载如下:

load data infile 'ftp://gbase:password@ip//gbase/oraToGbase/dev_data/table_name.txt' into table db.table_name data_format 3  null_value 'NULL' fields terminated by '\xff' lines  terminated by 'xff\xff'
datetime format '%Y-%m-%d %H:%i:%s' date format '%Y-%m-%d'; 

评论

登录后才可以发表评论
白军奎发表于 4个月前
可参考https://www.gbase8.cn/994?hilite=text+parser+error
gbase_poc_凡夫发表于 4个月前
@白军奎:好的,刚看到
青菇凉发表于 2个月前
继续努力
GBase用户51883发表于 2个月前
学习了