gp_dump

[gpadmin@sachi gpAdminLogs]$ gp_dump --help

gp_dump dumps a database as a text file or to other formats.

Usage:

  gp_dump [OPTION]... [DBNAME]

General options:

  -i, --ignore-version     proceed even when server version mismatches

                           gp_dump version

  -v, --verbose            verbose mode. adds verbose information to the

                           per segment status files

  --help                   show this help, then exit

  --version                output version information, then exit

Options controlling the output content:

  -a, --data-only          dump only the data, not the schema

  -c, --clean              clean (drop) schema prior to create

  -d, --inserts            dump data as INSERT, rather than COPY, commands

  -D, --column-inserts     dump data as INSERT commands with column names

  -E, --encoding=ENCODING     dump the data in encoding ENCODING

  -n, --schema=SCHEMA      dump the named schema only

  -N, --exclude-schema=SCHEMA do NOT dump the named schema(s)

  -o, --oids               include OIDs in dump

  -O, --no-owner           do not output commands to set object ownership

                           in plain text format

  -s, --schema-only        dump only the schema, no data

  -S, --superuser=NAME     specify the superuser user name to use in

                           plain text format

  -t, --table=TABLE        dump only matching table(s) (or views or sequences)

  -T, --exclude-table=TABLE   do NOT dump matching table(s) (or views or sequences)

  -x, --no-privileges      do not dump privileges (grant/revoke)

  --disable-triggers          disable triggers during data-only restore

  --use-set-session-authorization

                              use SESSION AUTHORIZATION commands instead of

                              ALTER OWNER commands to set ownership

Connection options:

  -h, --host=HOSTNAME      database server host or socket directory

  -p, --port=PORT          database server port number

  -U, --username=NAME      connect as specified database user

  -W, --password           force password prompt (should happen automatically)

Greenplum Database specific options:

  --gp-c                  use gzip for in-line compression

  --gp-d=BACKUPFILEDIR    directory where backup files are placed

  --gp-r=REPORTFILEDIR    directory where report file is placed

  --gp-s=BACKUPSET        backup set indicator - (p)rimaries only (default)

                          or (i)ndividual segdb (must be followed with a list of dbids

                          of primary segments to dump. For example: --gp-s=i[10,12,14]

  --rsyncable             pass --rsyncable option to gzip

If no database name is supplied, then the PGDATABASE environment

variable value is used.

For Example

[gpadmin@sachi ~]$ export PGDATABASE=sachi

[gpadmin@sachi ~]$ gp_dump --schema=sachi 

20131117:18:23:24|gp_dump-[INFO]:-Read params: -n sachi

20131117:18:23:24|gp_dump-[INFO]:-Command line options analyzed.

20131117:18:23:24|gp_dump-[INFO]:-Connecting to master database on host localhost port 5432 database sachi.

20131117:18:23:24|gp_dump-[INFO]:-Reading Greenplum Database configuration info from master database.

20131117:18:23:24|gp_dump-[INFO]:-Preparing to dump the following segments:

20131117:18:23:24|gp_dump-[INFO]:-Segment 1 (dbid 3)

20131117:18:23:24|gp_dump-[INFO]:-Segment 0 (dbid 2)

20131117:18:23:24|gp_dump-[INFO]:-Master (dbid 1)

20131117:18:23:24|gp_dump-[INFO]:-Starting a transaction on master database sachi.

20131117:18:23:24|gp_dump-[INFO]:-Getting a lock on pg_class in database sachi.

20131117:18:23:24|gp_dump-[INFO]:-About to spin off 3 threads with timestamp key 20131117182324

20131117:18:23:24|gp_dump-[INFO]:-Creating thread to backup dbid 3: host sachi port 40001 database sachi

20131117:18:23:24|gp_dump-[INFO]:-Creating thread to backup dbid 2: host sachi port 40000 database sachi

20131117:18:23:24|gp_dump-[INFO]:-Creating thread to backup dbid 1: host sachi port 5432 database sachi

20131117:18:23:24|gp_dump-[INFO]:-Waiting for remote gp_dump_agent processes to start transactions in serializable isolation level

20131117:18:23:24|gp_dump-[INFO]:-Listening for messages from server on dbid 2 connection

20131117:18:23:24|gp_dump-[INFO]:-Listening for messages from server on dbid 3 connection

20131117:18:23:24|gp_dump-[INFO]:-Successfully launched Greenplum Database backup on dbid 2 server

20131117:18:23:24|gp_dump-[INFO]:-Successfully launched Greenplum Database backup on dbid 3 server

20131117:18:23:24|gp_dump-[INFO]:-Listening for messages from server on dbid 1 connection

20131117:18:23:26|gp_dump-[INFO]:-Successfully launched Greenplum Database backup on dbid 1 server

20131117:18:23:26|gp_dump-[INFO]:-All remote gp_dump_agent processes have began transactions in serializable isolation level

20131117:18:23:26|gp_dump-[INFO]:-Waiting for remote gp_dump_agent processes to obtain local locks on dumpable objects

20131117:18:23:27|gp_dump-[INFO]:-backup succeeded for dbid 1 on host sachi

20131117:18:23:27|gp_dump-[INFO]:-All remote gp_dump_agent processes have obtains the necessary locks

20131117:18:23:27|gp_dump-[INFO]:-Committing transaction on the master database, thereby releasing locks.

20131117:18:23:27|gp_dump-[INFO]:-Waiting for all remote gp_dump_agent programs to finish.

20131117:18:23:27|gp_dump-[INFO]:-backup succeeded for dbid 2 on host sachi

20131117:18:23:27|gp_dump-[INFO]:-backup succeeded for dbid 3 on host sachi

20131117:18:23:27|gp_dump-[INFO]:-All remote gp_dump_agent programs are finished.

20131117:18:23:27|gp_dump-[INFO]:-Report results also written to /home/gpmaster/gpsne-1/gp_dump_20131117182324.rpt.

Greenplum Database Backup Report

Timestamp Key: 20131117182324

gp_dump Command Line: --schema=sachi

Pass through Command Line Options: -n sachi

Compression Program: None

Individual Results

segment 1 (dbid 3) Host sachi Port 40001 Database sachi BackupFile /disk2/gpdata2/gpsne1/./gp_dump_0_3_20131117182324: Succeeded 

segment 0 (dbid 2) Host sachi Port 40000 Database sachi BackupFile /disk1/gpdata1/gpsne0/./gp_dump_0_2_20131117182324: Succeeded 

Master (dbid 1) Host sachi Port 5432 Database sachi BackupFile /home/gpmaster/gpsne-1/./gp_dump_1_1_20131117182324: Succeeded 

Master (dbid 1) Host sachi Port 5432 Database sachi BackupFile /home/gpmaster/gpsne-1/./gp_dump_1_1_20131117182324_post_data: Succeeded 

gp_dump utility finished successfully.

Find files created in 24 hours.

$find . -mtime 0