From e41c96074ac9de695932798d49c621422f193b58 Mon Sep 17 00:00:00 2001 From: wonb168 <37640893@qq.com> Date: Tue, 21 Feb 2023 17:57:07 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=BF=E7=94=A8=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README-cn.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README-cn.md b/README-cn.md index 32557ce..fc3b27f 100644 --- a/README-cn.md +++ b/README-cn.md @@ -18,3 +18,16 @@ pg_dump导出主、备库的结构(不含数据)成dump sql文件。 ## 同步数据 能并行的gp迁移方案只有gpfdist(封装后为gpload)和gpcopy,gpcopy更优。 同时gpcopy的json配置文件可以写sql,这样可以控制sql的where条件实现增量copy。未配置的默认全量。 + +## 使用方法 +目前只有1个gpsync.py文件和1个config.toml文件。调用时只需传入源和目标库的连接信息及数据库名。以gpadmin最高权限运行,方便运行多个库即授权。 +``` +if __name__=='__main__': + dbname='mdmaster_platform'#'mdmaster_bsgj_dev551_product_dev' + dbinfo={"host":"192.168.200.207", "port":2345, "usr":"gpadmin", "pwd":"密码"} + dbinfo2={"host":"192.168.200.73", "port":2345, "usr":"gpadmin", "pwd":"密码"} + print('begint to sync schema...') + sync_schema(dbinfo,dbinfo2,dbname) + print('begint to sync data...') + copy_data(dbinfo,dbinfo2,dbname) +```