There is no U N D O h ere!



Similar documents
giovedì 4 ottobre 12

Barman Backup and Recovery Manager for PostgreSQL Tutorial

PostgreSQL Backup Strategies

Backup and Recovery using PITR Mark Jones EnterpriseDB Corporation. All rights reserved. 1

Using HP StoreOnce Backup systems for Oracle database backups

How To Run A Standby On Postgres (Postgres) On A Slave Server On A Standby Server On Your Computer (Mysql) On Your Server (Myscientific) (Mysberry) (

BackupPC. Network Startup Resource Center

Module 7. Backup and Recovery

NAS 259 Protecting Your Data with Remote Sync (Rsync)

Product Brief. it s Backed Up

11. Configuring the Database Archiving Mode.

EDB Backup and Recovery Tool Guide

Oracle 11g Database Administration

DB2 9 for LUW Advanced Database Recovery CL492; 4 days, Instructor-led

White Paper. Alfresco Backup and Disaster Recovery

EMC Data Domain Boost for Oracle Recovery Manager (RMAN)

FileCruiser Backup & Restoring Guide

Be Very Afraid. Christophe Pettus PostgreSQL Experts Logical Decoding & Backup Conference Europe 2014

Configuring Backup Settings. Copyright 2009, Oracle. All rights reserved.

MapGuide Open Source Repository Management Back up, restore, and recover your resource repository.

PostgreSQL 9.4 up and running.. Vasilis Ventirozos Database Administrator OmniTI

Protecting SQL Server Databases Software Pursuits, Inc.

D78850GC10. Oracle Database 12c Backup and Recovery Workshop. Summary. Introduction. Prerequisites

Oracle Database 11g: Administration Workshop II DBA Release 2

Bareos in Radio Astronomy Scaling up using Virtual Full Backups

VMware vsphere Data Protection 5.8 TECHNICAL OVERVIEW REVISED AUGUST 2014

Oracle Database 11g: Administration Workshop II DBA Release 2

EMC Data Domain Boost for Oracle Recovery Manager (RMAN)

Agenda. Overview Configuring the database for basic Backup and Recovery Backing up your database Restore and Recovery Operations Managing your backups

Oracle Database 10g: Backup and Recovery 1-2

Oracle Recovery Manager

EMC DATA DOMAIN OPERATING SYSTEM

Oracle Database 11g: Administration Workshop II Release 2

VMware vsphere Data Protection 6.0

D12CBR Oracle Database 12c: Backup and Recovery Workshop NEW

for QSS/OASIS Presented by Bill Genske Session 135

The Future of PostgreSQL High Availability Robert Hodges - Continuent, Inc. Simon Riggs - 2ndQuadrant

BACKUP YOUR SENSITIVE DATA WITH BACKUP- MANAGER

ORACLE CORE DBA ONLINE TRAINING

11. Oracle Recovery Manager Overview and Configuration.

EMC DATA DOMAIN OPERATING SYSTEM

SynapseBackup Secure backups and disaster recovery services for both physical and virtual environments. Top reasons on why SynapseBackup is the best

12. User-managed and RMAN-based backups.

Objectif. Participant. Prérequis. Pédagogie. Oracle Database 11g - Administration Workshop II - LVC. 5 Jours [35 Heures]

Oracle Recovery Manager 10g. An Oracle White Paper November 2003

IBM TSM DISASTER RECOVERY BEST PRACTICES WITH EMC DATA DOMAIN DEDUPLICATION STORAGE

Disaster Recovery as a Service An Overview

<Insert Picture Here> RMAN Configuration and Performance Tuning Best Practices

Oracle Database 11g: Administration Workshop II

PostgreSQL 9.0 Streaming Replication under the hood Heikki Linnakangas

VMware vsphere Data Protection 6.1

Yiwo Tech Development Co., Ltd. EaseUS Todo Backup. Reliable Backup & Recovery Solution. EaseUS Todo Backup Solution Guide. All Rights Reserved Page 1

MySQL Enterprise Backup

How To Backup And Restore A Database With A Powervault Backup And Powervaults Backup Software On A Poweredge Powervalt Backup On A Netvault 2.5 (Powervault) Powervast Backup On An Uniden Power

4PSA Total Backup User's Guide. for Plesk and newer versions

Using HP StoreOnce Backup Systems for NDMP backups with Symantec NetBackup

Oracle 10g Feature: RMAN Incrementally Updated Backups

Using VMware vfabric Postgres

SEP sesam Online/Hot Backup & Restore for Databases and Application Protection

How To Use Rackspace Backup On A Computer Or A Hard Drive

Oracle Fixed Scope Services Definitions Effective Date: October 14, 2011

Administering your PostgreSQL Geodatabase

Configuring Backup Settings Configuring and Managing Persistent Settings for RMAN Configuring Autobackup of Control File Backup optimization

A Shared-nothing cluster system: Postgres-XC

EISOO AnyBackup 5.1. Detailed Features

Symantec NetBackup 7.1 What s New and Version Comparison Matrix

RMAN What is Rman Why use Rman Understanding The Rman Architecture Taking Backup in Non archive Backup Mode Taking Backup in archive Mode

Symantec Backup Exec 2014 Icon List

City of Yakima/Yakima County Purchasing

Symantec NetBackup 7.5 Clients and Agents

Oracle Database Disaster Recovery Using Dell Storage Replication Solutions

Cloud Backup Service Service Description. PRECICOM Cloud Hosted Services

How To Backup A Virtualized Environment

BACKUP BEST PRACTICES FOR A XENSERVER & XENDESKTOP ENVIRONMENT

Backup Types. Backup and Recovery. Categories of Failures. Issues. Logical. Cold. Hot. Physical With. Statement failure

Zen Internet. Online Data Backup. Zen Vault Professional Plug-ins. Issue:

15 Organisation/ICT/02/01/15 Back- up

BackupAssist v6 quickstart guide

Backup and Recovery 1

Ultimate Guide to Oracle Storage

IBM Tivoli Storage Manager Version Introduction to Data Protection Solutions IBM

Protecting your SQL database with Hybrid Cloud Backup and Recovery. Session Code CL02

VMware vsphere Data Protection

Best practices for operational excellence (SharePoint Server 2010)

Disaster Recovery for Oracle Database

Protecting Microsoft SQL Server with Asigra Cloud Backup

Database Backup and Restore Mechanism. Presented by : Mary Meladath

Online Backup Plus Frequently Asked Questions

Backup/Recovery Strategy and Impact on Applications. Jacek Wojcieszuk, CERN IT Database Deployment and Persistancy Workshop October, 2005

Designing Database Solutions for Microsoft SQL Server 2012 MOC 20465

Creating a Cloud Backup Service. Deon George

Using the NDMP File Service for DMA- Driven Replication for Disaster Recovery. Hugo Patterson

Dell PowerVault DL2200 & BE 2010 Power Suite. Owen Que. Channel Systems Consultant Dell

Competitive Analysis Retrospect And Our Competition

Outline. Failure Types

EonStor DS remote replication feature guide

How To Use Ackup On Ackups On A Cell Phone Or Ipad Or Ipa (Ackup) On A Pc Or Ipam 2.5 (Aqb) On An Iphone

SQL Server Database Administrator s Guide

Transcription:

postgres @pg $> psql psql (9. 3.1) Type "he lp" for help. postgres =# UPDATE t SET c = black ; UPDATE 4815162342 postgres =# ^C ^C ^C There is no U N D O h ere! ^Z

postgres@pg $> psql psql (9.3.1) Type "help" for help. postgres=# DROP DATABASE scott; DROP DATABASE postgres=# \q postgres@pg $> date Fri 8 Nov 2013 18:43:15 CET

04:00:01 t start 05:12:44 t end pg_dump -Fc 14 hours 43 minutes 14 seconds of potential data loss (RPO ) 18:43:15 transactions CRASH!!! t t t t t t t t t t t

04:00:01 t start 04:41:52 t end Base Backup 1 minute 1 second of potential data loss (RPO ) 18:43:15 transactions CRASH!!! WAL WAL WAL WAL WAL WAL WAL WAL WAL WAL WAL 18:42:14

Prof essio nal Postg r esq L www.2ndquadrant.com

GABRIELE BARTOLINI PGConf.DE 2013 - Oberhausen, 8 November 2013

GABRIELE BARTOLINI Co-Founder and Manager of 2ndQuadrant Italia Data Architect, Business critical environments Data warehousing Co-Founder Italian PostgreSQL Users Group Co-Founder PostgreSQL Europe PostgreSQL Contributor and Advocate

DISCLAIMER T his talk assum es you are fam iliar with disaster recovery concepts and PostgreSQ L im plem entation of Point In Tim e Recovery

BE AWARE In 2ndQ uadrant, all these concepts usually fit in a 2 day workshop on D isaster Recovery and a 1 day workshop on Barm an alone

OUTLINE Business continuity / Disaster recovery for databases Disaster recovery with Barman for PostgreSQL

PA RT I Business continuity / Disaster recovery for databases

BUSINESS CONTINUITY activity performed by an organisation to ensure that critical business functions will be available to customers, suppliers, regulators, and other entities that must have access to those functions - Wikipedia

INFORMATION TECHNOLOGY Business continuity High availability Disaster recovery

LAW REQUIREMENTS In Italy, the C odice dell A m m inistrazione D igitale defines business continuity requirem ents for public administrations

DISASTER (touch wood now) system/hardware failures unintentional errors natural disaster

REACT TO A DISASTER Recover systems, data and infrastructures

TOO LATE! Do not wait for a disaster to happen

PLAN FOR DISASTERS Disasters will happen. Be prepared.

Plans are worthless, but planning is everything.there is a very great distinction because when you are planning for an emergency you must start with this one thing: the very definition of "emergency" is that it is unexpected, therefore it is not going to happen the way you are planning. - Dwight D. Eisenhower

REGULAR CRASH TESTS

DATABASE DISASTER RECOVERY Let s just focus on databases!

REQUIREMENTS Automated backups Notifications (anomalies) Frequency of backups Retention policies Data protection Availability for recovery

TYPES OF BACKUP Full backup Incremental backup Differential backup Hot backup Logical backup Physical backup

POSTGRES BACKUP Hot backup MVCC (core) Logical Backup pg_dump Physical Backup Full backup (base backup) Differential backup (WAL) Incremental backup N/A

TRADITIONAL DR WITH POSTGRESQL PostgreSQL primitives for DR are robust and reliable High level skills DBA Sysadmins Custom scripts Hard to integrate in: Backup solutions Disaster Recovery plans H ard to test!

EXISTING TOOLS Omni-PITR WAL centric WALmgr WAL centric WAL-E EC2 centric, but... good came later pg-rman Server centric

NONE FOR DR None of them was a pure disaster recovery solution. We wanted something similar to Oracle s RMAN.

FILLING A HOLE The lack of a DR solution is a barrier towards the adoption of PostgreSQL from Oracle users point of view.

OUR GOALS Hot, Full, Differential and Incremental backups Multiple servers Remote backup & recover y Backup catalogues Retention policies Archival and compression WAL segments Periodical backups A utom ation Integration Usability

WWW.PGBARMAN.ORG

PA RT II Disaster recovery with Barman for PostgreSQL

BARMAN GNU GPL 3 Hosted on Sourceforge.net Linux Python 2.6/2.7 (3.0 exp.) RPM package Debian/Ubuntu package Designed, developed, maintained by 2ndQuadrant PostgreSQL 8.4 to 9.3 PyPI package

Postgres Postgres Postgres Batarmpean Barman LAN, hceybnrtridaliasrecdhiaterchtuitreecture

data centre 1 data centre 2 Postgres Barman rsync Barman Geographic redundancy

Postgres Continuous archiving (WAL shipping via SSH) SSH commands SQL commands Barman

Postgres Barman WAL secure channel cron Barman s WAL archive

Postgres Barman Periodical backup (weekly) Full backup - Sat 1, 4AM Differential backup Backup catalogue Full backup - Sat 8, 4AM Full backup - Sat 15, 4AM Full backup - Sat 22, 4AM

W AL archive Backup 1 (100MB) Backup 2 (105MB) WAL WAL WAL WAL WAL WAL WAL WAL WAL WAL Size: 100MB + 8106M0MBB==18206M0MBB Size: 105MB + 80MB = 185MB

CONFIGURATION FILE [barman] barman_home = /srv/barman barman_user = barman log_file = /var/log/barman/barman.log log_level = NOTICE compression = gzip [production] description = Production PostgreSQL ssh_command = ssh postgres@pg.2ndquadrant.it conninfo = host=pg.2ndquadrant.it user=postgres compression = bzip2

MULTI-SERVER CONFIGURATION [barman] ; General configuration ; [server_one] ; Configuration for Server 1 ; [server_two] ; Configuration for Server 2 ; [server_x] ;

MULTIPLE FILES INCLUSION [barman] ; General configuration ; configuration_files_directory = /etc/barman.d

CONVENTION OVER CONFIGURATION global/per server options default directory layout

CONVENTIONAL DIRECTORIES FOR BARMAN barm an_hom e (/srv/barman) server directory (/sr v/barman/production) base directory (/sr v/barman/production/base) WAL directory (/sr v/barman/production/wals) incoming directory (/sr v/barman/production/incoming)

GLOBAL COMMANDS List of m anaged servers barman list-server M aintenance operations barman cron

SERVER COMMANDS Inform ation and diagnostics barman status Backup control Recovery control barman check barman show-server barman list-backup

2ndQuadrant Pret. l nal P at8n 8QL - Barman barma1 backupserver barman list-backup tes t-9.1 tes t-9 1 20120821T164531 - Tue Aug 21 16:45:38 2012 - Size 109.0 MiB - WAL S12e 304.0 MiB tes t-9.1 20120821T163806 - Tue Aug 21 16:40:37 2012 - Size 68.0 M1B - WAL Size 208.0 UiB tes t-9.1 20120821T163146 - Tue Aug 21 16:32:10 2012 - S1ze. 45.0 ld1b - WAL S1ze. 432.0 M1B tes t-9 1 20120821T162630 - Tue Aug 21 16:26:32 2012 - S1ze 53.0 ld1b - WAL S1ze: 400.0 M1B tes t-9 1 201 20821T161651 - Tue Aug 21 16:16:53 2012 - Size 49 0 ldib - WAL Size: 48 0 UiB barma backupserver 1 www.2ndquadrant.com

BACKUP CONTROL barman backup barman show-backup barman list-files standalone, data, wal, full barman delete

2ndQuadrant 11 PrGt. l nal P at8n SQL Barman ------ bar ar backupserver barman backup test-9.1 Starting backup for server test-9 1 in /tmp/barman- tests/test-9 1/base/20120821T163235 Backup start at xlog location: 0/29000020 (000000010000000000000029, 00000020) Copy1ng f1les. Copy done Asking PostgreSQL server to final1ze the backup. Backup end at xlog location: 0/290000AO (000000010000000000000029, OOOOOOAO) Backup completed barman backupserver 1. - -.

SHOW BACKUP General Server name, Postgres version, status,... Base backup Start/End time, first/last WAL, disk usage,... W AL Number of associated files disk usage Context Previous/Next backup

$ barman show-backup angus latest Backup 20131102T130001: Server Name : angus Status : DONE PostgreSQL Version: 80417 PGDATA directory : /home/raid/pgdata Tablespaces: tb_angus: /home/raid/postgres (oid: tb_temp: /home/tables (oid: 19812) 16385) Base backup information: Disk usage : 10.0 TiB Timeline : 1 Begin WAL : 0000000100006C57000000B5 End WAL : 0000000100006C7E000000D4 WAL number : 9977 Begin time End time Begin Offset End Offset Begin XLOG End XLOG : 2013-11-02 13:00:01.617907 : 2013-11-04 14:07:20.981717 : 32 : 7185968 : 6C57/B5000020 : 6C7E/D46DA630 WAL information: No of files Disk usage Last available : 56655 : 232.0 GiB : 0000000100006D5D00000002

RECOVERY CONTROL Recovery target (full / point in time) Local recovery barman recover Rem ote recovery barman recover --remote-ssh-command

ADVANCED RECOVERY Point In Time Recovery --target-time = TIME --target-xid = XID Relocation of tablespaces --tablespace NAME:LOCATION [...] --target-name = NAME (for 9.1+)

COMMON USE CASES Unintentional errors recovery Disaster recovery Sandbox server (BI, staging,...)

2ndQuadrant Pret. l nal P at8n 8QL Barman - bar 1a1 backupserver barman recover test-9.1 Starting local restore for server test-9 1 using backup 20120821T161651 20120821T161651 Destination d1rectory. /srv/postgres/recover/ Copying the base backup Copying required wal segments. The archive_comand was set to 'false' to prevent data losses. Restore done 1 /srv/pos tgres/recover/ Please revie the network and archi ving related settings in the postgres configurat1on file before Start the jus t recovered instance. barman bacl upserver 1 "www.2ndquadrant.com

RETENTION POLICIES User-defined policy How long backups are retained for recovery Point of recoverability REDUNDANCY RECOVERY WINDOW

RETENTION POLICY CONFIGURATION ; Base backup retention policy retention_policy = 'redundancy 3' retention_policy = 'recovery window of 3 months'

BANDWIDTH CONTROL You can limit I/O bandwidth usage bandwidth_limit global/server option tablespace_bandwidth_limit on a per tablespace basis Unit of measure: kilobytes (default 0, no limits)

BANDWIDTH LIMIT CONFIGURATION [barman] bandwidth_limit [server_one] ;... bandwidth_limit = 4096 = 1024 [server_two] ;... tablespace_bandwidth_limit = tbs01:4096,tbs02:2048

BACKLOG Incremental backup Better recovery support Sandbox recovery Logical backup integration pg_dump on sandbox instances Backup from standby More hook scripts TAR format for backups Export/Import of backups External backups SSH only connections Replication protocol support libpq only connections pg_basebackup WAL streaming (0 Data Loss) Backup server Windows support JSON output for full automation Backup validation...

OUR COMMITMENT Keep it open source Reinvest money from sale of DR turnkey solutions in R&D Support and maintain RPM/Debian packages Accept sponsorships for new features development

CSI PIEMONTE (One of the top 10 ICT companies in Italy for revenue) We found in Barman the optimal solution for physical backup and disaster recovery of PostgreSQL databases. Barman is robust and easy to use. Its command interface allows an easy integration with the existing management tools in our enviroment. Sponsors of RPM package and WAL compression

CONCLUSIONS Hides complexity of PITR / Keeps unaltered PITR strenghts Not invasive Fosters migrations from Oracle Standard de facto for PostgreSQL Disaster Recovery Advice: plan for DR (if you have not done it yet)

TIME TO... yum install barman apt-get install barman

QUESTIONS? Gabriele.Bartolini@2ndQuadrant.it Twitter: _GBartolini_ www.pgbarman.org

THANK YOU!

LICENSE This work is licensed under a Creative Commons Attribution- NonCommercial-ShareAlike 3.0 Unported License Copyright (c) 2012, 2013-2ndQuadrant.it