1. 【YashanDB知识库】 如何设置yasql客户端的字符编码 2024-12-10 2. 【YashanDB知识库】 exp导出csv报错YAS-00218 string conversion failed 2024-12-12 3. 【YashanDB知识库】 YAS-00218 string conversion failed. 2024-12-12 4. 【YashanDB知识库】 虚拟机重启后启动YMP报错 2024-12-12 5. 【YashanDB知识库】 OM仲裁节点故障后手工切换方案和yasom仲裁重新部署后重新纳管数据库集群方案 2024-12-12 6. 【YashanDB知识库】 oracle与yashanDB的jdbc返回常量列"0.00"的精度和刻度不一致 2024-12-13 7. 【YashanDB知识库】 UNDO表空间膨胀怎么处理 2024-12-13 8. 【YashanDB知识库】 如何将mysql含有group by的SQL转换成崖山支持的SQL 2024-12-13 9. 【YashanDB知识库】 同样建表语句,大整型数字在Oracle插入成功,在YashanDB插入失败 2024-12-13 10. 【YashanDB知识库】 要有好的跑批性能,有哪些参数要注意 2024-12-13 11. 【YashanDB知识库】 MySQL迁移至崖山char类型数据自动补空格问题 2024-12-16 12. 【YashanDB知识库】 kettle同步PG至崖山提示no encryption pg_hba.conf记录 2024-12-16 13. 【YashanDB知识库】 kettle同步大表提示java内存溢出 2024-12-16 14. 【YashanDB知识库】 查看表空间是否加密 2024-12-16 15. 【YashanDB知识库】 误配置SYSTEM级别的STATISTICS_LEVEL参数为ALL导致数据库性能下降 2024-12-17 16. 【YashanDB知识库】 用yasldr配置Bulkload模式作单线程迁移300G的业务数据到分布式数据库,迁移任务频繁出错 2024-12-17 17. 【YashanDB知识库】 YCP单机部署离线升级-rpc升级方式详细步骤 2024-12-17 18. 【YashanDB知识库】 YCP高可用部署离线升级-rpc升级详细步骤 2024-12-17 19. 【YashanDB知识库】 如何处理yasql输入交互模式下单行字符总量超过限制4000字节 2024-12-17 20. 【YashanDB知识库】 IMP跨网络导入慢问题 2024-12-19 21. 【YashanDB知识库】 insert语句有编码不识别字,执行卡住问题 2024-12-19 22. 【YashanDB知识库】 服务器重启后Yashandb无法启动 2024-12-19 23. 【YashanDB知识库】 如何处理no free block in dictionary cache 2024-12-19 24. 【YashanDB知识库】 in大量参数时查询性能慢 2024-12-19 25. 【YashanDB知识库】 Oracle pipelined函数在YashanDB中的改写 2024-12-23 26. 【YashanDB知识库】 update (子查询) set ORG_ID_STAN -ID 改写 2024-12-23 27. 【YashanDB知识库】 XMLAGG方法的兼容 2024-12-23 28. 【YashanDB知识库】 YMP迁移过程中报错YAS-02143或YAS-02193 2024-12-23 29. 【YashanDB知识库】 复合索引下in大量参数查询性能慢 2024-12-23 30. 【YashanDB知识库】 jdbc查询st_geometry类型的数据时抛出YAS-00101 cannot allocate 0 bytes for anlHeapMalloc异常 2024-12-23 31. 【YashanDB知识库】 JDBC驱动的date类型字段结果集调用getString方法只返回日期,不返回时分秒 2024-12-23 32. 【YashanDB知识库】 Mybatis-Plus调用YashanDB怎么设置分页 2024-12-23 33. 【YashanDB知识库】 ycm-YashanDB列表有数据库显示故障排除步骤 2024-12-23 34. 【YashanDB知识库】 单机部署报错:prohibited operation, please check if the IP and username are correct 2024-12-23 35. 【YashanDB知识库】 启动数据库时报错:YAS-02059 control file version 0.2.64 is incompatible with YashanDB version 0.2.65 2024-12-24 36. 【YashanDB知识库】 如何处理报错"UDT column batch insert" has not been implemented yet 2024-12-24
37. 【YashanDB知识库】 如何解决共享集群部署遇到报错:YAS-05721 invalid input parameter, reason: node name invalid. 2024-12-24 38. 【YashanDB知识库】 如何排查YMP报错:”OCI版本为空或OCI的架构和本地系统的架构不符“ 2024-12-24 39. 【YashanDB知识库】 如何限制用户session连接数 2024-12-24 40. 【YashanDB知识库】 通过dblink查询Oracle数据时报YAS-07301异常 2024-12-25 41. 【YashanDB知识库】 使用leading hint调整SQL执行计划后报错YAS-04522 invalid hint leading 2024-12-25 42. 【YashanDB知识库】 通过触发器复制varchar(4000 char)列的数据导致乱码 2024-12-25 43. 【YashanDB知识库】 由于druid中间件配置导致的YAS-04003 maximum number of open cursors is 1000 2024-12-25 44. 【YashanDB知识库】 exp 导出数据库时,报错YAS-00402 2024-12-25 45. 【YashanDB知识库】 YAS-00004 feature "implict table" has not been implemented yet 2024-12-27 46. 【YashanDB知识库】 YAS-04003 maximum number of open cursors is xxx 2024-12-27 47. 【YashanDB知识库】 YAS-04209 unexpected word ; 2024-12-27 48. 【YashanDB知识库】 yasboot集群状态命令登录失败问题 2024-12-27 49. 【YashanDB知识库】 YAS-00004 feature "create user" has not been implemented yet 2024-12-27 50. 【YashanDB知识库】 yasql / as sysdba无法登录 2024-12-27 51. 【YashanDB知识库】 启动yasom时报错:sqlite connection error 2024-12-27 52. 【YashanDB知识库】 使用vmware虚拟机安装的YashanDB,本机无法访问 2024-12-27 53. 【YashanDB知识库】 安装过程报错: unable to authenticate, attempted methods [none password], no supported methods remain 2024-12-27 54. 【YashanDB知识库】 密码带特殊符号登录报错YAS-02143 invalid username/password, login denied 2024-12-27 55. 【YashanDB知识库】 如何使用jdbc向YashanDB批量插入gis数据 2024-12-30 56. 【YashanDB知识库】 如何在备机节点上做备份和恢复 2024-12-30 57. 【YashanDB知识库】 收集统计信息时报错YAS-00507 date/timestamp value overflow 2024-12-30 58. 【YashanDB知识库】 druid连接池查询空间数据报错read time out 2024-12-30 59. 【YashanDB知识库】 hive初始化崖山报错YAS-04209 2024-12-30 60. 【YashanDB知识库】 imp导入数据库时,报错YAS-08023 2024-12-31 61. 【YashanDB知识库】 listagg拼接结果发生溢出 2024-12-31 62. 【YashanDB知识库】 python驱动查询gbk字符集崖山数据库CLOB字段,数据被驱动截断 2024-12-31 63. 【YashanDB知识库】 sys登录提示账户被锁,怎么处理? 2024-12-31 64. 【YashanDB知识库】 YAS-00402 failed to connect socket, errno 111, error message "Connection refused" 2024-12-31 65. 【YashanDB知识库】 YAS-02287 audit policy cannot be dropped as it is currently enabled 01-02 66. 【YashanDB知识库】 YAS-02507 base incremental backup set does not exist 01-02 67. 【YashanDB知识库】 YAS-02547 there is a gap in the restored archived logs on instance 1, reason: start of restored archive 35 is greater than database last archive 21 01-02 68. 【YashanDB知识库】 YAS-02605 the current instance is not master role 01-02 69. 【YashanDB知识库】 YAS-04379 invalid alteration of datatype 01-02 70. 【YashanDB知识库】 YAS-05534 unsupport operation: Create sibling files to diskgroups 01-06 71. 【YashanDB知识库】 YDC连接数据库报错yasdb return code is zero 01-06 72. 【YashanDB知识库】 YMP迁移达梦时,报错:查询出现异常 01-06 73. 【YashanDB知识库】 查询空间数据提示This socket has been closed. 01-06 74. 【YashanDB知识库】 数据库用户所拥有的权限查询 01-06 75. 【YashanDB知识库】 JDBC查询时抛出YAS-02094 current session has been killed or canceled异常 01-07 76. 【YashanDB知识库】 YashanDB JDBC驱动查询时抛出io fail:Read timed out异常 01-07 77. 【YashanDB知识库】 YCM上CPU负载超过实际核数是怎么回事 01-07 78. 【YashanDB知识库】 使用Reverse索引的解决自增序列做索引,插入性能大幅提升 01-07 79. 【YashanDB知识库】 YMP从达梦迁移到崖山,报错:不能识别文件路径,没找到csv文件 01-07 80. 【YashanDB知识库】 YMP在迁移过程中,遇到报错:failed to open file /qianyi/ymp/ymp_23.3, errno 2, error message "No such file or directory". 01-09 81. 【YashanDB知识库】 解决mybatis的mapper文件sql语句结尾加分号";"报错 01-09 82. 【YashanDB知识库】 进行load data的时候报找不到动态库liblz4.so 01-09 83. 【YashanDB知识库】 如何解决删除分区后索引失效问题 01-09 84. 【YashanDB知识库】 如何输入小写表名的函数参数 01-09 85. 【YashanDB知识库】 审计表UNIFIED_AUDIT_TRAIL出现YAS-00220 utf8 sequence is wrong 01-10 86. 【YashanDB知识库】 kettle做增量同步,出现报错:Unrecognized VM option 'MaxPermSize-256m' 01-10 87. 【YashanDB知识库】 YashanDB run.log中有slow log queue is full信息 01-10 88. 【YashanDB知识库】 YCM托管YashanDB报错 /home/yashan/.yasboot/.env is not existed 01-10 89. 【YashanDB知识库】 使用yasboot查看YashanDB status为unconnected,但是YashanDB运行正常 01-10 90. 【YashanDB知识库】 YMP从mysql迁移到崖山,报错:服务器错误 01-10 91. 【YashanDB知识库】 使用DBeaver 插入数据 nvarchar字段插入为空 01-10 92. 【YashanDB知识库】 崖山BIT类型对MYSQL兼容问题 01-10 93. 【YashanDB知识库】 YDC无法通过conn切换用户 01-10 94. 【YashanDB知识库】 YMP校验从yashandb同步到oracle的数据时,字段timestamp(0)出现不一致 01-16 95. 【YashanDB知识库】 并发update报错YAS-02208 lock conflict in consistent write 01-16 96. 【YashanDB知识库】 导入数据时报错:YAS-00008 type convert error:literal does not match format string 01-16 97. 【YashanDB知识库】 druid连接池做断网测试,无法自动重新连接 01-16 98. 【YashanDB知识库】 Hive 命令工具insert崖山数据库报错 01-16 99. 【YashanDB知识库】 load data一次导入多个文件的数据时报错 01-16 100. 【YashanDB知识库】 YAS-02143 invalid username/password, login denied 01-16
本文内容来自YashanDB官网,原文内容请见 https://www.yashandb.com/newsinfo/7802963.html?templateId=1718516
问题现象
YashanDB中的ST_GEOMETRY类型是数据库内置的一种自定义类型,用于存储和访问符合开放地理空间信息联盟(Open Geospatial Consortium,简称OGC)制定的SFA SQL标准的几何对象。详细可查看 ST_GEOMETRY | YashanDB Doc
在批量插入(例如insert into select或使用yasldr导入数据)的时候, 如果表有ST_GEOMETRY类型的字段, 则会报错YAS-00004 feature "UDT column batch insert" has not been implemented yet
问题的风险及影响
影响ST_GEOMETRY类型的数据导入
问题影响的版本
YashanDB版本:23.2.7.100及以下
解决方法及规避方式
问题的原因
YashanDB的GIS功能是通过UDT实现的,目前用户自定义类型UDT还不支持批量插入。在表存在GEO相关字段的时候,即使插入的字段不包含GEO的字段,但是存储每一行都会预留相应的字段空间,因此也会失败。
解决办法
1、普通迁移数据可以使用YMP解决
源端是YashanDB,表字段是ST_GEOMETRY类型的,可以通过YMP迁移数据到目标端YashanDB。详见YMP使用指导 快速开始 | YashanDB Doc
2、在单表数据量小,想通过SQL命令快速迁移,可以使用如下方法规避实现:
举例,如CREATE TABLE t1(id INT, pos ST_GEOMETRY); 需要将T1的数据导出到目标库
1)在源库表将geo字段转成clob(转换函数st_astext),通过exp导出
exp --csv -f csv -u user -p passwd --server-host 127.0 .0.0 .1 :1688 -q 'SELECT id,ST_ASTEXT(pos) from t1'
2)在目标库建立临时表, 上传步骤1)导出的数据t1.outfile将数据通过yasldr导入clob字段
CREATE TABLE t2(id INT , pos_str clob );
[yashan@localhost ~ ]$ cat t2.load.template
LOAD DATA OPTIONS(DEGREE_OF_PARALLELISM= 8 ,STATS= TRUE )
INFILE '/home/yashan/t1.outfile' WITH EMBEDDED FIELDS TERMINATED BY '|' OPTIONALLY ENCLOSED BY '"'
APPEND INTO TABLE t2 trailing nullcols("ID","POS_STR")
yasldr user / passwd@127 .0 .0 .0 .1 :1688 batch_size= 4032 control_file= / home/ yashan/ t2.load.template
3)通过ST_GEOMFROMTEXT转换成ST_GEOMETRY类型
alter table t2 add "POS" "MDSYS"."ST_GEOMETRY";
update t2 set pos = st_geomfromtext(POS_STR);
alter table t2 drop POS_STR;
4)小结
通过上述的步骤方法将ST_GEOMETRY类型转换成CLOB,再导入到目标表之后通过ST_GEOMFROMTEXT转换回来,在现有工具下即可实现对ST_GEOMETRY类型的搬迁。
特别需要注意的是,在目标库同样建立表的时候,同时带clob、ST_GEOMETRY类型,通过yasldr或insert into select仅导入clob字段(insert列不带ST_GEOMETRY字段),会失败,需要建表的时候不带ST_GEOMETRY字段,在导入数据之后再添加字段,通过update更新ST_GEOMETRY字段(从clob字段转换数据回来)。
在崖山团队目前已经在实现UDT字段支持批量插入,insert into select/yasldr/exp/imp后续均可以支持UDT字段,敬请留意后续版本。
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· PostgreSQL 和 SQL Server 在统计信息维护中的关键差异
· C++代码改造为UTF-8编码问题的总结
· DeepSeek 解答了困扰我五年的技术问题
· 为什么说在企业级应用开发中,后端往往是效率杀手?
· 用 C# 插值字符串处理器写一个 sscanf
· [翻译] 为什么 Tracebit 用 C# 开发
· 腾讯ima接入deepseek-r1,借用别人脑子用用成真了~
· Deepseek官网太卡,教你白嫖阿里云的Deepseek-R1满血版
· DeepSeek崛起:程序员“饭碗”被抢,还是职业进化新起点?
· RFID实践——.NET IoT程序读取高频RFID卡/标签