openGauss这么多工具?到底要选哪个?(248)

41 阅读1分钟

#openGauss #入门 #安装 #数据库 #开源

知识来源:docs-opengauss.osinfra.cn/zh/

示例3:执行gs_restore,将导出的MPPDB_backup文件(目录格式)导入到postgres数据库。

gs_restore backup/MPPDB_backup -p 15400 -d postgres
restore operation successful
total time: 21003  ms

示例4:执行gs_restore,使用自定义归档格式的MPPDB_backup.dmp文件来进行如下导入操作。 导入PUBLIC模式下所有对象的定义和数据。在导入时会先删除已经存在的对象,如果原对象存在跨模式的依赖则需手工强制干预。

gs_restore backup/MPPDB_backup.dmp -p 15400 -d postgres -e -c -n PUBLIC
Error while PROCESSING TOC:
Error from TOC entry 313; 1259 337399 TABLE table1 gaussdba
could not execute query: ERROR:  cannot drop table table1 because other objects depend on it
DETAIL:  view t1.v1 depends on table table1
HINT:  Use DROP ... CASCADE to drop the dependent objects too.
    Command was: DROP TABLE IF EXISTS public.table1;

手工删除依赖,导入完成后再重新创建。

gs_restore backup/MPPDB_backup.dmp -p 15400 -d postgres -e -c -n PUBLIC
restore operation successful
total time: 2203  ms

#openGauss #入门 #安装 #数据库 #开源

知识来源:docs-opengauss.osinfra.cn/zh/