SlideShare a Scribd company logo
Workshop
Oracle to Postgres Migration
Part 2 - Running Postgres
2016-06-22 @IDM
Chris Mair
http://www.pgtraining.com
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?
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
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)
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'
2016-06-22OracletoPostgresMigration-part2
Sample Setup (v.1)
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
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 ~]$
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 ?
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...
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;
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
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
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
2016-06-22OracletoPostgresMigration-part2
No More Elephants
• Have a look at Josh Berkus' 7 ways to crash Postgres:
• no updates
• out of disk space
• deleting stuff
• out of RAM
• bad hardware
• too many connections
• zombie locks
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)
2016-06-22OracletoPostgresMigration-part2
We've Been Doing it the
Whole Time ;)
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"
2016-06-22OracletoPostgresMigration-part2
Streaming Experiments
• screenshot from another demo (with machines
africa and asia):
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...
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.
2016-06-22OracletoPostgresMigration-part2
pgpool-II
• here is a pgpool-II presentation from the author of the software - this is
what we want to do (from the linked presentation):
2016-06-22OracletoPostgresMigration-part2
The pool is ready!
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 &'
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!)
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
2016-06-22OracletoPostgresMigration-part2
'k thx bye ;)

More Related Content

What's hot (20)

Relational RDBMS : MySQL, PostgreSQL and SQL SERVER
Relational RDBMS  : MySQL, PostgreSQL and SQL SERVERRelational RDBMS  : MySQL, PostgreSQL and SQL SERVER
Relational RDBMS : MySQL, PostgreSQL and SQL SERVER
Dalila Chouaya
 
The Proxy Wars - MySQL Router, ProxySQL, MariaDB MaxScale
The Proxy Wars - MySQL Router, ProxySQL, MariaDB MaxScaleThe Proxy Wars - MySQL Router, ProxySQL, MariaDB MaxScale
The Proxy Wars - MySQL Router, ProxySQL, MariaDB MaxScale
Colin Charles
 
Migrating from Oracle to Postgres
Migrating from Oracle to PostgresMigrating from Oracle to Postgres
Migrating from Oracle to Postgres
EDB
 
Oracle Performance Tools of the Trade
Oracle Performance Tools of the TradeOracle Performance Tools of the Trade
Oracle Performance Tools of the Trade
Carlos Sierra
 
NOSQL vs SQL
NOSQL vs SQLNOSQL vs SQL
NOSQL vs SQL
Mohammed Fazuluddin
 
Big Query Basics
Big Query BasicsBig Query Basics
Big Query Basics
Ido Green
 
Introduction to Azure Databricks
Introduction to Azure DatabricksIntroduction to Azure Databricks
Introduction to Azure Databricks
James Serra
 
Databricks Fundamentals
Databricks FundamentalsDatabricks Fundamentals
Databricks Fundamentals
Dalibor Wijas
 
MySQL Advanced Administrator 2021 - 네오클로바
MySQL Advanced Administrator 2021 - 네오클로바MySQL Advanced Administrator 2021 - 네오클로바
MySQL Advanced Administrator 2021 - 네오클로바
NeoClova
 
MySQL_SQL_Tunning_v0.1.3.docx
MySQL_SQL_Tunning_v0.1.3.docxMySQL_SQL_Tunning_v0.1.3.docx
MySQL_SQL_Tunning_v0.1.3.docx
NeoClova
 
Oracle Real Application Clusters 19c- Best Practices and Internals- EMEA Tour...
Oracle Real Application Clusters 19c- Best Practices and Internals- EMEA Tour...Oracle Real Application Clusters 19c- Best Practices and Internals- EMEA Tour...
Oracle Real Application Clusters 19c- Best Practices and Internals- EMEA Tour...
Sandesh Rao
 
BigQuery implementation
BigQuery implementationBigQuery implementation
BigQuery implementation
Simon Su
 
Building an open data platform with apache iceberg
Building an open data platform with apache icebergBuilding an open data platform with apache iceberg
Building an open data platform with apache iceberg
Alluxio, Inc.
 
Presto: Fast SQL-on-Anything (including Delta Lake, Snowflake, Elasticsearch ...
Presto: Fast SQL-on-Anything (including Delta Lake, Snowflake, Elasticsearch ...Presto: Fast SQL-on-Anything (including Delta Lake, Snowflake, Elasticsearch ...
Presto: Fast SQL-on-Anything (including Delta Lake, Snowflake, Elasticsearch ...
Databricks
 
Sql vs NoSQL-Presentation
 Sql vs NoSQL-Presentation Sql vs NoSQL-Presentation
Sql vs NoSQL-Presentation
Shubham Tomar
 
MySQL8.0_performance_schema.pptx
MySQL8.0_performance_schema.pptxMySQL8.0_performance_schema.pptx
MySQL8.0_performance_schema.pptx
NeoClova
 
Azure storage
Azure storageAzure storage
Azure storage
Raju Kumar
 
AlwaysON Basics
AlwaysON BasicsAlwaysON Basics
AlwaysON Basics
Harsh Chawla
 
The Full MySQL and MariaDB Parallel Replication Tutorial
The Full MySQL and MariaDB Parallel Replication TutorialThe Full MySQL and MariaDB Parallel Replication Tutorial
The Full MySQL and MariaDB Parallel Replication Tutorial
Jean-François Gagné
 
PostgreSQL for Oracle Developers and DBA's
PostgreSQL for Oracle Developers and DBA'sPostgreSQL for Oracle Developers and DBA's
PostgreSQL for Oracle Developers and DBA's
Gerger
 
Relational RDBMS : MySQL, PostgreSQL and SQL SERVER
Relational RDBMS  : MySQL, PostgreSQL and SQL SERVERRelational RDBMS  : MySQL, PostgreSQL and SQL SERVER
Relational RDBMS : MySQL, PostgreSQL and SQL SERVER
Dalila Chouaya
 
The Proxy Wars - MySQL Router, ProxySQL, MariaDB MaxScale
The Proxy Wars - MySQL Router, ProxySQL, MariaDB MaxScaleThe Proxy Wars - MySQL Router, ProxySQL, MariaDB MaxScale
The Proxy Wars - MySQL Router, ProxySQL, MariaDB MaxScale
Colin Charles
 
Migrating from Oracle to Postgres
Migrating from Oracle to PostgresMigrating from Oracle to Postgres
Migrating from Oracle to Postgres
EDB
 
Oracle Performance Tools of the Trade
Oracle Performance Tools of the TradeOracle Performance Tools of the Trade
Oracle Performance Tools of the Trade
Carlos Sierra
 
Big Query Basics
Big Query BasicsBig Query Basics
Big Query Basics
Ido Green
 
Introduction to Azure Databricks
Introduction to Azure DatabricksIntroduction to Azure Databricks
Introduction to Azure Databricks
James Serra
 
Databricks Fundamentals
Databricks FundamentalsDatabricks Fundamentals
Databricks Fundamentals
Dalibor Wijas
 
MySQL Advanced Administrator 2021 - 네오클로바
MySQL Advanced Administrator 2021 - 네오클로바MySQL Advanced Administrator 2021 - 네오클로바
MySQL Advanced Administrator 2021 - 네오클로바
NeoClova
 
MySQL_SQL_Tunning_v0.1.3.docx
MySQL_SQL_Tunning_v0.1.3.docxMySQL_SQL_Tunning_v0.1.3.docx
MySQL_SQL_Tunning_v0.1.3.docx
NeoClova
 
Oracle Real Application Clusters 19c- Best Practices and Internals- EMEA Tour...
Oracle Real Application Clusters 19c- Best Practices and Internals- EMEA Tour...Oracle Real Application Clusters 19c- Best Practices and Internals- EMEA Tour...
Oracle Real Application Clusters 19c- Best Practices and Internals- EMEA Tour...
Sandesh Rao
 
BigQuery implementation
BigQuery implementationBigQuery implementation
BigQuery implementation
Simon Su
 
Building an open data platform with apache iceberg
Building an open data platform with apache icebergBuilding an open data platform with apache iceberg
Building an open data platform with apache iceberg
Alluxio, Inc.
 
Presto: Fast SQL-on-Anything (including Delta Lake, Snowflake, Elasticsearch ...
Presto: Fast SQL-on-Anything (including Delta Lake, Snowflake, Elasticsearch ...Presto: Fast SQL-on-Anything (including Delta Lake, Snowflake, Elasticsearch ...
Presto: Fast SQL-on-Anything (including Delta Lake, Snowflake, Elasticsearch ...
Databricks
 
Sql vs NoSQL-Presentation
 Sql vs NoSQL-Presentation Sql vs NoSQL-Presentation
Sql vs NoSQL-Presentation
Shubham Tomar
 
MySQL8.0_performance_schema.pptx
MySQL8.0_performance_schema.pptxMySQL8.0_performance_schema.pptx
MySQL8.0_performance_schema.pptx
NeoClova
 
The Full MySQL and MariaDB Parallel Replication Tutorial
The Full MySQL and MariaDB Parallel Replication TutorialThe Full MySQL and MariaDB Parallel Replication Tutorial
The Full MySQL and MariaDB Parallel Replication Tutorial
Jean-François Gagné
 
PostgreSQL for Oracle Developers and DBA's
PostgreSQL for Oracle Developers and DBA'sPostgreSQL for Oracle Developers and DBA's
PostgreSQL for Oracle Developers and DBA's
Gerger
 

Viewers also liked (15)

Agile Oracle to PostgreSQL migrations (PGConf.EU 2013)
Agile Oracle to PostgreSQL migrations (PGConf.EU 2013)Agile Oracle to PostgreSQL migrations (PGConf.EU 2013)
Agile Oracle to PostgreSQL migrations (PGConf.EU 2013)
Gabriele Bartolini
 
Key Methodologies for Migrating from Oracle to Postgres
Key Methodologies for Migrating from Oracle to PostgresKey Methodologies for Migrating from Oracle to Postgres
Key Methodologies for Migrating from Oracle to Postgres
EDB
 
Love Your Database (ESC 2k16)
Love Your Database (ESC 2k16)Love Your Database (ESC 2k16)
Love Your Database (ESC 2k16)
PgTraining
 
Product Update: EDB Postgres Platform 2017
Product Update: EDB Postgres Platform 2017Product Update: EDB Postgres Platform 2017
Product Update: EDB Postgres Platform 2017
EDB
 
PGADMIN, Aplicaciones
PGADMIN, AplicacionesPGADMIN, Aplicaciones
PGADMIN, Aplicaciones
IsabelAlisson
 
Shaping Optimizer's Search Space
Shaping Optimizer's Search SpaceShaping Optimizer's Search Space
Shaping Optimizer's Search Space
Gerger
 
Reducing Database Pain & Costs with Postgres
Reducing Database Pain & Costs with PostgresReducing Database Pain & Costs with Postgres
Reducing Database Pain & Costs with Postgres
EDB
 
Ashnik EnterpriseDB PostgreSQL - A real alternative to Oracle
Ashnik EnterpriseDB PostgreSQL - A real alternative to Oracle Ashnik EnterpriseDB PostgreSQL - A real alternative to Oracle
Ashnik EnterpriseDB PostgreSQL - A real alternative to Oracle
Ashnikbiz
 
Why use PostgreSQL?
Why use PostgreSQL?Why use PostgreSQL?
Why use PostgreSQL?
Gabriele Bartolini
 
10 Reasons to Start Your Analytics Project with PostgreSQL
10 Reasons to Start Your Analytics Project with PostgreSQL10 Reasons to Start Your Analytics Project with PostgreSQL
10 Reasons to Start Your Analytics Project with PostgreSQL
Satoshi Nagayasu
 
Optimizing Your Postgres ROI Through Best Practices
Optimizing Your Postgres ROI Through Best PracticesOptimizing Your Postgres ROI Through Best Practices
Optimizing Your Postgres ROI Through Best Practices
EDB
 
EDB Postgres DBA Best Practices
EDB Postgres DBA Best PracticesEDB Postgres DBA Best Practices
EDB Postgres DBA Best Practices
EDB
 
5 Postgres DBA Tips
5 Postgres DBA Tips5 Postgres DBA Tips
5 Postgres DBA Tips
EDB
 
Why we love pgpool-II and why we hate it!
Why we love pgpool-II and why we hate it!Why we love pgpool-II and why we hate it!
Why we love pgpool-II and why we hate it!
PGConf APAC
 
In-Database Analyticsの必要性と可能性
In-Database Analyticsの必要性と可能性In-Database Analyticsの必要性と可能性
In-Database Analyticsの必要性と可能性
Satoshi Nagayasu
 
Agile Oracle to PostgreSQL migrations (PGConf.EU 2013)
Agile Oracle to PostgreSQL migrations (PGConf.EU 2013)Agile Oracle to PostgreSQL migrations (PGConf.EU 2013)
Agile Oracle to PostgreSQL migrations (PGConf.EU 2013)
Gabriele Bartolini
 
Key Methodologies for Migrating from Oracle to Postgres
Key Methodologies for Migrating from Oracle to PostgresKey Methodologies for Migrating from Oracle to Postgres
Key Methodologies for Migrating from Oracle to Postgres
EDB
 
Love Your Database (ESC 2k16)
Love Your Database (ESC 2k16)Love Your Database (ESC 2k16)
Love Your Database (ESC 2k16)
PgTraining
 
Product Update: EDB Postgres Platform 2017
Product Update: EDB Postgres Platform 2017Product Update: EDB Postgres Platform 2017
Product Update: EDB Postgres Platform 2017
EDB
 
PGADMIN, Aplicaciones
PGADMIN, AplicacionesPGADMIN, Aplicaciones
PGADMIN, Aplicaciones
IsabelAlisson
 
Shaping Optimizer's Search Space
Shaping Optimizer's Search SpaceShaping Optimizer's Search Space
Shaping Optimizer's Search Space
Gerger
 
Reducing Database Pain & Costs with Postgres
Reducing Database Pain & Costs with PostgresReducing Database Pain & Costs with Postgres
Reducing Database Pain & Costs with Postgres
EDB
 
Ashnik EnterpriseDB PostgreSQL - A real alternative to Oracle
Ashnik EnterpriseDB PostgreSQL - A real alternative to Oracle Ashnik EnterpriseDB PostgreSQL - A real alternative to Oracle
Ashnik EnterpriseDB PostgreSQL - A real alternative to Oracle
Ashnikbiz
 
10 Reasons to Start Your Analytics Project with PostgreSQL
10 Reasons to Start Your Analytics Project with PostgreSQL10 Reasons to Start Your Analytics Project with PostgreSQL
10 Reasons to Start Your Analytics Project with PostgreSQL
Satoshi Nagayasu
 
Optimizing Your Postgres ROI Through Best Practices
Optimizing Your Postgres ROI Through Best PracticesOptimizing Your Postgres ROI Through Best Practices
Optimizing Your Postgres ROI Through Best Practices
EDB
 
EDB Postgres DBA Best Practices
EDB Postgres DBA Best PracticesEDB Postgres DBA Best Practices
EDB Postgres DBA Best Practices
EDB
 
5 Postgres DBA Tips
5 Postgres DBA Tips5 Postgres DBA Tips
5 Postgres DBA Tips
EDB
 
Why we love pgpool-II and why we hate it!
Why we love pgpool-II and why we hate it!Why we love pgpool-II and why we hate it!
Why we love pgpool-II and why we hate it!
PGConf APAC
 
In-Database Analyticsの必要性と可能性
In-Database Analyticsの必要性と可能性In-Database Analyticsの必要性と可能性
In-Database Analyticsの必要性と可能性
Satoshi Nagayasu
 
Ad

Similar to Oracle to Postgres Migration - part 2 (20)

10 things, an Oracle DBA should care about when moving to PostgreSQL
10 things, an Oracle DBA should care about when moving to PostgreSQL10 things, an Oracle DBA should care about when moving to PostgreSQL
10 things, an Oracle DBA should care about when moving to PostgreSQL
PostgreSQL-Consulting
 
Trivadis TechEvent 2017 PostgreSQL für die (Orakel) DBA by Ludovico Caldara
Trivadis TechEvent 2017 PostgreSQL für die (Orakel) DBA by Ludovico CaldaraTrivadis TechEvent 2017 PostgreSQL für die (Orakel) DBA by Ludovico Caldara
Trivadis TechEvent 2017 PostgreSQL für die (Orakel) DBA by Ludovico Caldara
Trivadis
 
Pro PostgreSQL, OSCon 2008
Pro PostgreSQL, OSCon 2008Pro PostgreSQL, OSCon 2008
Pro PostgreSQL, OSCon 2008
Robert Treat
 
Postgre sql best_practices
Postgre sql best_practicesPostgre sql best_practices
Postgre sql best_practices
Jacques Kostic
 
Postgre sql best_practices
Postgre sql best_practicesPostgre sql best_practices
Postgre sql best_practices
Emiliano Fusaglia
 
Pgbr 2013 postgres on aws
Pgbr 2013   postgres on awsPgbr 2013   postgres on aws
Pgbr 2013 postgres on aws
Emanuel Calvo
 
TechEvent PostgreSQL Best Practices
TechEvent PostgreSQL Best PracticesTechEvent PostgreSQL Best Practices
TechEvent PostgreSQL Best Practices
Trivadis
 
Elephants in the Cloud
Elephants in the CloudElephants in the Cloud
Elephants in the Cloud
Mike Fowler
 
PostgreSQL High Availability in a Containerized World
PostgreSQL High Availability in a Containerized WorldPostgreSQL High Availability in a Containerized World
PostgreSQL High Availability in a Containerized World
Jignesh Shah
 
PostgreSQL : Introduction
PostgreSQL : IntroductionPostgreSQL : Introduction
PostgreSQL : Introduction
Open Source School
 
9.6_Course Material-Postgresql_002.pdf
9.6_Course Material-Postgresql_002.pdf9.6_Course Material-Postgresql_002.pdf
9.6_Course Material-Postgresql_002.pdf
sreedb2
 
PostgreSQL Prologue
PostgreSQL ProloguePostgreSQL Prologue
PostgreSQL Prologue
Md. Golam Hossain
 
PostgreSQL- An Introduction
PostgreSQL- An IntroductionPostgreSQL- An Introduction
PostgreSQL- An Introduction
Smita Prasad
 
Bn 1016 demo postgre sql-online-training
Bn 1016 demo  postgre sql-online-trainingBn 1016 demo  postgre sql-online-training
Bn 1016 demo postgre sql-online-training
conline training
 
Hosted PostgreSQL
Hosted PostgreSQLHosted PostgreSQL
Hosted PostgreSQL
Mike Fowler
 
SCALE 15x Minimizing PostgreSQL Major Version Upgrade Downtime
SCALE 15x Minimizing PostgreSQL Major Version Upgrade DowntimeSCALE 15x Minimizing PostgreSQL Major Version Upgrade Downtime
SCALE 15x Minimizing PostgreSQL Major Version Upgrade Downtime
Jeff Frost
 
PUGS Meetup Presentation - 11062015
PUGS Meetup Presentation - 11062015PUGS Meetup Presentation - 11062015
PUGS Meetup Presentation - 11062015
Wei Shan Ang
 
Lessons PostgreSQL learned from commercial databases, and didn’t
Lessons PostgreSQL learned from commercial databases, and didn’tLessons PostgreSQL learned from commercial databases, and didn’t
Lessons PostgreSQL learned from commercial databases, and didn’t
PGConf APAC
 
EDB Database Servers and Tools
EDB Database Servers and Tools EDB Database Servers and Tools
EDB Database Servers and Tools
Ashnikbiz
 
Getting started with postgresql
Getting started with postgresqlGetting started with postgresql
Getting started with postgresql
botsplash.com
 
10 things, an Oracle DBA should care about when moving to PostgreSQL
10 things, an Oracle DBA should care about when moving to PostgreSQL10 things, an Oracle DBA should care about when moving to PostgreSQL
10 things, an Oracle DBA should care about when moving to PostgreSQL
PostgreSQL-Consulting
 
Trivadis TechEvent 2017 PostgreSQL für die (Orakel) DBA by Ludovico Caldara
Trivadis TechEvent 2017 PostgreSQL für die (Orakel) DBA by Ludovico CaldaraTrivadis TechEvent 2017 PostgreSQL für die (Orakel) DBA by Ludovico Caldara
Trivadis TechEvent 2017 PostgreSQL für die (Orakel) DBA by Ludovico Caldara
Trivadis
 
Pro PostgreSQL, OSCon 2008
Pro PostgreSQL, OSCon 2008Pro PostgreSQL, OSCon 2008
Pro PostgreSQL, OSCon 2008
Robert Treat
 
Postgre sql best_practices
Postgre sql best_practicesPostgre sql best_practices
Postgre sql best_practices
Jacques Kostic
 
Pgbr 2013 postgres on aws
Pgbr 2013   postgres on awsPgbr 2013   postgres on aws
Pgbr 2013 postgres on aws
Emanuel Calvo
 
TechEvent PostgreSQL Best Practices
TechEvent PostgreSQL Best PracticesTechEvent PostgreSQL Best Practices
TechEvent PostgreSQL Best Practices
Trivadis
 
Elephants in the Cloud
Elephants in the CloudElephants in the Cloud
Elephants in the Cloud
Mike Fowler
 
PostgreSQL High Availability in a Containerized World
PostgreSQL High Availability in a Containerized WorldPostgreSQL High Availability in a Containerized World
PostgreSQL High Availability in a Containerized World
Jignesh Shah
 
9.6_Course Material-Postgresql_002.pdf
9.6_Course Material-Postgresql_002.pdf9.6_Course Material-Postgresql_002.pdf
9.6_Course Material-Postgresql_002.pdf
sreedb2
 
PostgreSQL- An Introduction
PostgreSQL- An IntroductionPostgreSQL- An Introduction
PostgreSQL- An Introduction
Smita Prasad
 
Bn 1016 demo postgre sql-online-training
Bn 1016 demo  postgre sql-online-trainingBn 1016 demo  postgre sql-online-training
Bn 1016 demo postgre sql-online-training
conline training
 
Hosted PostgreSQL
Hosted PostgreSQLHosted PostgreSQL
Hosted PostgreSQL
Mike Fowler
 
SCALE 15x Minimizing PostgreSQL Major Version Upgrade Downtime
SCALE 15x Minimizing PostgreSQL Major Version Upgrade DowntimeSCALE 15x Minimizing PostgreSQL Major Version Upgrade Downtime
SCALE 15x Minimizing PostgreSQL Major Version Upgrade Downtime
Jeff Frost
 
PUGS Meetup Presentation - 11062015
PUGS Meetup Presentation - 11062015PUGS Meetup Presentation - 11062015
PUGS Meetup Presentation - 11062015
Wei Shan Ang
 
Lessons PostgreSQL learned from commercial databases, and didn’t
Lessons PostgreSQL learned from commercial databases, and didn’tLessons PostgreSQL learned from commercial databases, and didn’t
Lessons PostgreSQL learned from commercial databases, and didn’t
PGConf APAC
 
EDB Database Servers and Tools
EDB Database Servers and Tools EDB Database Servers and Tools
EDB Database Servers and Tools
Ashnikbiz
 
Getting started with postgresql
Getting started with postgresqlGetting started with postgresql
Getting started with postgresql
botsplash.com
 
Ad

More from PgTraining (7)

Webminar del 12.03.2012
Webminar del 12.03.2012Webminar del 12.03.2012
Webminar del 12.03.2012
PgTraining
 
Webminar del 12.03.2012
Webminar del 12.03.2012Webminar del 12.03.2012
Webminar del 12.03.2012
PgTraining
 
Weminar 12.03.2021 . JIT
Weminar 12.03.2021 . JITWeminar 12.03.2021 . JIT
Weminar 12.03.2021 . JIT
PgTraining
 
Openday - PostgreSQL: primi passi con Json/Jsonb
Openday - PostgreSQL: primi passi con Json/Jsonb Openday - PostgreSQL: primi passi con Json/Jsonb
Openday - PostgreSQL: primi passi con Json/Jsonb
PgTraining
 
Pgtraining bdr
Pgtraining bdrPgtraining bdr
Pgtraining bdr
PgTraining
 
Messa in rete
Messa in reteMessa in rete
Messa in rete
PgTraining
 
Apcamp
ApcampApcamp
Apcamp
PgTraining
 
Webminar del 12.03.2012
Webminar del 12.03.2012Webminar del 12.03.2012
Webminar del 12.03.2012
PgTraining
 
Webminar del 12.03.2012
Webminar del 12.03.2012Webminar del 12.03.2012
Webminar del 12.03.2012
PgTraining
 
Weminar 12.03.2021 . JIT
Weminar 12.03.2021 . JITWeminar 12.03.2021 . JIT
Weminar 12.03.2021 . JIT
PgTraining
 
Openday - PostgreSQL: primi passi con Json/Jsonb
Openday - PostgreSQL: primi passi con Json/Jsonb Openday - PostgreSQL: primi passi con Json/Jsonb
Openday - PostgreSQL: primi passi con Json/Jsonb
PgTraining
 
Pgtraining bdr
Pgtraining bdrPgtraining bdr
Pgtraining bdr
PgTraining
 

Recently uploaded (20)

apidays New York 2025 - Why I Built Another Carbon Measurement Tool for LLMs ...
apidays New York 2025 - Why I Built Another Carbon Measurement Tool for LLMs ...apidays New York 2025 - Why I Built Another Carbon Measurement Tool for LLMs ...
apidays New York 2025 - Why I Built Another Carbon Measurement Tool for LLMs ...
apidays
 
apidays New York 2025 - Fast, Repeatable, Secure: Pick 3 with FINOS CCC by Le...
apidays New York 2025 - Fast, Repeatable, Secure: Pick 3 with FINOS CCC by Le...apidays New York 2025 - Fast, Repeatable, Secure: Pick 3 with FINOS CCC by Le...
apidays New York 2025 - Fast, Repeatable, Secure: Pick 3 with FINOS CCC by Le...
apidays
 
apidays New York 2025 - CIAM in the wild by Michael Gruen (Layr)
apidays New York 2025 - CIAM in the wild by Michael Gruen (Layr)apidays New York 2025 - CIAM in the wild by Michael Gruen (Layr)
apidays New York 2025 - CIAM in the wild by Michael Gruen (Layr)
apidays
 
apidays Singapore 2025 - What exactly are AI Agents by Aki Ranin (Earthshots ...
apidays Singapore 2025 - What exactly are AI Agents by Aki Ranin (Earthshots ...apidays Singapore 2025 - What exactly are AI Agents by Aki Ranin (Earthshots ...
apidays Singapore 2025 - What exactly are AI Agents by Aki Ranin (Earthshots ...
apidays
 
apidays New York 2025 - Lessons From Two Technical Transformations by Leah Hu...
apidays New York 2025 - Lessons From Two Technical Transformations by Leah Hu...apidays New York 2025 - Lessons From Two Technical Transformations by Leah Hu...
apidays New York 2025 - Lessons From Two Technical Transformations by Leah Hu...
apidays
 
apidays New York 2025 - Beyond Webhooks: The Future of Scalable API Event Del...
apidays New York 2025 - Beyond Webhooks: The Future of Scalable API Event Del...apidays New York 2025 - Beyond Webhooks: The Future of Scalable API Event Del...
apidays New York 2025 - Beyond Webhooks: The Future of Scalable API Event Del...
apidays
 
What is FinOps as a Service and why is it Trending?
What is FinOps as a Service and why is it Trending?What is FinOps as a Service and why is it Trending?
What is FinOps as a Service and why is it Trending?
Amnic
 
Part Departement Head Presentation for Business
Part Departement Head Presentation for BusinessPart Departement Head Presentation for Business
Part Departement Head Presentation for Business
Rizki229625
 
Ch01_Introduction_to_Information_Securit
Ch01_Introduction_to_Information_SecuritCh01_Introduction_to_Information_Securit
Ch01_Introduction_to_Information_Securit
KawukiDerrick
 
apidays New York 2025 - Unifying OpenAPI & AsyncAPI by Naresh Jain & Hari Kri...
apidays New York 2025 - Unifying OpenAPI & AsyncAPI by Naresh Jain & Hari Kri...apidays New York 2025 - Unifying OpenAPI & AsyncAPI by Naresh Jain & Hari Kri...
apidays New York 2025 - Unifying OpenAPI & AsyncAPI by Naresh Jain & Hari Kri...
apidays
 
apidays New York 2025 - Boost API Development Velocity with Practical AI Tool...
apidays New York 2025 - Boost API Development Velocity with Practical AI Tool...apidays New York 2025 - Boost API Development Velocity with Practical AI Tool...
apidays New York 2025 - Boost API Development Velocity with Practical AI Tool...
apidays
 
apidays New York 2025 - Spring Modulith Design for Microservices by Renjith R...
apidays New York 2025 - Spring Modulith Design for Microservices by Renjith R...apidays New York 2025 - Spring Modulith Design for Microservices by Renjith R...
apidays New York 2025 - Spring Modulith Design for Microservices by Renjith R...
apidays
 
apidays Singapore 2025 - 4 Identity Essentials for Scaling SaaS in Large Orgs...
apidays Singapore 2025 - 4 Identity Essentials for Scaling SaaS in Large Orgs...apidays Singapore 2025 - 4 Identity Essentials for Scaling SaaS in Large Orgs...
apidays Singapore 2025 - 4 Identity Essentials for Scaling SaaS in Large Orgs...
apidays
 
apidays New York 2025 - Using GraphQL SDL files as executable API Contracts b...
apidays New York 2025 - Using GraphQL SDL files as executable API Contracts b...apidays New York 2025 - Using GraphQL SDL files as executable API Contracts b...
apidays New York 2025 - Using GraphQL SDL files as executable API Contracts b...
apidays
 
Philippine-Constitution-and-Law in hospitality
Philippine-Constitution-and-Law in hospitalityPhilippine-Constitution-and-Law in hospitality
Philippine-Constitution-and-Law in hospitality
kikomendoza006
 
apidays Singapore 2025 - Enhancing Developer Productivity with UX (Government...
apidays Singapore 2025 - Enhancing Developer Productivity with UX (Government...apidays Singapore 2025 - Enhancing Developer Productivity with UX (Government...
apidays Singapore 2025 - Enhancing Developer Productivity with UX (Government...
apidays
 
apidays New York 2025 - The Future of Small Business Lending with Open Bankin...
apidays New York 2025 - The Future of Small Business Lending with Open Bankin...apidays New York 2025 - The Future of Small Business Lending with Open Bankin...
apidays New York 2025 - The Future of Small Business Lending with Open Bankin...
apidays
 
apidays New York 2025 - The FINOS Common Domain Model for Capital Markets by ...
apidays New York 2025 - The FINOS Common Domain Model for Capital Markets by ...apidays New York 2025 - The FINOS Common Domain Model for Capital Markets by ...
apidays New York 2025 - The FINOS Common Domain Model for Capital Markets by ...
apidays
 
SAP_S4HANA_EWM_Food_Processing_Industry.pptx
SAP_S4HANA_EWM_Food_Processing_Industry.pptxSAP_S4HANA_EWM_Food_Processing_Industry.pptx
SAP_S4HANA_EWM_Food_Processing_Industry.pptx
vemulavenu484
 
apidays New York 2025 - Breaking Barriers: Lessons Learned from API Integrati...
apidays New York 2025 - Breaking Barriers: Lessons Learned from API Integrati...apidays New York 2025 - Breaking Barriers: Lessons Learned from API Integrati...
apidays New York 2025 - Breaking Barriers: Lessons Learned from API Integrati...
apidays
 
apidays New York 2025 - Why I Built Another Carbon Measurement Tool for LLMs ...
apidays New York 2025 - Why I Built Another Carbon Measurement Tool for LLMs ...apidays New York 2025 - Why I Built Another Carbon Measurement Tool for LLMs ...
apidays New York 2025 - Why I Built Another Carbon Measurement Tool for LLMs ...
apidays
 
apidays New York 2025 - Fast, Repeatable, Secure: Pick 3 with FINOS CCC by Le...
apidays New York 2025 - Fast, Repeatable, Secure: Pick 3 with FINOS CCC by Le...apidays New York 2025 - Fast, Repeatable, Secure: Pick 3 with FINOS CCC by Le...
apidays New York 2025 - Fast, Repeatable, Secure: Pick 3 with FINOS CCC by Le...
apidays
 
apidays New York 2025 - CIAM in the wild by Michael Gruen (Layr)
apidays New York 2025 - CIAM in the wild by Michael Gruen (Layr)apidays New York 2025 - CIAM in the wild by Michael Gruen (Layr)
apidays New York 2025 - CIAM in the wild by Michael Gruen (Layr)
apidays
 
apidays Singapore 2025 - What exactly are AI Agents by Aki Ranin (Earthshots ...
apidays Singapore 2025 - What exactly are AI Agents by Aki Ranin (Earthshots ...apidays Singapore 2025 - What exactly are AI Agents by Aki Ranin (Earthshots ...
apidays Singapore 2025 - What exactly are AI Agents by Aki Ranin (Earthshots ...
apidays
 
apidays New York 2025 - Lessons From Two Technical Transformations by Leah Hu...
apidays New York 2025 - Lessons From Two Technical Transformations by Leah Hu...apidays New York 2025 - Lessons From Two Technical Transformations by Leah Hu...
apidays New York 2025 - Lessons From Two Technical Transformations by Leah Hu...
apidays
 
apidays New York 2025 - Beyond Webhooks: The Future of Scalable API Event Del...
apidays New York 2025 - Beyond Webhooks: The Future of Scalable API Event Del...apidays New York 2025 - Beyond Webhooks: The Future of Scalable API Event Del...
apidays New York 2025 - Beyond Webhooks: The Future of Scalable API Event Del...
apidays
 
What is FinOps as a Service and why is it Trending?
What is FinOps as a Service and why is it Trending?What is FinOps as a Service and why is it Trending?
What is FinOps as a Service and why is it Trending?
Amnic
 
Part Departement Head Presentation for Business
Part Departement Head Presentation for BusinessPart Departement Head Presentation for Business
Part Departement Head Presentation for Business
Rizki229625
 
Ch01_Introduction_to_Information_Securit
Ch01_Introduction_to_Information_SecuritCh01_Introduction_to_Information_Securit
Ch01_Introduction_to_Information_Securit
KawukiDerrick
 
apidays New York 2025 - Unifying OpenAPI & AsyncAPI by Naresh Jain & Hari Kri...
apidays New York 2025 - Unifying OpenAPI & AsyncAPI by Naresh Jain & Hari Kri...apidays New York 2025 - Unifying OpenAPI & AsyncAPI by Naresh Jain & Hari Kri...
apidays New York 2025 - Unifying OpenAPI & AsyncAPI by Naresh Jain & Hari Kri...
apidays
 
apidays New York 2025 - Boost API Development Velocity with Practical AI Tool...
apidays New York 2025 - Boost API Development Velocity with Practical AI Tool...apidays New York 2025 - Boost API Development Velocity with Practical AI Tool...
apidays New York 2025 - Boost API Development Velocity with Practical AI Tool...
apidays
 
apidays New York 2025 - Spring Modulith Design for Microservices by Renjith R...
apidays New York 2025 - Spring Modulith Design for Microservices by Renjith R...apidays New York 2025 - Spring Modulith Design for Microservices by Renjith R...
apidays New York 2025 - Spring Modulith Design for Microservices by Renjith R...
apidays
 
apidays Singapore 2025 - 4 Identity Essentials for Scaling SaaS in Large Orgs...
apidays Singapore 2025 - 4 Identity Essentials for Scaling SaaS in Large Orgs...apidays Singapore 2025 - 4 Identity Essentials for Scaling SaaS in Large Orgs...
apidays Singapore 2025 - 4 Identity Essentials for Scaling SaaS in Large Orgs...
apidays
 
apidays New York 2025 - Using GraphQL SDL files as executable API Contracts b...
apidays New York 2025 - Using GraphQL SDL files as executable API Contracts b...apidays New York 2025 - Using GraphQL SDL files as executable API Contracts b...
apidays New York 2025 - Using GraphQL SDL files as executable API Contracts b...
apidays
 
Philippine-Constitution-and-Law in hospitality
Philippine-Constitution-and-Law in hospitalityPhilippine-Constitution-and-Law in hospitality
Philippine-Constitution-and-Law in hospitality
kikomendoza006
 
apidays Singapore 2025 - Enhancing Developer Productivity with UX (Government...
apidays Singapore 2025 - Enhancing Developer Productivity with UX (Government...apidays Singapore 2025 - Enhancing Developer Productivity with UX (Government...
apidays Singapore 2025 - Enhancing Developer Productivity with UX (Government...
apidays
 
apidays New York 2025 - The Future of Small Business Lending with Open Bankin...
apidays New York 2025 - The Future of Small Business Lending with Open Bankin...apidays New York 2025 - The Future of Small Business Lending with Open Bankin...
apidays New York 2025 - The Future of Small Business Lending with Open Bankin...
apidays
 
apidays New York 2025 - The FINOS Common Domain Model for Capital Markets by ...
apidays New York 2025 - The FINOS Common Domain Model for Capital Markets by ...apidays New York 2025 - The FINOS Common Domain Model for Capital Markets by ...
apidays New York 2025 - The FINOS Common Domain Model for Capital Markets by ...
apidays
 
SAP_S4HANA_EWM_Food_Processing_Industry.pptx
SAP_S4HANA_EWM_Food_Processing_Industry.pptxSAP_S4HANA_EWM_Food_Processing_Industry.pptx
SAP_S4HANA_EWM_Food_Processing_Industry.pptx
vemulavenu484
 
apidays New York 2025 - Breaking Barriers: Lessons Learned from API Integrati...
apidays New York 2025 - Breaking Barriers: Lessons Learned from API Integrati...apidays New York 2025 - Breaking Barriers: Lessons Learned from API Integrati...
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
  • 15. 2016-06-22OracletoPostgresMigration-part2 No More Elephants • Have a look at Josh Berkus' 7 ways to crash Postgres: • no updates • out of disk space • deleting stuff • out of RAM • bad hardware • too many connections • zombie locks
  • 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"
  • 19. 2016-06-22OracletoPostgresMigration-part2 Streaming Experiments • screenshot from another demo (with machines africa and asia):
  • 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.
  • 22. 2016-06-22OracletoPostgresMigration-part2 pgpool-II • here is a pgpool-II presentation from the author of the software - this is what we want to do (from the linked presentation):
  • 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