Unterschiede zwischen den Revisionen 1 und 2
Revision 1 vom 2020-10-13 10:56:57
Größe: 697
Autor: Robert
Kommentar:
Revision 2 vom 2020-10-13 10:58:53
Größe: 747
Autor: Robert
Kommentar:
Gelöschter Text ist auf diese Art markiert. Hinzugefügter Text ist auf diese Art markiert.
Zeile 1: Zeile 1:
## page was renamed from Computerkram/Postgresql

Postgresql

Backup

parallel:

# Starte den Dump, Dump wird in $DUMP_FILE umgeleitet, Fehler in $PG_DUMP_ERR
pg_dump -Fd -T measure_lastupdate -T measurement_temp1 -T measurement_temp2 -f ${DUMP_FILE} -j 4 -U postgres --no-password ${DB_SCHEMA} 2> $PG_DUMP_ERR
EXITCODE=$?
echo "Schema exportieren"
pg_dump -F d -s -f ${DUMP_FILE}.schema  -U postgres --no-password ${DB_SCHEMA} 2>> $PG_DUMP_ERR
EXITCODE_SCHEMA=$?
mv ${DUMP_FILE}/toc.dat ${DUMP_FILE}/toc.dat.orig
cp ${DUMP_FILE}.schema/toc.dat ${DUMP_FILE}/toc.dat
rm -r ${DUMP_FILE}.schema

Restore

  • Datenbank anlegen
  • createdb dbname
  • Import des Dumps
  • pg_restore -d dbname -j 4 dir/

Wikinger: ComputerKram/Postgresql (zuletzt geändert am 2020-10-13 10:58:53 durch Robert)