来迁移数据管道
2023-09-14 09:10:20 时间
磁盘空间不足的条件,使用命名管道或匿名的迁移和进口数据;请注意,命名管道必须权限问题。
0. Name PIP 0 [pg@h1 ~]$ psql gtlions -ac "select 't3' tab,count(*) from t3 union all select 't4',count(*) from t4;" select 't3' tab,count(*) from t3 union all select 't4',count(*) from t4; tab | count -----+------- t3 | 100 t4 | 0 (2 rows) [pg@h1 ~]$ mknod syncpip p [pg@h1 ~]$ psql gtlions -p 5432 -c "copy t3 to '/home/pg/sync'"|psql gtlions -p 5432 -c "copy t4 from '/home/pg/sync'" ERROR: could not open file "/home/pg/sync" for reading: No such file or directory [pg@h1 ~]$ psql gtlions -p 5432 -c "copy t3 to '/home/pg/syncpip'"|psql gtlions -p 5432 -c "copy t4 from '/home/pg/syncpip'" COPY 100 [pg@h1 ~]$ psql gtlions -p 5432 -c "copy t3 to '/home/pg/syncpip'"|psql gtlions -p 5432 -c "copy t4 from '/home/pg/syncpip'" COPY 100 [pg@h1 ~]$ psql gtlions -p 5432 -c "copy t3 to '/home/pg/syncpip'"|psql gtlions -p 5432 -c "copy t4 from '/home/pg/syncpip'" COPY 100 [pg@h1 ~]$ psql gtlions -p 5432 -c "copy t3 to '/home/pg/syncpip'"|psql gtlions -p 5432 -c "copy t4 from '/home/pg/syncpip'" COPY 100 [pg@h1 ~]$ psql gtlions -ac "select 't3' tab,count(*) from t3 union all select 't4',count(*) from t4;" select 't3' tab,count(*) from t3 union all select 't4',count(*) from t4; tab | count -----+------- t3 | 100 t4 | 400 (2 rows) 1. Name PIP 1 [pg@h1 ~]$ rm -rf sync* [pg@h1 ~]$ mkfifo syncpip [pg@h1 ~]$ ll syncpip prw-rw-r-- 1 pg pg 0 11月 6 09:15 syncpip [pg@h1 ~]$ psql gtlions -p 5432 -c "copy t3 to '/home/pg/syncpip'"|psql gtlions -p 5432 -c "copy t4 from '/home/pg/syncpip'" COPY 100 [pg@h1 ~]$ psql gtlions -p 5432 -c "copy t3 to '/home/pg/syncpip'"|psql gtlions -p 5432 -c "copy t4 from '/home/pg/syncpip'" COPY 100 [pg@h1 ~]$ psql gtlions -p 5432 -c "copy t3 to '/home/pg/syncpip'"|psql gtlions -p 5432 -c "copy t4 from '/home/pg/syncpip'" COPY 100 [pg@h1 ~]$ psql gtlions -p 5432 -c "copy t3 to '/home/pg/syncpip'"|psql gtlions -p 5432 -c "copy t4 from '/home/pg/syncpip'" COPY 100 [pg@h1 ~]$ psql gtlions -ac "select 't3' tab,count(*) from t3 union all select 't4',count(*) from t4;" select 't3' tab,count(*) from t3 union all select 't4',count(*) from t4; tab | count -----+------- t3 | 100 t4 | 800 (2 rows) 2. UnName PIP [pg@h1 ~]$ psql gtlions -p 5432 -c "copy t3 to stdout"|psql gtlions -p 5432 -c "copy t4 from stdin" [pg@h1 ~]$ psql gtlions -p 5432 -c "copy t3 to stdout"|psql gtlions -p 5432 -c "copy t4 from stdin" [pg@h1 ~]$ psql gtlions -p 5432 -c "copy t3 to stdout"|psql gtlions -p 5432 -c "copy t4 from stdin" [pg@h1 ~]$ psql gtlions -p 5432 -c "copy t3 to stdout"|psql gtlions -p 5432 -c "copy t4 from stdin" [pg@h1 ~]$ psql gtlions -p 5432 -c "copy t3 to '/home/pg/syncpip'"|psql gtlions -p 5432 -c "copy t4 from '/home/pg/syncpip'" COPY 100 [pg@h1 ~]$ psql gtlions -ac "select 't3' tab,count(*) from t3 union all select 't4',count(*) from t4;" select 't3' tab,count(*) from t3 union all select 't4',count(*) from t4; tab | count -----+------- t3 | 100 t4 | 1300 (2 rows)
-EOF-
相关文章
- 【华为云技术分享】云小课 | 迁移第三方云厂商数据至OBS,两种方式任你选
- 【华为云技术分享】云图说|第三方云厂商数据如何迁移至华为云OBS?真相在这里......
- 【鲲鹏来了】鲲鹏迁移过程案例分享
- dbMigration .NET 数据同步迁移工具
- 如何将数据从SQL Server 迁移到PostgreSQL?将数据从SQL Server 迁移到PostgreSQL方法分析!
- Entity Framework CodeFirst数据迁移
- EXP/IMP迁移数据 导入导出全过程
- Oracle 10g 到11g的数据迁移 导入导出 顺序步骤 expdp/impdp
- 老司机的 redis 数据迁移笔记
- 复杂场景,从OpenTSDB迁移到TDengine的实践
- gmStudio:VB6/ASP/COM 迁移升级到 .NET
- 如何将本地数据库迁移到数据库上?
- 云小课|云小课带你快速掌握云数据迁移CDM
- 如何迁移钉钉PC版全部历史聊天记录
- flask-migrate 数据迁移
- 迁移桌面程序到MS Store(9)——APPX With Desktop Extension
- 风格迁移2-00:MUNIT(多模态无监督)-目录-史上最新无死角讲解
- 风格迁移1-07:Liquid Warping GAN(Impersonator)-源码无死角解析(2)-数据读取,预处理
- Oracle 逻辑备份(数据迁移)
- pytorch 16 迁移学习核心技巧·从模型加载到按需初始化模块权重,再到各layer分组设置学习率
- 【过程记录】python环境离线迁移
- 【MySQL】数据平滑迁移方案思考