Migrating Oracle database to PostgreSQLUmair Mansoob
This document discusses migrating an Oracle database to PostgreSQL. It covers initial discovery of the Oracle database features and data types used. A migration assessment would analyze data type mapping, additional PostgreSQL features, and testing requirements. Challenges include porting PL/SQL code, minimizing downtime during migration, and comprehensive testing of applications on the new PostgreSQL platform. Migrating large data sets and ensuring performance for critical applications are also challenges.
This document summarizes a workshop on migrating from Oracle to PostgreSQL. It discusses migrating the database, including getting Oracle and PostgreSQL instances, understanding how applications interact with databases, and using the ora2pg tool to migrate the database schema and data from Oracle to PostgreSQL.
Migration from Oracle to PostgreSQL: NEED vs REALITYAshnikbiz
Some of the largest organization in the world today are going cost-efficient by innovating their database layer. Migrating workloads from legacy systems to an enterprise open source database technology like Postgres is a preferred choice for many.
This document discusses various considerations and steps for migrating from an Oracle database to PostgreSQL. It begins by explaining some key differences between the two databases regarding transactions, schemas, views, and other concepts. It then outlines the main steps of the migration process: migrating the database schema, migrating the data, migrating stored code like PL/SQL, migrating SQL statements, and migrating the application itself. Specific challenges for each step are explored, such as data type translations, handling PL/SQL, and translating Oracle-specific SQL. Finally, several migration tools are briefly described.
Whether migrating a database or application from Oracle to Postgres, as a first step, we need to analyze the database objects(DDLs), to find out the incompatibilities between both the databases and estimate the time and cost required for the migration. In schema migration, having a good knowledge of Oracle and Postgres helps to identify incompatibilities and choose the right tool for analysis/conversion. In this webinar, we will discuss schema incompatibility hurdles when migrating from Oracle to Postgres and how to overcome them.
What you will learn in this webinar:
- How you identify if your oracle schema is compatible with PostgreSQL
- Incompatibility hurdles and identifying them with Migration tools
- How to Overcome incompatibility hurdles
- Available tools for conversion
- Post migration activities - functional testing, performance analysis, data migration, application switchover
This document provides an introduction and overview of PostgreSQL, including its history, features, installation, usage and SQL capabilities. It describes how to create and manipulate databases, tables, views, and how to insert, query, update and delete data. It also covers transaction management, functions, constraints and other advanced topics.
Relational RDBMS : MySQL, PostgreSQL and SQL SERVERDalila Chouaya
This document compares and contrasts three popular open-source relational database management systems (RDBMS): MySQL, PostgreSQL, and Microsoft SQL Server. It discusses each RDBMS's supported data types, advantages, disadvantages, and best use cases. MySQL is noted as the most popular with strengths in speed and ease of use, while PostgreSQL focuses on compliance and extensibility. SQL Server is suited for large enterprise systems but has higher costs. The document provides an overview of key factors to consider when selecting an RDBMS.
The Proxy Wars - MySQL Router, ProxySQL, MariaDB MaxScaleColin Charles
This document discusses MySQL proxy technologies including MySQL Router, ProxySQL, and MariaDB MaxScale. It provides an overview of each technology, including when they were released, key features, and comparisons between them. ProxySQL is highlighted as a popular option currently with integration with Percona tools, while MySQL Router may become more widely used due to its support for MySQL InnoDB Cluster. MariaDB MaxScale is noted for its binlog routing capabilities. Overall the document aims to help people understand and choose between the different MySQL proxy options.
This presentation reviews the key methodologies that all the member of the team should consider such as:
- How to prioritize the right application or project for your first Oracle
- Tips to execute a well-defined, phased migration process to minimize risk and increase time to value
- Handling the common concerns and pitfalls related to a migration project
- What resources you can leverage before, during and after your migration
- Suggestions on how you can achieve independence from an Oracle database – without sacrificing performance.
Target audience: This presentation is intended for IT Decision-Makers and Leaders on the team involved in Database decisions and execution.
For more information, please email [email protected]
The document discusses various Oracle performance monitoring tools including Oracle Enterprise Manager (OEM), Automatic Workload Repository (AWR), Automatic Database Diagnostic Monitor (ADDM), Active Session History (ASH), and eDB360. It provides overviews of each tool and examples of using AWR, ADDM, ASH and eDB360 for performance analysis through demos. The conclusions recommend OEM as the primary tool and how the other tools like AWR, ADDM and ASH complement it for deeper performance insights.
The document compares NoSQL and SQL databases. It notes that NoSQL databases are non-relational and have dynamic schemas that can accommodate unstructured data, while SQL databases are relational and have strict, predefined schemas. NoSQL databases offer more flexibility in data structure, but SQL databases provide better support for transactions and data integrity. The document also discusses differences in queries, scaling, and consistency between the two database types.
The 'macro view' on Big Query:
We started with an overview, some typical uses and moved to project hierarchy, access control and security.
In the end we touch about tools and demos.
Databricks is a Software-as-a-Service-like experience (or Spark-as-a-service) that is a tool for curating and processing massive amounts of data and developing, training and deploying models on that data, and managing the whole workflow process throughout the project. It is for those who are comfortable with Apache Spark as it is 100% based on Spark and is extensible with support for Scala, Java, R, and Python alongside Spark SQL, GraphX, Streaming and Machine Learning Library (Mllib). It has built-in integration with many data sources, has a workflow scheduler, allows for real-time workspace collaboration, and has performance improvements over traditional Apache Spark.
This document is a training presentation on Databricks fundamentals and the data lakehouse concept by Dalibor Wijas from November 2022. It introduces Wijas and his experience. It then discusses what Databricks is, why it is needed, what a data lakehouse is, how Databricks enables the data lakehouse concept using Apache Spark and Delta Lake. It also covers how Databricks supports data engineering, data warehousing, and offers tools for data ingestion, transformation, pipelines and more.
MySQL Administrator
Basic course
- MySQL 개요
- MySQL 설치 / 설정
- MySQL 아키텍처 - MySQL 스토리지 엔진
- MySQL 관리
- MySQL 백업 / 복구
- MySQL 모니터링
Advanced course
- MySQL Optimization
- MariaDB / Percona
- MySQL HA (High Availability)
- MySQL troubleshooting
네오클로바
http://neoclova.co.kr/
Oracle Real Application Clusters 19c- Best Practices and Internals- EMEA Tour...Sandesh Rao
In this session, I will cover under-the-hood features that power Oracle Real Application Clusters (Oracle RAC) 19c specifically around Cache Fusion and Service management. Improvements in Oracle RAC helps in integration with features such as Multitenant and Data Guard. In fact, these features benefit immensely when used with Oracle RAC. Finally we will talk about changes to the broader Oracle RAC Family of Products stack and the algorithmic changes that helps quickly detect sick/dead nodes/instances and the reconfiguration improvements to ensure that the Oracle RAC Databases continue to function without any disruption
Google BigQuery is a big data analytics service that allows users to analyze petabytes of data using SQL queries. It offers features like fast query response times, SQL-like queries, multi-dataset support, and pay-as-you-go pricing. The document provides an overview of BigQuery and demonstrates how to import and query data from the BigQuery web UI, command line, and programmatically using Node.js and Google Apps Script.
Presto: Fast SQL-on-Anything (including Delta Lake, Snowflake, Elasticsearch ...Databricks
Presto, an open source distributed SQL engine, is widely recognized for its low-latency queries, high concurrency, and native ability to query multiple data sources. Proven at scale in a variety of use cases at Airbnb, Comcast, GrubHub, Facebook, FINRA, LinkedIn, Lyft, Netflix, Twitter, and Uber, in the last few years Presto experienced an unprecedented growth in popularity in both on-premises and cloud deployments over Object Stores, HDFS, NoSQL and RDBMS data stores.
This document compares SQL and NoSQL databases. It defines databases, describes different types including relational and NoSQL, and explains key differences between SQL and NoSQL in areas like scaling, modeling, and query syntax. SQL databases are better suited for projects with logical related discrete data requirements and data integrity needs, while NoSQL is more ideal for projects with unrelated, evolving data where speed and scalability are important. MongoDB is provided as an example of a NoSQL database, and the CAP theorem is introduced to explain tradeoffs in distributed systems.
The document discusses the Performance Schema in MySQL. It provides an overview of what the Performance Schema is and how it can be used to monitor events within a MySQL server. It also describes how to configure the Performance Schema by setting up actors, objects, instruments, consumers and threads to control what is monitored. Finally, it explains how to initialize the Performance Schema by truncating existing summary tables before collecting new performance data.
Azure Storage is a cloud storage solution that provides four main services - Blob storage, Table storage, Queue storage, and File storage. It allows storing and processing large amounts of unstructured and structured data. Data is stored durably with different replication options for high availability. The storage services can be accessed from various applications and platforms using SDKs and tools.
This document summarizes AlwaysOn availability groups in SQL Server 2016. It discusses how AlwaysOn works, the components of an availability group like primary and secondary replicas, and prerequisites for setting up AlwaysOn. It also provides an overview of a demo that will configure high availability with AlwaysOn and how backups can be performed on secondary replicas.
MariaDB 10.0 introduces domain-based parallel replication which allows transactions in different domains to execute concurrently on replicas. This can result in out-of-order transaction commit. MariaDB 10.1 adds optimistic parallel replication which maintains commit order. The document discusses various parallel replication techniques in MySQL and MariaDB including schema-based replication in MySQL 5.6 and logical clock replication in MySQL 5.7. It provides performance benchmarks of these techniques from Booking.com's database environments.
This document provides information about PostgreSQL and Command Prompt Inc. It discusses that Command Prompt offers professional services for migrating from Oracle to PostgreSQL. It then covers aspects of PostgreSQL like its licensing, large international community, low costs, mature codebase, enterprise features, and technical capabilities like its SQL implementation, replication, foreign data wrappers and user-defined functions. It also notes tools that can help ease migration from Oracle and some differences from Oracle.
Agile Oracle to PostgreSQL migrations (PGConf.EU 2013)Gabriele Bartolini
Migrating an Oracle database to Postgres is never an automated operation. And it rarely (never?) involve just the database. Experience brought us to develop an agile methodology for the migration process, involving schema migration, data import, migration of procedures and queries up to the generation of unit tests for QA.
Pitfalls, technologies and main migration opportunities will be outlined, focusing on the reduction of total costs of ownership and management of a database solution in the middle-long term (without reducing quality and business continuity requirements).
Key Methodologies for Migrating from Oracle to PostgresEDB
This presentation reviews the key methodologies that all members of your team should consider, before planning a migration from Oracle to Postgres including:
• Prioritizing the right application or project for your first Oracle migration
• Planning a well-defined, phased migration process to minimize risk and increase time to value
• Handling common concerns and pitfalls related to a migration project
• Leveraging resources before, during, and after your migration
• Becoming independent from an Oracle database – without sacrificing performance
With EDB Postgres’ database compatibility for Oracle, it is easy to migrate from your existing Oracle databases. The compatibility feature set includes compatibility for PL/SQL, Oracle’s SQL syntax, and built in SQL functions. This means that many applications can be easily migrated over to EDB Postgres. It also allows you to continue using your existing Oracle skills.
For more information please contact us at [email protected]
Relational RDBMS : MySQL, PostgreSQL and SQL SERVERDalila Chouaya
This document compares and contrasts three popular open-source relational database management systems (RDBMS): MySQL, PostgreSQL, and Microsoft SQL Server. It discusses each RDBMS's supported data types, advantages, disadvantages, and best use cases. MySQL is noted as the most popular with strengths in speed and ease of use, while PostgreSQL focuses on compliance and extensibility. SQL Server is suited for large enterprise systems but has higher costs. The document provides an overview of key factors to consider when selecting an RDBMS.
The Proxy Wars - MySQL Router, ProxySQL, MariaDB MaxScaleColin Charles
This document discusses MySQL proxy technologies including MySQL Router, ProxySQL, and MariaDB MaxScale. It provides an overview of each technology, including when they were released, key features, and comparisons between them. ProxySQL is highlighted as a popular option currently with integration with Percona tools, while MySQL Router may become more widely used due to its support for MySQL InnoDB Cluster. MariaDB MaxScale is noted for its binlog routing capabilities. Overall the document aims to help people understand and choose between the different MySQL proxy options.
This presentation reviews the key methodologies that all the member of the team should consider such as:
- How to prioritize the right application or project for your first Oracle
- Tips to execute a well-defined, phased migration process to minimize risk and increase time to value
- Handling the common concerns and pitfalls related to a migration project
- What resources you can leverage before, during and after your migration
- Suggestions on how you can achieve independence from an Oracle database – without sacrificing performance.
Target audience: This presentation is intended for IT Decision-Makers and Leaders on the team involved in Database decisions and execution.
For more information, please email [email protected]
The document discusses various Oracle performance monitoring tools including Oracle Enterprise Manager (OEM), Automatic Workload Repository (AWR), Automatic Database Diagnostic Monitor (ADDM), Active Session History (ASH), and eDB360. It provides overviews of each tool and examples of using AWR, ADDM, ASH and eDB360 for performance analysis through demos. The conclusions recommend OEM as the primary tool and how the other tools like AWR, ADDM and ASH complement it for deeper performance insights.
The document compares NoSQL and SQL databases. It notes that NoSQL databases are non-relational and have dynamic schemas that can accommodate unstructured data, while SQL databases are relational and have strict, predefined schemas. NoSQL databases offer more flexibility in data structure, but SQL databases provide better support for transactions and data integrity. The document also discusses differences in queries, scaling, and consistency between the two database types.
The 'macro view' on Big Query:
We started with an overview, some typical uses and moved to project hierarchy, access control and security.
In the end we touch about tools and demos.
Databricks is a Software-as-a-Service-like experience (or Spark-as-a-service) that is a tool for curating and processing massive amounts of data and developing, training and deploying models on that data, and managing the whole workflow process throughout the project. It is for those who are comfortable with Apache Spark as it is 100% based on Spark and is extensible with support for Scala, Java, R, and Python alongside Spark SQL, GraphX, Streaming and Machine Learning Library (Mllib). It has built-in integration with many data sources, has a workflow scheduler, allows for real-time workspace collaboration, and has performance improvements over traditional Apache Spark.
This document is a training presentation on Databricks fundamentals and the data lakehouse concept by Dalibor Wijas from November 2022. It introduces Wijas and his experience. It then discusses what Databricks is, why it is needed, what a data lakehouse is, how Databricks enables the data lakehouse concept using Apache Spark and Delta Lake. It also covers how Databricks supports data engineering, data warehousing, and offers tools for data ingestion, transformation, pipelines and more.
MySQL Administrator
Basic course
- MySQL 개요
- MySQL 설치 / 설정
- MySQL 아키텍처 - MySQL 스토리지 엔진
- MySQL 관리
- MySQL 백업 / 복구
- MySQL 모니터링
Advanced course
- MySQL Optimization
- MariaDB / Percona
- MySQL HA (High Availability)
- MySQL troubleshooting
네오클로바
http://neoclova.co.kr/
Oracle Real Application Clusters 19c- Best Practices and Internals- EMEA Tour...Sandesh Rao
In this session, I will cover under-the-hood features that power Oracle Real Application Clusters (Oracle RAC) 19c specifically around Cache Fusion and Service management. Improvements in Oracle RAC helps in integration with features such as Multitenant and Data Guard. In fact, these features benefit immensely when used with Oracle RAC. Finally we will talk about changes to the broader Oracle RAC Family of Products stack and the algorithmic changes that helps quickly detect sick/dead nodes/instances and the reconfiguration improvements to ensure that the Oracle RAC Databases continue to function without any disruption
Google BigQuery is a big data analytics service that allows users to analyze petabytes of data using SQL queries. It offers features like fast query response times, SQL-like queries, multi-dataset support, and pay-as-you-go pricing. The document provides an overview of BigQuery and demonstrates how to import and query data from the BigQuery web UI, command line, and programmatically using Node.js and Google Apps Script.
Presto: Fast SQL-on-Anything (including Delta Lake, Snowflake, Elasticsearch ...Databricks
Presto, an open source distributed SQL engine, is widely recognized for its low-latency queries, high concurrency, and native ability to query multiple data sources. Proven at scale in a variety of use cases at Airbnb, Comcast, GrubHub, Facebook, FINRA, LinkedIn, Lyft, Netflix, Twitter, and Uber, in the last few years Presto experienced an unprecedented growth in popularity in both on-premises and cloud deployments over Object Stores, HDFS, NoSQL and RDBMS data stores.
This document compares SQL and NoSQL databases. It defines databases, describes different types including relational and NoSQL, and explains key differences between SQL and NoSQL in areas like scaling, modeling, and query syntax. SQL databases are better suited for projects with logical related discrete data requirements and data integrity needs, while NoSQL is more ideal for projects with unrelated, evolving data where speed and scalability are important. MongoDB is provided as an example of a NoSQL database, and the CAP theorem is introduced to explain tradeoffs in distributed systems.
The document discusses the Performance Schema in MySQL. It provides an overview of what the Performance Schema is and how it can be used to monitor events within a MySQL server. It also describes how to configure the Performance Schema by setting up actors, objects, instruments, consumers and threads to control what is monitored. Finally, it explains how to initialize the Performance Schema by truncating existing summary tables before collecting new performance data.
Azure Storage is a cloud storage solution that provides four main services - Blob storage, Table storage, Queue storage, and File storage. It allows storing and processing large amounts of unstructured and structured data. Data is stored durably with different replication options for high availability. The storage services can be accessed from various applications and platforms using SDKs and tools.
This document summarizes AlwaysOn availability groups in SQL Server 2016. It discusses how AlwaysOn works, the components of an availability group like primary and secondary replicas, and prerequisites for setting up AlwaysOn. It also provides an overview of a demo that will configure high availability with AlwaysOn and how backups can be performed on secondary replicas.
MariaDB 10.0 introduces domain-based parallel replication which allows transactions in different domains to execute concurrently on replicas. This can result in out-of-order transaction commit. MariaDB 10.1 adds optimistic parallel replication which maintains commit order. The document discusses various parallel replication techniques in MySQL and MariaDB including schema-based replication in MySQL 5.6 and logical clock replication in MySQL 5.7. It provides performance benchmarks of these techniques from Booking.com's database environments.
This document provides information about PostgreSQL and Command Prompt Inc. It discusses that Command Prompt offers professional services for migrating from Oracle to PostgreSQL. It then covers aspects of PostgreSQL like its licensing, large international community, low costs, mature codebase, enterprise features, and technical capabilities like its SQL implementation, replication, foreign data wrappers and user-defined functions. It also notes tools that can help ease migration from Oracle and some differences from Oracle.
Agile Oracle to PostgreSQL migrations (PGConf.EU 2013)Gabriele Bartolini
Migrating an Oracle database to Postgres is never an automated operation. And it rarely (never?) involve just the database. Experience brought us to develop an agile methodology for the migration process, involving schema migration, data import, migration of procedures and queries up to the generation of unit tests for QA.
Pitfalls, technologies and main migration opportunities will be outlined, focusing on the reduction of total costs of ownership and management of a database solution in the middle-long term (without reducing quality and business continuity requirements).
Key Methodologies for Migrating from Oracle to PostgresEDB
This presentation reviews the key methodologies that all members of your team should consider, before planning a migration from Oracle to Postgres including:
• Prioritizing the right application or project for your first Oracle migration
• Planning a well-defined, phased migration process to minimize risk and increase time to value
• Handling common concerns and pitfalls related to a migration project
• Leveraging resources before, during, and after your migration
• Becoming independent from an Oracle database – without sacrificing performance
With EDB Postgres’ database compatibility for Oracle, it is easy to migrate from your existing Oracle databases. The compatibility feature set includes compatibility for PL/SQL, Oracle’s SQL syntax, and built in SQL functions. This means that many applications can be easily migrated over to EDB Postgres. It also allows you to continue using your existing Oracle skills.
For more information please contact us at [email protected]
This document summarizes updates to the EDB Postgres Platform for winter 2017, including:
- EDB Postgres Advanced Server 9.6 which adds features like Oracle-compatible advanced queuing and nested subprocedures to help migrate more applications from Oracle, manage larger datasets, and improve integration.
- Backup and Recovery 2.0 which enables faster backups using block-level incremental change capture.
- Replication Server 6.1 which adds support for Oracle 12c and SQL Server 2014, and allows parallel replication between multiple active nodes for improved performance.
1. pgAdmin es una aplicación gráfica para administrar bases de datos PostgreSQL y sus derivados. Incluye interfaces para consultas SQL, edición de código, administración de usuarios, y más.
2. Se puede instalar en varios sistemas operativos como Windows, Linux y macOS. Admite más de una docena de idiomas.
3. Ofrece funcionalidades como agregar y conectarse a servidores, crear y administrar bases de datos y tablas, editar y consultar datos, y generar copias de seguridad.
The document discusses strategies for optimizing queries by shaping the optimizer's search space. It recommends:
1. Maximizing data locality by using basic B-tree indexes rather than more complex options like partitions or clusters.
2. Writing queries to explicitly exploit indexes by using range conditions, ordering results to match the index order, and terminating scans after a specified number of rows.
3. Ordering columns in multi-column indexes to match the predicates in common queries, with equality conditions before range conditions.
View this presentation to gain insight into optimizing Postgres and savings for your data management. Visit EntepriseDB's > Resources > Webcasts to view the presentation by Jay Barrows, VP of Field Operations.
During this 45 -minute presentation, Jay Barrows, VP of Field Operations, will provide a business review of how, where and why businesses are leveraging PostgreSQL. In addition, he will go over the primary pains and business drivers shaping the data management landscape such as significant cost pressures combined with recent improvements to open source database options. Oracle migration is often considered the most powerful cost reduction opportunity if you understand the migration risks, and have a clear migration game plan.
Jay will discuss several use cases selected that highlight how enterprise customers are leveraging their findings from the adoption of other OSS products, to helping to bring Postgres to the extremely expensive and mission critical part of their IT stack - the DB. By doing so they are driving TCO down in very meaningful ways, sacrificing nothing in terms of performance, scalability, security or reliability. Many businesses are already leveraging OSS in much lower cost parts of IT stack (OS, middleware).
This presentation will be beneficial to decision-makers interested in enhancing their data management with PostgreSQL. I
Ashnik EnterpriseDB PostgreSQL - A real alternative to Oracle Ashnikbiz
A Technical introduction to PostgreSQL and Postgres Plus -
Enterprise Class PostgreSQL Database from EDB - You have a ‘Real’ alternative to Oracle and other conventional proprietary Databases
This document provides 10 reasons for using PostgreSQL, an open source database management system. The top three reasons are:
1. Open Source Community - PostgreSQL has a large, global community of developers, users, and advocates who are sensitive to internationalization issues.
2. License - PostgreSQL has a highly permissive license that allows it to be used freely for any purpose without restrictions.
3. Total Cost of Ownership - PostgreSQL has a low total cost of ownership due to it being open source and not requiring expensive proprietary software licenses.
10 Reasons to Start Your Analytics Project with PostgreSQLSatoshi Nagayasu
PostgreSQL provides several advantages for analytics projects:
1) It allows connecting to external data sources and performing analytics queries across different data stores using features like foreign data wrappers.
2) Features like materialized views, transactional DDLs, and rich SQL capabilities help build effective data warehouses and data marts for analytics.
3) Performance optimizations like table partitioning, BRIN indexes, and parallel queries enable PostgreSQL to handle large datasets and complex queries efficiently.
Optimizing Your Postgres ROI Through Best PracticesEDB
The document discusses best practices for optimizing Postgres ROI through EnterpriseDB expert guidance and services. It outlines services such as enterprise architecture reviews, remote DBA services, technical account management, training, and certification which are designed to help customers strategically plan their Postgres infrastructure according to industry best practices and avoid risks. Customer testimonials provide examples of how EDB services have helped customers improve availability, performance, and resolve issues.
This technical presentation shows you the best practices with EDB Postgres tools, that are designed to make database administration easier and more efficient:
● Tune a new database using Postgres Expert
● Set up streaming replication in EDB Postgres Enterprise Manager (PEM)
● Create a backup schedule in EDB Postgres Backup and Recovery
● Automatically failover with EDB Postgres Failover Manager
● Use SQL Profiler and Index Advisor to add indexes
The presentation also included a demonstration. To access the recording visit www.enterprisedb.com and access the webcast recordings section or email [email protected].
This presentation introduces the following functionalities of pgAdmin and PEM that make database management more efficient:
1. Examining the performance of a query using the explain plan visualizer in pgAdmin’s Query Tool
2. Examining the performance of a process or session consisting of multiple queries in PEM’s SQL Profiler
3. 24/7 monitoring of Postgres and the underlying host system
4. Capacity management and reporting
5. Alerting the DBA or System Administrator to potential problems
Why we love pgpool-II and why we hate it!PGConf APAC
Pgpool is middleware that works between PostgreSQL clients and servers to provide connection pooling, replication, and load balancing. The presenter's company deployed pgpool in various architectures including master-slave replication and load balancing configurations. They experienced some issues with pgpool like connection errors when using application pooling, lack of guaranteed connection reuse, and bugs. Tips are provided like ensuring synchronized server times and restricting health check users. Pgpool may not be best when automatic node rejoining is needed or during network instability.
10 things, an Oracle DBA should care about when moving to PostgreSQLPostgreSQL-Consulting
PostgreSQL can handle many of the same workloads as Oracle and provides alternatives to common Oracle features and practices. Some key differences for DBAs moving from Oracle to PostgreSQL include: using shared_buffers instead of SGA with a recommended 25-75% of RAM; using pgbouncer instead of a listener; performing backups with pg_basebackup and WAL archiving instead of RMAN; managing undo data in datafiles instead of undo segments; using streaming replication for high availability instead of RAC; and needing to tune autovacuum instead of manually managing redo and undo logs. PostgreSQL is very capable but may not be suited for some extremely high update workloads of 200K+ transactions per second on a single server
This document provides an overview and introduction to PostgreSQL for new users. It covers getting started with PostgreSQL, including installing it, configuring authentication and logging, upgrading to new versions, routine maintenance tasks, hardware recommendations, availability and scalability options, and query tuning and optimization. The document is presented as a slide deck with different sections labeled by letters (e.g. K-0, S-0, U-0).
The document provides an overview of PostgreSQL best practices from initial setup to an OLTP performance benchmark against Oracle. It discusses PostgreSQL architecture, installation options, securing the PostgreSQL cluster, main configuration parameters, backup and recovery strategies. It then details the results of an OLTP performance benchmark test between PostgreSQL and Oracle using the same hardware, workload, and configuration. The test found Oracle had slightly better performance with a shorter completion time and higher maximum transactions per minute compared to PostgreSQL.
The document provides an overview of PostgreSQL best practices, including installation, configuration, performance optimization, and security. It discusses setting up a PostgreSQL cluster, optimizing the operating system, installing PostgreSQL, securing the database with configuration files, tuning main PostgreSQL parameters, and performing backups and recovery. It also outlines an OLTP performance benchmark comparing PostgreSQL to Oracle configurations and results.
The document discusses various PostgreSQL database hosting options on Amazon Web Services (AWS). It describes services like EC2 that allow running a customized PostgreSQL database on the cloud. It provides tips for setting up PostgreSQL replication, scaling the database vertically and horizontally, backups, monitoring with CloudWatch, and reducing costs. Other AWS services mentioned include S3, EBS, Redshift and tools for managing PostgreSQL on AWS.
Managing your own PostgreSQL servers is sometimes a burden your business does not want. In this talk we will provide an overview of some of the public cloud offerings available for hosted PostgreSQL and discuss a number of strategies for migrating your databases with a minimum of downtime.
PostgreSQL High Availability in a Containerized WorldJignesh Shah
This document discusses PostgreSQL high availability in a containerized environment. It begins with an overview of containers and their advantages like lower footprint and density. It then covers enterprise needs for high availability like recovery time objectives. Common approaches to PostgreSQL high availability are discussed like replication, shared storage, and using projects like Patroni and Stolon. Modern trends with containers are highlighted like separating data and binaries. Kubernetes is presented as a production-grade orchestrator that can provide horizontal scaling and self-healing capabilities. The discussion concludes with challenges of multi-region deployments and how service discovery with Consul can help address those challenges.
En savoir plus sur www.opensourceschool.fr
Ce support est diffusé sous licence Creative Commons (CC BY-SA 3.0 FR) Attribution - Partage dans les Mêmes Conditions 3.0 France
Plan :
1. Introduction
2. Installation
3. The psql client
4. Authentication and privileges
5. Backup and restoration
6. Internal Architecture
7. Performance optimization
8. Stats and monitoring
9. Logs
10. Replication
This document outlines an advanced administration training course for PostgreSQL. The agenda covers topics such as installation, configuration, database management, security, backups and recovery, performance tuning, replication, and monitoring. It introduces PostgreSQL and its features, community support resources, architecture including processes, memory, and disk structures, and provides objectives for individual training modules.
PostgreSQL is an open-source object-relational database management system. It supports both relational and non-relational data types. PostgreSQL uses a client-server model, with backend server processes handling client queries. The database files are stored on disk and cached in shared memory for fast access. PostgreSQL uses write-ahead logging and multi-version concurrency control to provide crash recovery and data integrity. Queries are executed in multiple phases including parsing, planning, and execution.
This document provides an introduction and overview of PostgreSQL, an open-source object-relational database management system. It discusses that PostgreSQL supports modern SQL features, has free commercial and academic use, and offers performance comparable to other databases while being very reliable with stable code and robust testing. The architecture uses a client-server model to handle concurrent connections and transactions provide atomic, isolated, and durable operations. PostgreSQL also supports user-defined types, inheritance, and other advanced features.
Managing your own PostgreSQL servers is sometimes a burden your business does not want. In this talk we will provide an overview of some of the public cloud offerings available for hosted PostgreSQL and discuss a number of strategies for migrating your databases with a minimum of downtime.
SCALE 15x Minimizing PostgreSQL Major Version Upgrade DowntimeJeff Frost
This document provides instructions for minimizing downtime when performing a major version upgrade of PostgreSQL using logical replication with Slony. It discusses various methods for performing the upgrade, including dump/restore, pg_upgrade, and logical replication with Slony. It then provides a step-by-step guide to setting up logical replication between two PostgreSQL nodes using Slony, including initializing the cluster and nodes, creating replication sets, subscribing nodes, and monitoring the initial synchronization process. The document demonstrates how Slony allows performing a graceful switchover and switchback between nodes when upgrading PostgreSQL versions.
The document discusses the journey of a database administrator from Oracle to PostgreSQL. It provides an overview of the speaker's background and experience with Oracle and PostgreSQL. It then compares some key differences between Oracle and PostgreSQL in areas like licensing, architecture and how each handles transactions and compliance with ACID properties. The document also outlines some advantages of PostgreSQL like its extensibility and some disadvantages like lack of parallelism. Overall, the speaker acknowledges Oracle's more advanced features but prefers using the free and open source PostgreSQL, working around limitations.
Lessons PostgreSQL learned from commercial databases, and didn’tPGConf APAC
This is the ppt used by Illay for his presentation at pgDay Asia 2016 - "Lessons PostgreSQL learned from commercial
databases, and didn’t". The talk takes you through some of the really good things that PostgreSQL has done really well and somethings that PostgreSQL can learn from other databases
The document summarizes database servers and tools from EnterpriseDB. It describes EDB Postgres Advanced Server as offering security features like password policies and SQL injection protection as well as performance and productivity features. It then summarizes tools like Postgres Enterprise Manager for monitoring databases, the Backup and Recovery tool for backups, Failover Manager for high availability, and Replication Server for replication. The Migration Portal is described as helping to convert Oracle schemas and the Migration Toolkit helps migrate data between different database platforms.
This document provides an overview of Postgresql, including its history, capabilities, advantages over other databases, best practices, and references for further learning. Postgresql is an open source relational database management system that has been in development for over 30 years. It offers rich SQL support, high performance, ACID transactions, and extensive extensibility through features like JSON, XML, and programming languages.
apidays New York 2025 - Why I Built Another Carbon Measurement Tool for LLMs ...apidays
Why I Built Another Carbon Measurement Tool for LLMs (And What I Learned Along the Way)
Pascal Joly, Sustainability Consultant and Instructor at IT Climate Ed
apidays New York 2025
API Management for Surfing the Next Innovation Waves: GenAI and Open Banking
May 14 & 15, 2025
------
Check out our conferences at https://www.apidays.global/
Do you want to sponsor or talk at one of our conferences?
https://apidays.typeform.com/to/ILJeAaV8
Learn more on APIscene, the global media made by the community for the community:
https://www.apiscene.io
Explore the API ecosystem with the API Landscape:
https://apilandscape.apiscene.io/
apidays New York 2025 - Fast, Repeatable, Secure: Pick 3 with FINOS CCC by Le...apidays
Fast, Repeatable, Secure: Pick 3 with FINOS CCC
Leigh Capili, Kubernetes Contributor at Control Plane
apidays New York 2025
API Management for Surfing the Next Innovation Waves: GenAI and Open Banking
May 14 & 15, 2025
------
Check out our conferences at https://www.apidays.global/
Do you want to sponsor or talk at one of our conferences?
https://apidays.typeform.com/to/ILJeAaV8
Learn more on APIscene, the global media made by the community for the community:
https://www.apiscene.io
Explore the API ecosystem with the API Landscape:
https://apilandscape.apiscene.io/
apidays New York 2025 - CIAM in the wild by Michael Gruen (Layr)apidays
CIAM in the wild: What we learned while scaling from 1.5 to 3 million users
Michael Gruen, VP of Engineering at Layr
apidays New York 2025
API Management for Surfing the Next Innovation Waves: GenAI and Open Banking
Convene 360 Madison, New York
May 14 & 15, 2025
------
Check out our conferences at https://www.apidays.global/
Do you want to sponsor or talk at one of our conferences?
https://apidays.typeform.com/to/ILJeAaV8
Learn more on APIscene, the global media made by the community for the community:
https://www.apiscene.io
Explore the API ecosystem with the API Landscape:
https://apilandscape.apiscene.io/
apidays Singapore 2025 - What exactly are AI Agents by Aki Ranin (Earthshots ...apidays
What exactly are AI Agents?
Aki Ranin, Head of AI at Earthshots Collective | Deep Tech & AI Investor | 2x Founder | Published Author
apidays Singapore 2025
Where APIs Meet AI: Building Tomorrow's Intelligent Ecosystems
April 15 & 16, 2025
------
Check out our conferences at https://www.apidays.global/
Do you want to sponsor or talk at one of our conferences?
https://apidays.typeform.com/to/ILJeAaV8
Learn more on APIscene, the global media made by the community for the community:
https://www.apiscene.io
Explore the API ecosystem with the API Landscape:
https://apilandscape.apiscene.io/
apidays New York 2025 - Lessons From Two Technical Transformations by Leah Hu...apidays
You Can't Outrun Complexity - But You Can Orchestrate It: Lessons From Two Technical Transformations
Leah Hurwich Adler, Senior Staff Product Manager at Apollo GraphQL
apidays New York 2025
API Management for Surfing the Next Innovation Waves: GenAI and Open Banking
May 14 & 15, 2025
------
Check out our conferences at https://www.apidays.global/
Do you want to sponsor or talk at one of our conferences?
https://apidays.typeform.com/to/ILJeAaV8
Learn more on APIscene, the global media made by the community for the community:
https://www.apiscene.io
Explore the API ecosystem with the API Landscape:
https://apilandscape.apiscene.io/
apidays New York 2025 - Beyond Webhooks: The Future of Scalable API Event Del...apidays
Beyond Webhooks: The Future of Scalable API Event Delivery
Phil Leggetter, Head of Developer Experience at Hookdeck
apidays New York 2025
API Management for Surfing the Next Innovation Waves: GenAI and Open Banking
May 14 & 15, 2025
------
Check out our conferences at https://www.apidays.global/
Do you want to sponsor or talk at one of our conferences?
https://apidays.typeform.com/to/ILJeAaV8
Learn more on APIscene, the global media made by the community for the community:
https://www.apiscene.io
Explore the API ecosystem with the API Landscape:
https://apilandscape.apiscene.io/
What is FinOps as a Service and why is it Trending?Amnic
The way we build and scale companies today has changed forever because of cloud adoption. However, this flexibility introduces unpredictability, which often results in overspending, inefficiencies, and a lack of cost accountability.
FinOps as a Service is a modern approach to cloud cost management that combines powerful tooling with expert advisory to bring financial visibility, governance, and optimization into the cloud operating model, without slowing down the engineering team. FinOps empowers the engineering team, finance, and leadership/management as they make data-informed decisions about cost, together.
In this presentation, we will break down what FinOps is, why it matters more than ever, and a little about how a managed FinOps service can help organizations:
- Optimize cloud spend - without slowing down dev
- Create visibility into the cost per team, service, or feature
- Set financial guardrails while allowing autonomy in engineering
- Drive cultural alignment between finance, engineering, and product
This will guide and help whether you are a cloud-native startup or a scaling enterprise, and convert cloud cost into a strategic advantage.
apidays New York 2025 - Unifying OpenAPI & AsyncAPI by Naresh Jain & Hari Kri...apidays
Unifying OpenAPI & AsyncAPI: Designing JSON Schemas+Examples for Reuse
Naresh Jain, Co-founder & CEO at Specmatic
Hari Krishnan, Co-founder & CTO at Specmatic
apidays New York 2025
API Management for Surfing the Next Innovation Waves: GenAI and Open Banking
May 14 & 15, 2025
------
Check out our conferences at https://www.apidays.global/
Do you want to sponsor or talk at one of our conferences?
https://apidays.typeform.com/to/ILJeAaV8
Learn more on APIscene, the global media made by the community for the community:
https://www.apiscene.io
Explore the API ecosystem with the API Landscape:
https://apilandscape.apiscene.io/
apidays New York 2025 - Boost API Development Velocity with Practical AI Tool...apidays
Boost API Development Velocity with Practical AI Tooling
Sumit Amar, VP of Engineering at WEX
apidays New York 2025
API Management for Surfing the Next Innovation Waves: GenAI and Open Banking
May 14 & 15, 2025
------
Check out our conferences at https://www.apidays.global/
Do you want to sponsor or talk at one of our conferences?
https://apidays.typeform.com/to/ILJeAaV8
Learn more on APIscene, the global media made by the community for the community:
https://www.apiscene.io
Explore the API ecosystem with the API Landscape:
https://apilandscape.apiscene.io/
apidays New York 2025 - Spring Modulith Design for Microservices by Renjith R...apidays
Spring Modulith Design for Microservices
Renjith Ramachandran, Senior Solutions Architect at BJS Wholesale Club
apidays New York 2025
API Management for Surfing the Next Innovation Waves: GenAI and Open Banking
Convene 360 Madison, New York
May 14 & 15, 2025
------
Check out our conferences at https://www.apidays.global/
Do you want to sponsor or talk at one of our conferences?
https://apidays.typeform.com/to/ILJeAaV8
Learn more on APIscene, the global media made by the community for the community:
https://www.apiscene.io
Explore the API ecosystem with the API Landscape:
https://apilandscape.apiscene.io/
apidays Singapore 2025 - 4 Identity Essentials for Scaling SaaS in Large Orgs...apidays
4 identity factors you didn't know you needed to support large organizations in your SaaS
Daizen Ikehara, Principal Developer Advocate at Auth0
apidays Singapore 2025
Where APIs Meet AI: Building Tomorrow's Intelligent Ecosystems
April 15 & 16, 2025
------
Check out our conferences at https://www.apidays.global/
Do you want to sponsor or talk at one of our conferences?
https://apidays.typeform.com/to/ILJeAaV8
Learn more on APIscene, the global media made by the community for the community:
https://www.apiscene.io
Explore the API ecosystem with the API Landscape:
https://apilandscape.apiscene.io/
apidays New York 2025 - Using GraphQL SDL files as executable API Contracts b...apidays
Using GraphQL SDL files as executable API Contracts
Hari Krishnan, Co-founder & CTO at Specmatic
apidays New York 2025
API Management for Surfing the Next Innovation Waves: GenAI and Open Banking
May 14 & 15, 2025
------
Check out our conferences at https://www.apidays.global/
Do you want to sponsor or talk at one of our conferences?
https://apidays.typeform.com/to/ILJeAaV8
Learn more on APIscene, the global media made by the community for the community:
https://www.apiscene.io
Explore the API ecosystem with the API Landscape:
https://apilandscape.apiscene.io/
apidays Singapore 2025 - Enhancing Developer Productivity with UX (Government...apidays
Enhancing Developer Productivity with UX
Petrine Tang, UX Designer at Government Technology Agency
Faith Ang, Product Manager at Government Technology Agency
apidays Singapore 2025
Where APIs Meet AI: Building Tomorrow's Intelligent Ecosystems
April 15 & 16, 2025
------
Check out our conferences at https://www.apidays.global/
Do you want to sponsor or talk at one of our conferences?
https://apidays.typeform.com/to/ILJeAaV8
Learn more on APIscene, the global media made by the community for the community:
https://www.apiscene.io
Explore the API ecosystem with the API Landscape:
https://apilandscape.apiscene.io/
apidays New York 2025 - The Future of Small Business Lending with Open Bankin...apidays
The Future of Small Business Lending with Open Banking – Bridging the $750 Billion Funding Gap
Charles Groome, Vice President of Growth Strategy at Biz2Credit
apidays New York 2025
API Management for Surfing the Next Innovation Waves: GenAI and Open Banking
May 14 & 15, 2025
------
Check out our conferences at https://www.apidays.global/
Do you want to sponsor or talk at one of our conferences?
https://apidays.typeform.com/to/ILJeAaV8
Learn more on APIscene, the global media made by the community for the community:
https://www.apiscene.io
Explore the API ecosystem with the API Landscape:
https://apilandscape.apiscene.io/
apidays New York 2025 - The FINOS Common Domain Model for Capital Markets by ...apidays
The FINOS Common Domain Model for Capital Markets
Tom Healey, Founder & Director at FINXIS LLC
Daniel Schwartz, Managing Partner at FT Advisory LLC
apidays New York 2025
API Management for Surfing the Next Innovation Waves: GenAI and Open Banking
May 14 & 15, 2025
------
Check out our conferences at https://www.apidays.global/
Do you want to sponsor or talk at one of our conferences?
https://apidays.typeform.com/to/ILJeAaV8
Learn more on APIscene, the global media made by the community for the community:
https://www.apiscene.io
Explore the API ecosystem with the API Landscape:
https://apilandscape.apiscene.io/
SAP Extended Warehouse Management (EWM) is a part of SAP S/4HANA offering advanced warehouse and logistics capabilities. It enables efficient handling of goods movement, storage, and inventory in real-time.
apidays New York 2025 - Breaking Barriers: Lessons Learned from API Integrati...apidays
Breaking Barriers: Lessons Learned from API Integration with Large Hotel Chains and the Role of Standardization
Constantine Nikolaou, Manager Business Solutions Architect at Booking.com
apidays New York 2025
API Management for Surfing the Next Innovation Waves: GenAI and Open Banking
May 14 & 15, 2025
------
Check out our conferences at https://www.apidays.global/
Do you want to sponsor or talk at one of our conferences?
https://apidays.typeform.com/to/ILJeAaV8
Learn more on APIscene, the global media made by the community for the community:
https://www.apiscene.io
Explore the API ecosystem with the API Landscape:
https://apilandscape.apiscene.io/
apidays New York 2025 - Breaking Barriers: Lessons Learned from API Integrati...apidays
Oracle to Postgres Migration - part 2
1. Workshop
Oracle to Postgres Migration
Part 2 - Running Postgres
2016-06-22 @IDM
Chris Mair
http://www.pgtraining.com
2. 2016-06-22OracletoPostgresMigration-part2
The Workshop
very quick walk through for Postgres-DBAs to-be
• installation, getting support, the configuration
files, psql, understanding transactions, the
query-planner and locking, backups, system
tables, streaming replication, hot standbys,
connection pooling, load balancing and even
automatic failover all with life-demos and
condensed into just three hours - will we finish
on time?
3. 2016-06-22OracletoPostgresMigration-part2
Getting Support
• very good community support through mailing
lists: psql.it list / Italian and official list (English)
and many others
• commercial support - in Italy for example from us
at PGtraining (three free lancers) or 2ndQuadrant
(SRL), in Austria from Cypertec (GmbH) et al
• don't forget managed hosting offerings from
Amazon Web Services (PostgreSQL RDS),
Heroku and others
4. 2016-06-22OracletoPostgresMigration-part2
Installing Postgres
• from your distro (note that the second digit is the
major version 9.0 and 9.5 are five years apart
and some distros carry outdated versions)
• from the official repos at www.postgresql.org/
download/ - all major package formats supported
• from source (it is easier than you think:
everything can be compiled in a minute or two)
5. 2016-06-22OracletoPostgresMigration-part2
From Source, You Say?
• yeah, why not?
# Centos 7
yum -y install wget
yum -y install gcc make zlib zlib-devel libxml2 libxml2-devel
readline readline-devel openssl openssl-libs openssl-devel
useradd -m -s /bin/bash pg95
chmod 755 /home/pg95
su - pg95 -c 'wget https://ftp.postgresql.org/pub/source/v9.5.3/postgresql-9.5.3.tar.gz'
su - pg95 -c 'tar xf postgresql-9.5.3.tar.gz'
su - pg95 -c 'cd postgresql-9.5.3; ./configure --prefix=/home/pg95 --with-libxml
--with-openssl'
su - pg95 -c 'cd postgresql-9.5.3; make -j 2 && make install'
7. 2016-06-22OracletoPostgresMigration-part2
Configuration
• use initdb to create the "cluster" (as in "instance
of postgres serving a set of databases", not as in
a set of machines)
• configuration is in $PGDATA/postgresql.conf
(at the very least check out listen_addresses,
max_connections, shared_buffers and
work_mem)
• ACLs are in $PGDATA/pg_hba.conf
su - pg95 -c 'bin/initdb -D data'
# instance is fully contained in PGDATA=/home/pg95/data now
8. 2016-06-22OracletoPostgresMigration-part2
Starting and Connecting
• pg_ctl is your friend (put this line in /etc/rc.local
and make it executable):
• psql is the universal client:
su - pg95 -c 'bin/pg_ctl -D data -l log start'
[root@p0-primary ~]# su - pg95
Last login: Wed Jun 22 08:47:36 UTC 2016 on pts/0
[pg95@p0-primary ~]$ bin/psql postgres
psql (9.5.3)
Type "help" for help.
postgres=# q
[pg95@p0-primary ~]$
9. 2016-06-22OracletoPostgresMigration-part2
Psql Sample Session
[root@p0-primary ~]# su - pg95
Last login: Wed Jun 22 08:47:36 UTC 2016 on pts/0
[pg95@p0-primary ~]$ bin/psql postgres
psql (9.5.3)
Type "help" for help.
postgres=# l
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
-----------+-------+----------+-------------+-------------+-------------------
postgres | pg95 | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
template0 | pg95 | UTF8 | en_US.UTF-8 | en_US.UTF-8 | [...]
template1 | pg95 | UTF8 | en_US.UTF-8 | en_US.UTF-8 | [...]
(3 rows)
postgres=# dn
List of schemas
Name | Owner
--------+-------
public | pg95
(1 row)
postgres=# d
List of relations
Schema | Name | Type | Owner
--------+------------+----------+-------
public | tab | table | pg95
public | tab_id_seq | sequence | pg95
(2 rows)
databases
schemas
tables et.al ?
10. 2016-06-22OracletoPostgresMigration-part2
One Elephant at Work -
understanding transactions
• let's generate a file with single inserts:
• and load it into the database:
• experiments - what happens if:
• you add a begin/commit around the inserts?
• you create an unlogged table?
• you set synchronous_commit to off?
for (( i=0; i < 50000; i++ )) do
echo insert into big values ( $RANDOM ) ;
done
psql postgres -c "drop table big; create table big (x int);"
time psql postgres --quiet < inserts.sql
} outcome will
pretty much depend
on disk type...
11. 2016-06-22OracletoPostgresMigration-part2
One Elephant at Work -
understanding the planner
• let's generate a large table with an index:
• and look at the plans for queries such as:
• experiment - what happens if:
• you switch off auto-analyze (parameter autovacuum
= off in postgresql.conf), restart the server, drop and
recreate the table and repeat the experiment?
select random() as x into big from generate_series(1, 1000000);
create index ix on big(x);
explain select count(*) from big where x < 0.00001;
12. 2016-06-22OracletoPostgresMigration-part2
One Elephant at Work -
understanding MVCC and locking
• thanks to MVCC, "normal" operations such as update/delete/insert
do not need to lock a table, you can do a:
in one session while the table is fully usable on another session.
only if you try to update/delete THE SAME row, will the second
session be blocked.
• there are, however, operations that need locks on whole tables,
typically I've seen:
• truncate
• DDL statements such as ALTER TABLE
• I've seen situations were postgres instances were very "laggy", while
the system load was low due to lock contention
begin;
update person set name = 'Chris' where id = 1;
-- wait
13. 2016-06-22OracletoPostgresMigration-part2
Useful System Tables
• pg_stat_activity - list of sessions and what they're doing:
select pid, usename, state, query from pg_stat_activity;
• pg_locks (beware for example of AccessExclusiveLock locks on
user tables):
select locktype, database, relation, (select relname from pg_class where
oid = relation), pid, mode from pg_locks;
• pg_stat_all_tables - to check among other things auto-analyze is
good:
select relname, last_analyze, last_autoanalyze from pg_stat_user_tables;
• and many more
14. 2016-06-22OracletoPostgresMigration-part2
Backups
• cold backups - just shut the server down and archive the
$PGDATA directory
• online backups - pg_dump or pg_dumpall:
• pg_dump is per database (or table) with options, for example
binary output
• pg_dumpall is needed to backup the cluster-wide info such
as users
• psql and possibly pg_restore (to read the binary format) are
needed to restore the DBs
• demo as time permits
16. 2016-06-22OracletoPostgresMigration-part2
More Than One Elephant
• the other meaning of the word "cluster" is somewhat vague - here are some
Postgres features that I currently like to use:
• streaming replication: stream database operations to other nodes in real time
(optionally as 2-safe replication - i.e. at least one slave must have ack’ed a
transaction), this can be cascading too
• hot standby: issue queries on any secondary node (this includes doing online
backups on a secondary to save load from the primary)
• instant failover: promote a hot standby node to primary node instantly with a
single operation for high availability setups
• third party software allows much more, including master-master setups
• recent developments have much enhanced the streaming capabilities, for
example pglogical and BDR - eventually these will be merged into Postgres
(see for example my presentation on BDR)
18. 2016-06-22OracletoPostgresMigration-part2
Setting up Streaming
Replication with a Hot Standby
• 5 minutes instruction by Cybertec
• our setup scripted for reference:
PRIMARY_IP=10.0.1.123
SECONDARY_IP=10.0.1.124
# primary setup
su - pg95 -c 'bin/initdb -D data'
sed -i "s/#listen_addresses = 'localhost'/listen_addresses = '*'/" /home/pg95/data/postgresql.conf
sed -i "s/#wal_level = minimal/wal_level = hot_standby/" /home/pg95/data/postgresql.conf
sed -i "s/#max_wal_senders = 0/max_wal_senders = 3/" /home/pg95/data/postgresql.conf
sed -i "s/#wal_keep_segments = 0/wal_keep_segments = 1024/" /home/pg95/data/postgresql.conf
sed -i "s/#hot_standby = off/hot_standby = on/" /home/pg95/data/postgresql.conf
echo "host replication all $SECONDARY_IP/32 trust" >> /home/pg95/data/pg_hba.conf
su - pg95 -c 'bin/pg_ctl -D data -l log start'
# note: use ssl and don't use trust auth in production, also have a look at the feature "replication slots"
# and if you're doing online backups on the standby see 25.5.2. Handling Query Conflicts in the manual
# secondary setup
su - pg95 -c 'mkdir data && chmod 700 data'
su - pg95 -c "bin/pg_basebackup -h $PRIMARY_IP -D /home/pg95/data --xlog-method=stream"
su - pg95 -c "echo 'standby_mode = on' > data/recovery.conf"
su - pg95 -c "echo "primary_conninfo = 'host=$PRIMARY_IP'" >> data/recovery.conf"
su - pg95 -c "echo "trigger_file = '/tmp/promoteme'" >> data/recovery.conf"
20. 2016-06-22OracletoPostgresMigration-part2
L'Appetito vien mangiando
• from the point of view of the application:
• hey, a connection pool would be handy!
• mmm.... in case of failover to the standby, how
am I notified that I need to change my JDBC
URL?
• come to think of it, it would be cool to off-load
read-only queries to the secondary server(s),
but I don't want to handle that logic by myself...
21. 2016-06-22OracletoPostgresMigration-part2
Enter pgpool-II
• pgpool-II is a middleware that does exactly this:
• it hides Postgres servers behind one port 5432
• it does connection pooling
• it does load balancing with the ability to pre-parse queries and send read-only
once to the standbys
• and much more:
• it can do replication by sending the same queries to multiple servers (this is
master-master replication even, but it is less efficient and more fragile than doing
it with streaming replication)
• it has a built-in watchdog for high availability setups with two pgool-II servers and
virtual IPs
• etc.
24. 2016-06-22OracletoPostgresMigration-part2
Experiments
• demo what we have on p2, enable query logging
on p0 and p1 to see the load balancing in action,
see what happens if p0 or p1 goes down!
• our setup for reference:
# note: make a db user nobdody for the monitoring and make a pg_hba.conf entry on p0 and 01 too...
useradd -m -s /bin/bash pgpool
su - pgpool -c 'wget -O pgpool-II-3.5.3.tar.gz http://www.pgpool.net/download.php?f=pgpool-II-3.5.3.tar.gz'
su - pgpool -c 'tar xf pgpool-II-3.5.3.tar.gz'
su - pgpool -c 'cd pgpool-II-3.5.3; ./configure --prefix=/home/pgpool --with-openssl --with-pgsql=/home/pg95'
su - pgpool -c 'cd pgpool-II-3.5.3; make -j 2 && make install'
su - pgpool -c 'cp etc/pgpool.conf.sample-stream etc/pgpool.conf'
su - pgpool -c 'cp etc/pool_hba.conf.sample etc/pool_hba.conf'
su - pgpool -c 'cp etc/pcp.conf.sample etc/pcp.conf'
sed -i "s/^backend_/#backend_/" /home/pgpool/etc/pgpool.conf
sed -i "s/^pid_file_name = '/var/run/pgpool/pgpool.pid'/pid_file_name = '/home/pgpool/pgpool.pid'/" /home/pgpool/etc/pgpool.conf
sed -i "s/^logdir = '/tmp'/logdir = '/home/pgpool'/" /home/pgpool/etc/pgpool.conf
sed -i "s/^health_check_period = 0/health_check_period = 1/" /home/pgpool/etc/pgpool.conf
echo "backend_hostname0 = '$PRIMARY_IP'" >> /home/pgpool/etc/pgpool.conf
echo "backend_port0 = 5432" >> /home/pgpool/etc/pgpool.conf
echo "backend_weight0 = 1" >> /home/pgpool/etc/pgpool.conf
echo "backend_hostname1 = '$SECONDARY_IP'" >> /home/pgpool/etc/pgpool.conf
echo "backend_port1 = 5432" >> /home/pgpool/etc/pgpool.conf
echo "backend_weight1 = 1" >> /home/pgpool/etc/pgpool.conf
echo "pgpool:d41d8cd98f00b204e9800998ecf8427e" >> /home/pgpool/etc/pcp.conf # empty password
su - pgpool -c 'nohup pgpool -n 2> log &'
25. 2016-06-22OracletoPostgresMigration-part2
Failover
• one of the cool features of pgpool-II is that
events from nodes attaching/detaching can be
scripted
• demo (if time permits) how to instruct pgpool-II to
connect to the standby over SSH and touch the
trigger file to trigger a promotion to primary
• however, always be aware that automatic failover
can be tricky (test well!)
26. 2016-06-22OracletoPostgresMigration-part2
A Simpler Pool
• if you don't need load balancing and automatic
failover, I recommend PgBouncer
• PgBouncer is "only" a connection pool, but it
does that job really well
• you can also combine pgpool-II and PgBouncer