edb postgres dba best practices

29
© 2016 EDB. All rights reserved. 1 DBA Best Practices: A day in a life of an EDB Postgres DBA

Upload: enterprisedb

Post on 15-Apr-2017

332 views

Category:

Software


3 download

TRANSCRIPT

Page 1: EDB Postgres DBA Best Practices

© 2016 EDB. All rights reserved. 1

DBA Best Practices: A day in a life of an EDB Postgres DBA

Page 2: EDB Postgres DBA Best Practices

© 2016 EDB. All rights reserved. 2

•  Agenda •  A DBA's Challenge •  The EDB Postgres Platform

•  PEM −  Manageability, tuning and High Availability

•  BART •  DEMO •  Summary

•  Resources •  Q&A

Agenda

Page 3: EDB Postgres DBA Best Practices

© 2016 EDB. All rights reserved. 3

•  Meet expectations of internal customers, e.g.: −  developers, users

•  Maintain existing database environments reliably: −  High Availability −  Disaster Recovery −  Performance Monitoring

•  Quick Provisioning of databases

A DBA's Challenge

Page 4: EDB Postgres DBA Best Practices

© 2016 EDB. All rights reserved. 4

EDB Postgres Platform

Page 5: EDB Postgres DBA Best Practices

© 2016 EDB. All rights reserved. 5

EDB PostgreSQL Management •  Mission-critical tools for management,

monitoring, tuning, high availability, as well as backup and disaster recovery

•  EDB Postgres Enterprise Manager

•  EDB Postgres Failover Manager

•  EDB Postgres Backup and Recovery

EDB Postgres Platform – Tool Suites

Page 6: EDB Postgres DBA Best Practices

© 2016 EDB. All rights reserved. 6

PEM Architecture

Unmanaged Hosts

PEM Server

Managed Hosts (PEM Agents)

PEM Clients

Monitoring Data

Database Management Connections

Enterprise Management Connections

PEM Components & Connections

Page 7: EDB Postgres DBA Best Practices

© 2016 EDB. All rights reserved. 7

•  Over 225 pre-configured metrics ready to run −  Select best-practice metrics for your needs −  Immediate productivity after installation

•  Performance Monitoring Dashboards −  At-a-glance statistics for I/O, storage, memory, user/session

activity, & wait statistics −  Instantly insights to diagnose and improve performance

•  Customizable Dashboards an Custom probes −  Create environment/application specific mission-critical views −  Easily tailored for your special needs

PEM for DBAs… •  One DBA can manage many more database servers!

Page 8: EDB Postgres DBA Best Practices

© 2016 EDB. All rights reserved. 8

•  Alert Management −  Pre-defined alerts with SMTP/SNMP support −  Confront issues BEFORE they impact operations!

•  Remote Monitoring −  Monitor servers using a remote agent −  No installation of software required on sensitive servers to monitor them

•  Capacity Manager −  trend analysis forecasting for storage and hardware needs −  Helps plan hardware and storage purchases.

•  Log Manager (including Log based alerts) −  Configure logging for multiple servers at one time −  One of many time saving bulk operation features

PEM for DBAs… (cont’d) •  One DBA can manage many more database servers!

Page 9: EDB Postgres DBA Best Practices

© 2016 EDB. All rights reserved. 9

•  Pg Expert −  Best practice advisor for security, schemas, & configuration −  Many years of Postgres expertise and advice in one click!

•  Log Analyzer Expert −  Generate stats locks, longest queries, # of queries, unique queries, etc. −  Supports post-event alerting as well as real-time alerts

•  Index Advisor −  Recommends / deploys new indexes for troublesome queries −  Quickly try new table specific optimizations

•  SQL Profiler −  Capture complex SQL workloads on-demand or on-schedule −  Quickly finds slow queries for analysis and optimization

PEM for DBAs… (cont’d) •  One DBA can manage many more database servers!

Page 10: EDB Postgres DBA Best Practices

© 2016 EDB. All rights reserved. 10

•  Tuning Wizard −  Configure machine utilization and application workload −  Rapid database optimizations

•  Bulk Operations −  Analyze and manage multiple servers at once −  Eliminates repetitive time-consuming procedures

•  Team Support −  Assigns various servers to the same roles as users −  Users only see the servers they control / are authorized to see

PEM for DBAs… (cont’d) •  One DBA can manage many more database servers!

Page 11: EDB Postgres DBA Best Practices

© 2016 EDB. All rights reserved. 11

•  Detailed Query Analysis

PEM for Developers… 1001101001 0101110100 1011010101

Page 12: EDB Postgres DBA Best Practices

© 2016 EDB. All rights reserved. 12

•  Debugger for Stored Procedures, Triggers & Functions

PEM for Developers…Also an IDE 1001101001 0101110100 1011010101

Page 13: EDB Postgres DBA Best Practices

© 2016 EDB. All rights reserved. 13

•  Before PEM:

Set config parameter to log long-running queries + server log scraping + pgFouine report…then re-run top queries using EXPLAIN; a slow manual process to find problem queries and interpret results; difficult using multiple tools

PEM for Developers…SQL Profiler

Page 14: EDB Postgres DBA Best Practices

© 2016 EDB. All rights reserved. 14

•  With PEM:

Manual or scheduled SQL captures by user or database, with sorting and filtering of key performance metrics results and integrated with EXPLAIN tool as well as Index Advisor module.

SQL Profiler – what’s running slow

Duration: 122 seconds

Page 15: EDB Postgres DBA Best Practices

© 2016 EDB. All rights reserved. 15

•  SQL Profiler −  Quickly find, troubleshoot, and fix slow running SQL −  Number one cause of most database problems is poorly

optimized SQL code −  Captures a large SQL workload to locate poor running SQL −  Supports on-demand and scheduled captures −  Provides multiple performance metrics with EXPLAIN analysis −  Integrates with the Index Advisor, which analyzes a set of

SQL statements and recommends new Indexes to improve performance

PEM for DBAs – What’s running Slow 1001101001 0101110100 1011010101

Page 16: EDB Postgres DBA Best Practices

© 2016 EDB. All rights reserved. 16

PgExpert - System Tuning 1001101001 0101110100 1011010101

Page 17: EDB Postgres DBA Best Practices

© 2016 EDB. All rights reserved. 17

EDB Failover Manager

EDB

Failover Manager creates fault tolerant database clusters to minimize downtime when a master database fails by keeping data online in high availability configurations.

FAILOVER MANAGER

Page 18: EDB Postgres DBA Best Practices

© 2016 EDB. All rights reserved. 18

PEM to setup Streaming Replication 1001101001 0101110100 1011010101

Page 19: EDB Postgres DBA Best Practices

© 2016 EDB. All rights reserved. 19

Streaming Replication set up ..contd. 1001101001 0101110100 1011010101

Page 20: EDB Postgres DBA Best Practices

© 2016 EDB. All rights reserved. 20

EDB Failover Manager

EDB

Failover Manager creates fault tolerant database clusters to minimize downtime when a master database fails by keeping data online in high availability configurations.

FAILOVER MANAGER

Page 21: EDB Postgres DBA Best Practices

© 2016 EDB. All rights reserved. 21

Streaming Replication Dashboards 1001101001 0101110100 1011010101

Page 22: EDB Postgres DBA Best Practices

© 2016 EDB. All rights reserved. 22

•  Detailed Query Analysis

PEM for Developers… 1001101001 0101110100 1011010101

Page 23: EDB Postgres DBA Best Practices

© 2016 EDB. All rights reserved. 23

•  Simplifies and reduces errors with a system-wide catalog and command line tool that automates online backup and recovery across local and remote PostgreSQL and PPAS Servers.

What is Backup and Recovery Tool (BART)

BART

Page 24: EDB Postgres DBA Best Practices

© 2016 EDB. All rights reserved. 24

•  Backup Catalog to manage multiple PG or PPAS servers

•  Retention policies and obsolete backup management

•  SSH support for remote operations •  Local and remote online physical backups •  Auto-compression and MD5 checksum verification

−  WAL archives

•  Continuous WAL Archiving and PITR

BART Feature Highlights

Page 25: EDB Postgres DBA Best Practices

© 2016 EDB. All rights reserved. 25

BART Benefits

•  Error free automation for backups •  Easily find and recover backups from a central Catalog •  Friendly command line tool with powerful options

−  Backup, restore, show and verify −  Integrates with existing CRON jobs

•  No user interruptions during backups

•  Compression speeds backups and uses less storage •  Verification guards against corrupt files •  Point In Time Recovery provides maximum protection

Page 26: EDB Postgres DBA Best Practices

© 2016 EDB. All rights reserved. 26

Demo

•  Tune a Database using PgExpert •  Set up Streaming Replication from with in PEM •  Failover using EFM, from PEM

•  Backup and Recovery if time permits.

Page 27: EDB Postgres DBA Best Practices

© 2016 EDB. All rights reserved. 27

•  Single Window Administration for multiple Database Clusters

•  Performance Management

•  IDE •  Efficient Failover Management •  Organized Backup and PITR.

•  Many More.

EDB Tools - Summary

Page 28: EDB Postgres DBA Best Practices

© 2016 EDB. All rights reserved. 28

EDB Postgres Downloads http://www.enterprisedb.com/downloads EDB Postgres Management Suite data sheet http://www.enterprisedb.com/ds-management-suite Blog: Data Backup Made Easy http://www.enterprisedb.com/postgres-plus-edb-blog/ahsan-hadi/data-backup-made-easy Blog: How to Be the Master of Your Database Domain http://www.enterprisedb.com/postgres-plus-edb-blog/devrim-g-nd-z/how-be-master-your-database-domain

Resources

Page 29: EDB Postgres DBA Best Practices

© 2016 EDB. All rights reserved. 29