Automating
Data Migrations
using Python
using Python

3
The
Geek
Sharp
Jessica
The
Geek
Sharp
DBA

@
jessica.sharp@enterprisedb.com
What I do

vs
What I am
Data Infrastructure Engineer

Senior Database Consultant


Board of Directors

-
Installation
-
Editors
-
Code style standards
-
Documenting your code
-
Error handling

Installation
MacOS or Linux
$ python3 --version
Python 3.6.8

Installation
MacOS or Linux
$ brew install python3
$ yum install python3

Installation
Windows


Installation: Virtual Environments


Virtual Environments



Editors


Code Style Standards
Python Enhancement Proposal [PEP] 8

Code Style Standards
PEP 8 = a guide

PEP8


Python Enhancement Proposals
-
Meta
-
Informational
-
Provisional
-
Accepted
-
Open
-
Finished
-
Historical Meta
-
Deferred
-
Abandoned, Withdrawn, & Rejected

Python Enhancement Proposals


Documenting
Who's your editor?

Documenting
Technical style

Documenting
Tutorial, guide, or reference doc?

Errors

Errors

using Python

3
General Purpose Relational Database Systems | Data Warehouse Database Systems | Non-Relational Database Systems | Native Python Database Systems |
---|---|---|---|
IBM DB2 | Teradata | MetaKit | buzhug |
Firebird | IBM Netezza | ZODB | SnakeSQL |
Informix | BerkleyDB | ||
Ingres | KirbyBase | ||
MySQL | Durus | ||
Oracle | atop | ||
PostgreSQL | buzhug | ||
SAP DB | |||
Microsoft SQL Server | |||
Microsoft Access | |||
Sybase |
using Python

3

using Python

3

using Python

3
Modules

using Python

3
Functions

redshift_demo
|_ README.md
|_ conn.py
|_ cred.py
|_ run_query.py
using Python

3
Functions

using Python

3

Module: cx_Oracle


Module: cx_Oracle



Module: cx_Oracle
migrate
|__credentials.py
|__query.py


Module: cx_Oracle



Module: cx_Oracle

using Python

3

History Lesson
using Python

3
-
Data Guard -
RMAN copy/clone -
Transportable tables -
Export/Import -
Import via DB link
-
EPAS EFM -- failover -
Replication method + switchover -
pg_dump


using Python

3

using Python

3

using Python

3

project_directory
|
|_ zoo_ddl.py
|_ xepdb2.py
|_ create_table_t.sql
|_ create_db_link.sql
|_ insert_t.sql
BEAM ME UP, EDB!
It's too proprietary down here!



Data Migration Using Python
By Jessica Sharp
Data Migration Using Python
Utah Oracle Users Group September 26 Meeting
- 484