程序实现postgresql备份还原
来源:互联网 发布:linux shell sleep 编辑:程序博客网 时间:2024/05/27 19:25
1、windows下Java程序备份还原:
①、备份:
String command = "cmd /c pg_dump -h "+hostName+" -o -U "+userName+" -F t -d "+dbName+" > " + pathName + File.separator + fileName;
Runtime.getRuntime().exec(command);
②、还原:
String command = "cmd /c pg_restore -h "+hostName+" -U "+userName+" -c -d "+dbName+" < " + fileNamePath;
Runtime.getRuntime().exec(command);
2、linux下Java程序备份还原:
①、备份:
String[] command = new String[]{"sh","-c","pg_dump -h "+hostName+" -o -U "+userName+" -F t -d "+dbName+" > " + pathName + File.separator +fileName};
Runtime.getRuntime().exec(command);
②、还原:
String[] command = new String[]{"sh","-c","pg_restore -h "+hostName+" -U "+userName+" -c -d "+dbName+" < " + fileNamePath};
Runtime.getRuntime().exec(command);
- 程序实现postgresql备份还原
- Postgresql:命令备份与还原
- PostgreSQL的备份与还原
- postgresql数据库备份与还原
- PostgreSQL 备份与还原操作
- PostgreSQL(七)备份还原
- Postgresql的dump数据库备份与还原
- postgresql数据库的备份和还原
- postgresql的备份与还原命令
- PostgreSQL逻辑备份还原代码分析--目录
- Postgresql备份与还原命令pg_dump
- postgresql 数据库的备份与还原
- 实现备份和还原
- .net程序里实现远程备份还原ORACLE数据库
- c# winform 实现对postgresql数据库的自动备份还原功能
- c# winform 实现对postgresql数据库的自动备份还原功能
- SQLserver备份还原系统实现
- 用C#程序备份还原SQL2000数据库
- 将Json数据转换为ADO.NET DataSet对象
- TF/02_TensorFlow_Way/01 02
- java学习各位大牛的网址
- PHP 生成WSDL 以及 提供SOAP服务
- String类中方法的使用举例
- 程序实现postgresql备份还原
- [leetcode]Longest Common Prefix
- javascript实现继承的几种方式
- nodejs笔记01
- Android搜索历史记录与自动填充
- MySQL创建只读账号
- Android跑马灯无焦点滚动
- 重温DOS下的小作品:回忆过去,展望将来
- Caffe中学习率策略