postgres备份数据库
2015-06-05 11:33
204 查看
1. psql --help
psql is the PostgreSQL interactive terminal. Usage: psql [OPTION]... [DBNAME [USERNAME]] General options: -c, --command=COMMAND run only single command (SQL or internal) and exit -d, --dbname=DBNAME database name to connect to (default: "xingxing.duan") -f, --file=FILENAME execute commands from file, then exit -l, --list list available databases, then exit -v, --set=, --variable=NAME=VALUE set psql variable NAME to VALUE -V, --version output version information, then exit -X, --no-psqlrc do not read startup file (~/.psqlrc) -1 ("one"), --single-transaction execute as a single transaction (if non-interactive) -?, --help show this help, then exit Input and output options: -a, --echo-all echo all input from script -e, --echo-queries echo commands sent to server -E, --echo-hidden display queries that internal commands generate -L, --log-file=FILENAME send session log to file -n, --no-readline disable enhanced command line editing (readline) -o, --output=FILENAME send query results to file (or |pipe) -q, --quiet run quietly (no messages, only query output) -s, --single-step single-step mode (confirm each query) -S, --single-line single-line mode (end of line terminates SQL command) Output format options: -A, --no-align unaligned table output mode -F, --field-separator=STRING field separator for unaligned output (default: "|") -H, --html HTML table output mode -P, --pset=VAR[=ARG] set printing option VAR to ARG (see \pset command) -R, --record-separator=STRING record separator for unaligned output (default: newline) -t, --tuples-only print rows only -T, --table-attr=TEXT set HTML table tag attributes (e.g., width, border) -x, --expanded turn on expanded table output -z, --field-separator-zero set field separator for unaligned output to zero byte -0, --record-separator-zero set record separator for unaligned output to zero byte Connection options: -h, --host=HOSTNAME database server host or socket directory (default: "local socket") -p, --port=PORT database server port (default: "5432") -U, --username=USERNAME database user name (default: "xingxing.duan") -w, --no-password never prompt for password -W, --password force password prompt (should happen automatically) For more information, type "\?" (for internal commands) or "\help" (for SQL commands) from within psql, or consult the psql section in the PostgreSQL documentation. Report bugs to <pgsql-bugs@postgresql.org>.
2.备份数据库
/opt/pg94/bin/pg_dump -U user -i -E UTF8 -F p -f /home/q/tmp/ticket_report.sql -h host -d database
相关文章推荐
- MySQL索引类型一览 让MySQL高效运行起来
- Oracle建立表空间和用户
- 数据库学习记录20150605
- 详解SQL Server连接(内连接、外连接、交叉连接)
- oracle错误(一) ORA-各种常见java.sql.SQLException小结
- Xtrabackup
- 缓存开源软件使用的原则和建议
- Oracle分析函数入门
- 探索MySQL源代码-客户端连接过程和用户认证体系
- Mysql 创建,授权,删除用户
- redis3.0.2 分布式集群安装详细步骤
- oracle的TM锁、TX锁
- ASE isql 连接
- PL/SQL结构学习
- 如何查看mysql数据库表所使用的引擎(转载)
- sqlserver导出 数据字典的SQL语句
- 本地不安装Oracle,plsql远程连接数据库
- 报错:1130-host ... is not allowed to connect to this MySql server 开放mysql远程连接 不使用localhost
- MySQL安装
- mysql 常用命令