数据库数据迁移注意事项

背景:
项目需要重新部署环境,利用navicat做数据迁移,功能入口如下图:



环境:
1、postgresql版本9.6;
2、部署系统ubuntu版本20;
3、navicat premium版本15;

问题1:ERROR:  permission denied for relation hibernate_sequence
分析:数据库登录用户错误
解决:选择正确用户登录数据库,解决问题。

问题2:
[ERR] 31> CREATE OR REPLACE FUNCTION "public"."armor"(bytea)
  RETURNS "pg_catalog"."text" AS '$libdir/pgcrypto', 'pg_armor'
  LANGUAGE c IMMUTABLE STRICT
  COST 1
[ERR] 31> ERROR:  could not access file "$libdir/pgcrypto": No such file or directory
[DTF] 32> armor: Getting function structure
[DTF] Process terminated
分析:缺少postgresql-contrib-9.6插件
解决:
apt-get update
apt-get clean
sudo apt-get install -d postgresql-contrib-9.6
CREATE EXTENSION pgcrypto;

问题3:
[ERR] 31> DROP FUNCTION IF EXISTS "public"."armor"(bytea)
[ERR] 31> ERROR:  cannot drop function armor(bytea) because extension pgcrypto requires it
HINT:  You can drop extension pgcrypto instead.
[DTF] 32> armor: Getting function structure
[DTF] Process terminated
分析:系统插件函数无法被删除
解决:传输数据时候,不选择系统插件函数。

问题4:外部表的创建
分析:需要先创建外部表才能传输数据
解决:外部表创建见 https://blog.csdn.net/lp52054xgy/article/details/134859758

问题5:
[DTF] 9> sys_sessions: Drop table
[ERR] 9> SELECT * FROM "public"."sys_sessions"
[ERR] 9> ERROR:  password is required
DETAIL:  Non-superuser cannot connect if the server does not request a password.
HINT:  Target server's authentication method must be changed.
[DTF] Process terminated
分析:外部表的用户映射password错误
解决:如下图甚至正确的密码。然后手动建立外部表,确认可以正常打开。传输数据时候排除掉外部表。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值