SlideShare ist ein Scribd-Unternehmen logo
1 von 33
Downloaden Sie, um offline zu lesen
© 2018 Delphix. All Rights Reserved..
Marcin Przepiorowski | Technical Manager
Take your database source code and
data under control
© 2018 Delphix.
Oracle consultant/DBA since 2000
co-developer of OraSASH – free ASH/AWR like
repository
Automation / DevOps freak
About me
Role: DBA / Release manager
1st Attempt:
- Package / schema management tool
- Developers to provide a create script
- DBA to generate an alter script if needed
History
Role: DBA / Release manager
2nd attempt:
- Web-based automation tool
- All changes needs to be deployed using same mechanism ( dev, test, UAT, prod )
- All files needs to be provided by developers
History
Role: DBA / Release manager
3rd attempt:
- Developers to provide change / create files
- All changes needs to be deployed using same method
- Each developer has a its own copy of the seed database
History
• Source control
• How to upgrade online with data
• How to detect / prevent changes done outside of process
• Rollbacks
Issues
• File based source control (ex. GIT)
– ALWAYS OPEN YOUR PL/SQL CODE THROUGH FILES !!!
• What about Apex ?
Source Control
Database change management tools
• Changelog
Liquibase uses a changelog to explicitly list database changes in order. The changelog acts as a ledger of changes and contains a list of
changesets (units of change) that Liquibase can execute on a database.
• Change set concept
Liquibase uses changesets to represent a single change to your database.
Liquibase
• Directory structure and source control
• One or many changes logs
• One main
• One object type
• How to manage PL/SQL code
Liquibase
SQL Developer Command Line
Sqlcl Liquibase extension
• Usually works fine without data
• Schema change with data could be resource expensive and not always online operation
How to upgrade online with data
• Talk with your DBA to find a best way to do so
Ex:
- Add columns with default ( works since 11g)
- Use platform features like edition-based redefinition or dbms_redefinition
- Insert is the fastest delete / update
Seriously, I think this is one of the main tasks for DBA’s those days
How to upgrade online with data
--liquibase formatted sql
--changeset marcinp:check_redef endDelimiter:/
DECLARE
l_num_errors PLS_INTEGER;
begin
DBMS_REDEFINITION.can_redef_table('SCOTT', 'EMP');
DBMS_REDEFINITION.START_REDEF_TABLE ('SCOTT', 'EMP', 'EMP3’);
DBMS_REDEFINITION.copy_table_dependents(
uname => 'SCOTT',
orig_table => 'EMP',
int_table => 'EMP3',
copy_indexes => DBMS_REDEFINITION.cons_orig_params,
num_errors => l_num_errors);
DBMS_REDEFINITION.finish_redef_table( 'SCOTT', 'EMP', 'EMP3' );
end;
/
How to upgrade online with data
• Protect schema account – close to impossible in non prods environments
• Be real DEVOPS – developers should be responsible for production changes – there is no better way to
prevent errors than being oncall during / after deployment
• Make deployment using your preferred way EASY – like running a pipeline
• Pipeline allows you to test your deployment process and detect errors early on
How to detect / prevent changes done outside of process
• Trust but verify
• My recommendation – use DDLFS and git repository
(https://github.com/usrecnik/ddlfs)
How to detect / prevent changes done outside of process
How to detect / prevent changes done outside of process
$ git init
Initialized empty Git repository in /home/oracle/databases/.git/
$ ddlfs -o
ro,dbro,username=/,password=/,database=/,userrole=SYSDBA,schemas=SCOTT:DELPHIX,filesize=-
1,keepcache,temppath=/tmp/ddlfs /home/oracle/databases/test19
2020-11-06 12:37:03 INFO DDL Filesystem v2.3 for Oracle Database, FUSE v2.9
2020-11-06 12:37:03 INFO .. connected to database server.
2020-11-06 12:37:03 INFO Cache validation started beacuase temppath_reused=[1] and
dbro=[1]
2020-11-06 12:37:03 INFO Cache validation completed.
How to detect / prevent changes done outside of process
$ git add test19/
$ git commit -m "initial commit" test19/
[master (root-commit) df23329] initial commit
19 files changed, 227 insertions(+)
create mode 100644 test19/SCOTT/TABLE/BONUS.SQL
create mode 100644 test19/SCOTT/TABLE/DATABASECHANGELOG.SQL
create mode 100644 test19/SCOTT/TABLE/DATABASECHANGELOGLOCK.SQL
create mode 100644 test19/SCOTT/TABLE/DEMOTABLE.SQL
create mode 100644 test19/SCOTT/TABLE/DEPT.SQL
create mode 100644 test19/SCOTT/TABLE/DEPT3.SQL
create mode 100644 test19/SCOTT/TABLE/EMP.SQL
create mode 100644 test19/SCOTT/TABLE/SALGRADE.SQL
create mode 100644 test19/ddlfs.log
How to detect / prevent changes done outside of process
$ ddlfs -o ro,dbro,username=/,password=/,database=/,userrole=SYSDBA,schemas=SCOTT:DELPHIX,
filesize=-1,keepcache,temppath=/tmp/ddlfs /home/oracle/databases/test19
2020-11-06 12:39:51 INFO DDL Filesystem v2.3 for Oracle Database, FUSE v2.9
2020-11-06 12:39:51 INFO .. connected to database server.
2020-11-06 12:39:51 INFO Cache validation started beacuase temppath_reused=[1] and
dbro=[1]
2020-11-06 12:39:51 INFO Cache validation completed.
$ git status .
On branch master
Changes not staged for commit:
(use "git add/rm <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: test19/SCOTT/TABLE/DEMOTABLE.SQL
deleted: test19/SCOTT/TABLE/EMP3.SQL
$ git commit -m "next commit" test19/
[master 69fadf5] next commit
2 files changed, 2 insertions(+), 17 deletions(-)
delete mode 100644 test19/SCOTT/TABLE/EMP3.SQL
How to detect / prevent changes done outside of process
$ git diff df2332928a41dbdd0a1e157e0b2fcbce4523 69fadf5f4d06919f1cbf35abf7abec826e7
diff --git a/test19/SCOTT/TABLE/DEMOTABLE.SQL b/test19/SCOTT/TABLE/DEMOTABLE.SQL
index 83eecfa..ce24d39 100644
--- a/test19/SCOTT/TABLE/DEMOTABLE.SQL
+++ b/test19/SCOTT/TABLE/DEMOTABLE.SQL
@@ -1,6 +1,7 @@
CREATE TABLE "SCOTT"."DEMOTABLE" (
"COLUMNNAME1" VARCHAR2(355 BYTE) NULL,
- "NAME" VARCHAR2(10 BYTE) NULL);
+ "NAME" VARCHAR2(10 BYTE) NULL,
+ "HACK" NUMBER NULL);
diff --git a/test19/SCOTT/TABLE/EMP3.SQL b/test19/SCOTT/TABLE/EMP3.SQL
deleted file mode 100644
index ed99eb3..0000000
--- a/test19/SCOTT/TABLE/EMP3.SQL
+++ /dev/null
…
• Always rollback database to pre-upgrade state on lower environments – use Pipelines
• Difficult on the production databases
• Should be limited to code only – if upgrade done online – to avoid data loss
• Try to move forward by incremental change rather then rollback
• Deployments and tests should be done on fresh copy of production to limit a number of rollbacks to
minimum
Rollbacks
• Data control for developer on laptop
• Data control on test / integration system
• Masking / GDPR / Privacy
Data control
• Potential solutions:
– Multiple databases ( V1, V2, almost prod, UAT, preprod )
– Backups
– Snapshots
( check my presentation “Pipeline my database” )
• ML/AL examples:
• DOLT - https://dbdb.io/db/dolt
• DVC
Data control
• Seed data only
– Docker + schema + plus inserts
– Seed PDB + schema + plus inserts
• What if you want to have a production like database locally ?
– Clone whole database but mask all sensitive columns
– Prepare working rules for sub-setting data sets but still mask all sensitive columns
– Is this really necessary
Local development
• Virtual machine snapshots or Docker snapshots
• Titan – an open-source to control a version of Docker container databases
( not active for some time - https://titan-data.io/ )
• Use snapshots on your Linux file system:
( ZFS, BTRFS, others )
• Bonus - APEX ”source control”
Local development – data control
© 2017 Delphix. All Rights Reserved. Private and Confidential.
Data catalog
- Full copy of production database
- Full masked copy of the production database
- Subset of 1, 10, 50 percent of the masked production database
- Different set of the synthetic data
Shared databases
• How:
– Snapshots clones
• File system clones
• clonedb.pl
• ASM Flex clones
– PDB clone
• snapshot clone
• Normal clone
– 3rd party:
• Delphix
• Storage providers - Pure, NetApp
– Backup / restores
Shared databases
• Deploy changes using an automated way – ideally same as for production update
• It’s allows you to test all at early stage
• End goal is:
Masked production like data + new schema changes
Shared databases
• Data control allows you to run destructive tests using different data sets
• utPLSQL is a great tool – data control allows you to use it with “commit” in your code
Shared databases
31
Shared databases
Database AUTOTEST
Database BUGFIXER
32
Database: DEV
Docker container
Docker volume
mapped to file system
with snapshots
Database: DEV
Docker container
Database: DEV
Docker container
Shared databases
© 2018 Delphix.
Q & A
marcin@delphix.com
@pioro

Weitere ähnliche Inhalte

Was ist angesagt?

Oracle Exadata Performance: Latest Improvements and Less Known Features
Oracle Exadata Performance: Latest Improvements and Less Known FeaturesOracle Exadata Performance: Latest Improvements and Less Known Features
Oracle Exadata Performance: Latest Improvements and Less Known FeaturesTanel Poder
 
Christo kutrovsky oracle rac solving common scalability problems
Christo kutrovsky   oracle rac solving common scalability problemsChristo kutrovsky   oracle rac solving common scalability problems
Christo kutrovsky oracle rac solving common scalability problemsChristo Kutrovsky
 
Oracle Enteprise Manager Cloud Control 12c - Setting Up Metrics and Monitorin...
Oracle Enteprise Manager Cloud Control 12c - Setting Up Metrics and Monitorin...Oracle Enteprise Manager Cloud Control 12c - Setting Up Metrics and Monitorin...
Oracle Enteprise Manager Cloud Control 12c - Setting Up Metrics and Monitorin...Leighton Nelson
 
12 Things about Oracle WebLogic Server 12c
12 Things	 about Oracle WebLogic Server 12c12 Things	 about Oracle WebLogic Server 12c
12 Things about Oracle WebLogic Server 12cGuatemala User Group
 
Best Practices - PHP and the Oracle Database
Best Practices - PHP and the Oracle DatabaseBest Practices - PHP and the Oracle Database
Best Practices - PHP and the Oracle DatabaseChristopher Jones
 
End-to-end Troubleshooting Checklist for Microsoft SQL Server
End-to-end Troubleshooting Checklist for Microsoft SQL ServerEnd-to-end Troubleshooting Checklist for Microsoft SQL Server
End-to-end Troubleshooting Checklist for Microsoft SQL ServerKevin Kline
 
PDB Provisioning with Oracle Multitenant Self Service Application
PDB Provisioning with Oracle Multitenant Self Service ApplicationPDB Provisioning with Oracle Multitenant Self Service Application
PDB Provisioning with Oracle Multitenant Self Service ApplicationLeighton Nelson
 
Looking at RAC, GI/Clusterware Diagnostic Tools
Looking at RAC,   GI/Clusterware Diagnostic Tools Looking at RAC,   GI/Clusterware Diagnostic Tools
Looking at RAC, GI/Clusterware Diagnostic Tools Leighton Nelson
 
Oracle Drivers configuration for High Availability, is it a developer's job?
Oracle Drivers configuration for High Availability, is it a developer's job?Oracle Drivers configuration for High Availability, is it a developer's job?
Oracle Drivers configuration for High Availability, is it a developer's job?Ludovico Caldara
 
Hive acid-updates-strata-sjc-feb-2015
Hive acid-updates-strata-sjc-feb-2015Hive acid-updates-strata-sjc-feb-2015
Hive acid-updates-strata-sjc-feb-2015alanfgates
 
Oracle Drivers configuration for High Availability
Oracle Drivers configuration for High AvailabilityOracle Drivers configuration for High Availability
Oracle Drivers configuration for High AvailabilityLudovico Caldara
 
Automating Your Clone in E-Business Suite R12.2
Automating Your Clone in E-Business Suite R12.2Automating Your Clone in E-Business Suite R12.2
Automating Your Clone in E-Business Suite R12.2Michael Brown
 
ProxySQL - High Performance and HA Proxy for MySQL
ProxySQL - High Performance and HA Proxy for MySQLProxySQL - High Performance and HA Proxy for MySQL
ProxySQL - High Performance and HA Proxy for MySQLRené Cannaò
 
Monitoring Alfresco with Nagios/Icinga
Monitoring Alfresco with Nagios/IcingaMonitoring Alfresco with Nagios/Icinga
Monitoring Alfresco with Nagios/IcingaToni de la Fuente
 
Bee con2016 lightning_20160125005_ocr
Bee con2016 lightning_20160125005_ocrBee con2016 lightning_20160125005_ocr
Bee con2016 lightning_20160125005_ocrAngel Borroy López
 

Was ist angesagt? (20)

Hotsos Advanced Linux Tools
Hotsos Advanced Linux ToolsHotsos Advanced Linux Tools
Hotsos Advanced Linux Tools
 
Oracle Exadata Performance: Latest Improvements and Less Known Features
Oracle Exadata Performance: Latest Improvements and Less Known FeaturesOracle Exadata Performance: Latest Improvements and Less Known Features
Oracle Exadata Performance: Latest Improvements and Less Known Features
 
Christo kutrovsky oracle rac solving common scalability problems
Christo kutrovsky   oracle rac solving common scalability problemsChristo kutrovsky   oracle rac solving common scalability problems
Christo kutrovsky oracle rac solving common scalability problems
 
Oracle Enteprise Manager Cloud Control 12c - Setting Up Metrics and Monitorin...
Oracle Enteprise Manager Cloud Control 12c - Setting Up Metrics and Monitorin...Oracle Enteprise Manager Cloud Control 12c - Setting Up Metrics and Monitorin...
Oracle Enteprise Manager Cloud Control 12c - Setting Up Metrics and Monitorin...
 
12 Things about Oracle WebLogic Server 12c
12 Things	 about Oracle WebLogic Server 12c12 Things	 about Oracle WebLogic Server 12c
12 Things about Oracle WebLogic Server 12c
 
Best Practices - PHP and the Oracle Database
Best Practices - PHP and the Oracle DatabaseBest Practices - PHP and the Oracle Database
Best Practices - PHP and the Oracle Database
 
End-to-end Troubleshooting Checklist for Microsoft SQL Server
End-to-end Troubleshooting Checklist for Microsoft SQL ServerEnd-to-end Troubleshooting Checklist for Microsoft SQL Server
End-to-end Troubleshooting Checklist for Microsoft SQL Server
 
PDB Provisioning with Oracle Multitenant Self Service Application
PDB Provisioning with Oracle Multitenant Self Service ApplicationPDB Provisioning with Oracle Multitenant Self Service Application
PDB Provisioning with Oracle Multitenant Self Service Application
 
Looking at RAC, GI/Clusterware Diagnostic Tools
Looking at RAC,   GI/Clusterware Diagnostic Tools Looking at RAC,   GI/Clusterware Diagnostic Tools
Looking at RAC, GI/Clusterware Diagnostic Tools
 
Sqoop
SqoopSqoop
Sqoop
 
Oracle Drivers configuration for High Availability, is it a developer's job?
Oracle Drivers configuration for High Availability, is it a developer's job?Oracle Drivers configuration for High Availability, is it a developer's job?
Oracle Drivers configuration for High Availability, is it a developer's job?
 
Hive acid-updates-strata-sjc-feb-2015
Hive acid-updates-strata-sjc-feb-2015Hive acid-updates-strata-sjc-feb-2015
Hive acid-updates-strata-sjc-feb-2015
 
Oracle Drivers configuration for High Availability
Oracle Drivers configuration for High AvailabilityOracle Drivers configuration for High Availability
Oracle Drivers configuration for High Availability
 
Automating Your Clone in E-Business Suite R12.2
Automating Your Clone in E-Business Suite R12.2Automating Your Clone in E-Business Suite R12.2
Automating Your Clone in E-Business Suite R12.2
 
Zendcon zray
Zendcon zrayZendcon zray
Zendcon zray
 
ProxySQL - High Performance and HA Proxy for MySQL
ProxySQL - High Performance and HA Proxy for MySQLProxySQL - High Performance and HA Proxy for MySQL
ProxySQL - High Performance and HA Proxy for MySQL
 
Monitoring Alfresco with Nagios/Icinga
Monitoring Alfresco with Nagios/IcingaMonitoring Alfresco with Nagios/Icinga
Monitoring Alfresco with Nagios/Icinga
 
Hive: Loading Data
Hive: Loading DataHive: Loading Data
Hive: Loading Data
 
War of the Indices- SQL vs. Oracle
War of the Indices-  SQL vs. OracleWar of the Indices-  SQL vs. Oracle
War of the Indices- SQL vs. Oracle
 
Bee con2016 lightning_20160125005_ocr
Bee con2016 lightning_20160125005_ocrBee con2016 lightning_20160125005_ocr
Bee con2016 lightning_20160125005_ocr
 

Ähnlich wie Take your database source code and data under control

Handling Database Deployments
Handling Database DeploymentsHandling Database Deployments
Handling Database DeploymentsMike Willbanks
 
PgConf US 2015 - ALTER DATABASE ADD more SANITY
PgConf US 2015  - ALTER DATABASE ADD more SANITYPgConf US 2015  - ALTER DATABASE ADD more SANITY
PgConf US 2015 - ALTER DATABASE ADD more SANITYOleksii Kliukin
 
Reduce planned database down time with Oracle technology
Reduce planned database down time with Oracle technologyReduce planned database down time with Oracle technology
Reduce planned database down time with Oracle technologyKirill Loifman
 
PostgreSQL Database Slides
PostgreSQL Database SlidesPostgreSQL Database Slides
PostgreSQL Database Slidesmetsarin
 
Build Automation of PHP Applications
Build Automation of PHP ApplicationsBuild Automation of PHP Applications
Build Automation of PHP ApplicationsPavan Kumar N
 
COUG_AAbate_Oracle_Database_12c_New_Features
COUG_AAbate_Oracle_Database_12c_New_FeaturesCOUG_AAbate_Oracle_Database_12c_New_Features
COUG_AAbate_Oracle_Database_12c_New_FeaturesAlfredo Abate
 
RMAN in 12c: The Next Generation (PPT)
RMAN in 12c: The Next Generation (PPT)RMAN in 12c: The Next Generation (PPT)
RMAN in 12c: The Next Generation (PPT)Gustavo Rene Antunez
 
(Re)Indexing Large Repositories in Alfresco
(Re)Indexing Large Repositories in Alfresco(Re)Indexing Large Repositories in Alfresco
(Re)Indexing Large Repositories in AlfrescoAngel Borroy López
 
Liquibase migration for data bases
Liquibase migration for data basesLiquibase migration for data bases
Liquibase migration for data basesRoman Uholnikov
 
GLOC 2014 NEOOUG - Oracle Database 12c New Features
GLOC 2014 NEOOUG - Oracle Database 12c New FeaturesGLOC 2014 NEOOUG - Oracle Database 12c New Features
GLOC 2014 NEOOUG - Oracle Database 12c New FeaturesBiju Thomas
 
StorageQuery: federated querying on object stores, powered by Alluxio and Presto
StorageQuery: federated querying on object stores, powered by Alluxio and PrestoStorageQuery: federated querying on object stores, powered by Alluxio and Presto
StorageQuery: federated querying on object stores, powered by Alluxio and PrestoAlluxio, Inc.
 
SQL Server Integration Services Tips & Tricks
SQL Server Integration Services Tips & TricksSQL Server Integration Services Tips & Tricks
SQL Server Integration Services Tips & TricksGuillermo Caicedo
 
Splitgraph: AHL talk
Splitgraph: AHL talkSplitgraph: AHL talk
Splitgraph: AHL talkSplitgraph
 
Aioug vizag oracle12c_new_features
Aioug vizag oracle12c_new_featuresAioug vizag oracle12c_new_features
Aioug vizag oracle12c_new_featuresAiougVizagChapter
 
Using oracle12c pluggable databases to archive
Using oracle12c pluggable databases to archiveUsing oracle12c pluggable databases to archive
Using oracle12c pluggable databases to archiveSecure-24
 

Ähnlich wie Take your database source code and data under control (20)

Handling Database Deployments
Handling Database DeploymentsHandling Database Deployments
Handling Database Deployments
 
PgConf US 2015 - ALTER DATABASE ADD more SANITY
PgConf US 2015  - ALTER DATABASE ADD more SANITYPgConf US 2015  - ALTER DATABASE ADD more SANITY
PgConf US 2015 - ALTER DATABASE ADD more SANITY
 
Gg steps
Gg stepsGg steps
Gg steps
 
Reduce planned database down time with Oracle technology
Reduce planned database down time with Oracle technologyReduce planned database down time with Oracle technology
Reduce planned database down time with Oracle technology
 
PostgreSQL Database Slides
PostgreSQL Database SlidesPostgreSQL Database Slides
PostgreSQL Database Slides
 
Oracle DBA
Oracle DBAOracle DBA
Oracle DBA
 
DBCC - Dubi Lebel
DBCC - Dubi LebelDBCC - Dubi Lebel
DBCC - Dubi Lebel
 
Build Automation of PHP Applications
Build Automation of PHP ApplicationsBuild Automation of PHP Applications
Build Automation of PHP Applications
 
COUG_AAbate_Oracle_Database_12c_New_Features
COUG_AAbate_Oracle_Database_12c_New_FeaturesCOUG_AAbate_Oracle_Database_12c_New_Features
COUG_AAbate_Oracle_Database_12c_New_Features
 
Flashback in OCI
Flashback in OCIFlashback in OCI
Flashback in OCI
 
#WeSpeakLinux Session
#WeSpeakLinux Session#WeSpeakLinux Session
#WeSpeakLinux Session
 
RMAN in 12c: The Next Generation (PPT)
RMAN in 12c: The Next Generation (PPT)RMAN in 12c: The Next Generation (PPT)
RMAN in 12c: The Next Generation (PPT)
 
(Re)Indexing Large Repositories in Alfresco
(Re)Indexing Large Repositories in Alfresco(Re)Indexing Large Repositories in Alfresco
(Re)Indexing Large Repositories in Alfresco
 
Liquibase migration for data bases
Liquibase migration for data basesLiquibase migration for data bases
Liquibase migration for data bases
 
GLOC 2014 NEOOUG - Oracle Database 12c New Features
GLOC 2014 NEOOUG - Oracle Database 12c New FeaturesGLOC 2014 NEOOUG - Oracle Database 12c New Features
GLOC 2014 NEOOUG - Oracle Database 12c New Features
 
StorageQuery: federated querying on object stores, powered by Alluxio and Presto
StorageQuery: federated querying on object stores, powered by Alluxio and PrestoStorageQuery: federated querying on object stores, powered by Alluxio and Presto
StorageQuery: federated querying on object stores, powered by Alluxio and Presto
 
SQL Server Integration Services Tips & Tricks
SQL Server Integration Services Tips & TricksSQL Server Integration Services Tips & Tricks
SQL Server Integration Services Tips & Tricks
 
Splitgraph: AHL talk
Splitgraph: AHL talkSplitgraph: AHL talk
Splitgraph: AHL talk
 
Aioug vizag oracle12c_new_features
Aioug vizag oracle12c_new_featuresAioug vizag oracle12c_new_features
Aioug vizag oracle12c_new_features
 
Using oracle12c pluggable databases to archive
Using oracle12c pluggable databases to archiveUsing oracle12c pluggable databases to archive
Using oracle12c pluggable databases to archive
 

Kürzlich hochgeladen

Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% SecureCall me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% SecurePooja Nehwal
 
BabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptxBabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptxolyaivanovalion
 
Mature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptxMature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptxolyaivanovalion
 
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...amitlee9823
 
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...amitlee9823
 
Smarteg dropshipping via API with DroFx.pptx
Smarteg dropshipping via API with DroFx.pptxSmarteg dropshipping via API with DroFx.pptx
Smarteg dropshipping via API with DroFx.pptxolyaivanovalion
 
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Standamitlee9823
 
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...ZurliaSoop
 
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service BangaloreCall Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangaloreamitlee9823
 
FESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfFESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfMarinCaroMartnezBerg
 
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...Valters Lauzums
 
Probability Grade 10 Third Quarter Lessons
Probability Grade 10 Third Quarter LessonsProbability Grade 10 Third Quarter Lessons
Probability Grade 10 Third Quarter LessonsJoseMangaJr1
 
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...amitlee9823
 
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...Delhi Call girls
 
ELKO dropshipping via API with DroFx.pptx
ELKO dropshipping via API with DroFx.pptxELKO dropshipping via API with DroFx.pptx
ELKO dropshipping via API with DroFx.pptxolyaivanovalion
 
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort ServiceBDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort ServiceDelhi Call girls
 
Edukaciniai dropshipping via API with DroFx
Edukaciniai dropshipping via API with DroFxEdukaciniai dropshipping via API with DroFx
Edukaciniai dropshipping via API with DroFxolyaivanovalion
 
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...amitlee9823
 

Kürzlich hochgeladen (20)

Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% SecureCall me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
 
BabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptxBabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptx
 
Mature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptxMature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptx
 
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
 
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
 
Smarteg dropshipping via API with DroFx.pptx
Smarteg dropshipping via API with DroFx.pptxSmarteg dropshipping via API with DroFx.pptx
Smarteg dropshipping via API with DroFx.pptx
 
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
 
Sampling (random) method and Non random.ppt
Sampling (random) method and Non random.pptSampling (random) method and Non random.ppt
Sampling (random) method and Non random.ppt
 
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
 
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service BangaloreCall Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
 
FESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfFESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdf
 
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
 
Probability Grade 10 Third Quarter Lessons
Probability Grade 10 Third Quarter LessonsProbability Grade 10 Third Quarter Lessons
Probability Grade 10 Third Quarter Lessons
 
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
 
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
 
ELKO dropshipping via API with DroFx.pptx
ELKO dropshipping via API with DroFx.pptxELKO dropshipping via API with DroFx.pptx
ELKO dropshipping via API with DroFx.pptx
 
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort ServiceBDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
 
Edukaciniai dropshipping via API with DroFx
Edukaciniai dropshipping via API with DroFxEdukaciniai dropshipping via API with DroFx
Edukaciniai dropshipping via API with DroFx
 
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
 

Take your database source code and data under control

  • 1. © 2018 Delphix. All Rights Reserved.. Marcin Przepiorowski | Technical Manager Take your database source code and data under control
  • 2. © 2018 Delphix. Oracle consultant/DBA since 2000 co-developer of OraSASH – free ASH/AWR like repository Automation / DevOps freak About me
  • 3. Role: DBA / Release manager 1st Attempt: - Package / schema management tool - Developers to provide a create script - DBA to generate an alter script if needed History
  • 4. Role: DBA / Release manager 2nd attempt: - Web-based automation tool - All changes needs to be deployed using same mechanism ( dev, test, UAT, prod ) - All files needs to be provided by developers History
  • 5. Role: DBA / Release manager 3rd attempt: - Developers to provide change / create files - All changes needs to be deployed using same method - Each developer has a its own copy of the seed database History
  • 6. • Source control • How to upgrade online with data • How to detect / prevent changes done outside of process • Rollbacks Issues
  • 7. • File based source control (ex. GIT) – ALWAYS OPEN YOUR PL/SQL CODE THROUGH FILES !!! • What about Apex ? Source Control
  • 9. • Changelog Liquibase uses a changelog to explicitly list database changes in order. The changelog acts as a ledger of changes and contains a list of changesets (units of change) that Liquibase can execute on a database. • Change set concept Liquibase uses changesets to represent a single change to your database. Liquibase
  • 10. • Directory structure and source control • One or many changes logs • One main • One object type • How to manage PL/SQL code Liquibase
  • 11. SQL Developer Command Line Sqlcl Liquibase extension
  • 12.
  • 13. • Usually works fine without data • Schema change with data could be resource expensive and not always online operation How to upgrade online with data
  • 14. • Talk with your DBA to find a best way to do so Ex: - Add columns with default ( works since 11g) - Use platform features like edition-based redefinition or dbms_redefinition - Insert is the fastest delete / update Seriously, I think this is one of the main tasks for DBA’s those days How to upgrade online with data
  • 15. --liquibase formatted sql --changeset marcinp:check_redef endDelimiter:/ DECLARE l_num_errors PLS_INTEGER; begin DBMS_REDEFINITION.can_redef_table('SCOTT', 'EMP'); DBMS_REDEFINITION.START_REDEF_TABLE ('SCOTT', 'EMP', 'EMP3’); DBMS_REDEFINITION.copy_table_dependents( uname => 'SCOTT', orig_table => 'EMP', int_table => 'EMP3', copy_indexes => DBMS_REDEFINITION.cons_orig_params, num_errors => l_num_errors); DBMS_REDEFINITION.finish_redef_table( 'SCOTT', 'EMP', 'EMP3' ); end; / How to upgrade online with data
  • 16. • Protect schema account – close to impossible in non prods environments • Be real DEVOPS – developers should be responsible for production changes – there is no better way to prevent errors than being oncall during / after deployment • Make deployment using your preferred way EASY – like running a pipeline • Pipeline allows you to test your deployment process and detect errors early on How to detect / prevent changes done outside of process
  • 17. • Trust but verify • My recommendation – use DDLFS and git repository (https://github.com/usrecnik/ddlfs) How to detect / prevent changes done outside of process
  • 18. How to detect / prevent changes done outside of process $ git init Initialized empty Git repository in /home/oracle/databases/.git/ $ ddlfs -o ro,dbro,username=/,password=/,database=/,userrole=SYSDBA,schemas=SCOTT:DELPHIX,filesize=- 1,keepcache,temppath=/tmp/ddlfs /home/oracle/databases/test19 2020-11-06 12:37:03 INFO DDL Filesystem v2.3 for Oracle Database, FUSE v2.9 2020-11-06 12:37:03 INFO .. connected to database server. 2020-11-06 12:37:03 INFO Cache validation started beacuase temppath_reused=[1] and dbro=[1] 2020-11-06 12:37:03 INFO Cache validation completed.
  • 19. How to detect / prevent changes done outside of process $ git add test19/ $ git commit -m "initial commit" test19/ [master (root-commit) df23329] initial commit 19 files changed, 227 insertions(+) create mode 100644 test19/SCOTT/TABLE/BONUS.SQL create mode 100644 test19/SCOTT/TABLE/DATABASECHANGELOG.SQL create mode 100644 test19/SCOTT/TABLE/DATABASECHANGELOGLOCK.SQL create mode 100644 test19/SCOTT/TABLE/DEMOTABLE.SQL create mode 100644 test19/SCOTT/TABLE/DEPT.SQL create mode 100644 test19/SCOTT/TABLE/DEPT3.SQL create mode 100644 test19/SCOTT/TABLE/EMP.SQL create mode 100644 test19/SCOTT/TABLE/SALGRADE.SQL create mode 100644 test19/ddlfs.log
  • 20. How to detect / prevent changes done outside of process $ ddlfs -o ro,dbro,username=/,password=/,database=/,userrole=SYSDBA,schemas=SCOTT:DELPHIX, filesize=-1,keepcache,temppath=/tmp/ddlfs /home/oracle/databases/test19 2020-11-06 12:39:51 INFO DDL Filesystem v2.3 for Oracle Database, FUSE v2.9 2020-11-06 12:39:51 INFO .. connected to database server. 2020-11-06 12:39:51 INFO Cache validation started beacuase temppath_reused=[1] and dbro=[1] 2020-11-06 12:39:51 INFO Cache validation completed. $ git status . On branch master Changes not staged for commit: (use "git add/rm <file>..." to update what will be committed) (use "git checkout -- <file>..." to discard changes in working directory) modified: test19/SCOTT/TABLE/DEMOTABLE.SQL deleted: test19/SCOTT/TABLE/EMP3.SQL $ git commit -m "next commit" test19/ [master 69fadf5] next commit 2 files changed, 2 insertions(+), 17 deletions(-) delete mode 100644 test19/SCOTT/TABLE/EMP3.SQL
  • 21. How to detect / prevent changes done outside of process $ git diff df2332928a41dbdd0a1e157e0b2fcbce4523 69fadf5f4d06919f1cbf35abf7abec826e7 diff --git a/test19/SCOTT/TABLE/DEMOTABLE.SQL b/test19/SCOTT/TABLE/DEMOTABLE.SQL index 83eecfa..ce24d39 100644 --- a/test19/SCOTT/TABLE/DEMOTABLE.SQL +++ b/test19/SCOTT/TABLE/DEMOTABLE.SQL @@ -1,6 +1,7 @@ CREATE TABLE "SCOTT"."DEMOTABLE" ( "COLUMNNAME1" VARCHAR2(355 BYTE) NULL, - "NAME" VARCHAR2(10 BYTE) NULL); + "NAME" VARCHAR2(10 BYTE) NULL, + "HACK" NUMBER NULL); diff --git a/test19/SCOTT/TABLE/EMP3.SQL b/test19/SCOTT/TABLE/EMP3.SQL deleted file mode 100644 index ed99eb3..0000000 --- a/test19/SCOTT/TABLE/EMP3.SQL +++ /dev/null …
  • 22. • Always rollback database to pre-upgrade state on lower environments – use Pipelines • Difficult on the production databases • Should be limited to code only – if upgrade done online – to avoid data loss • Try to move forward by incremental change rather then rollback • Deployments and tests should be done on fresh copy of production to limit a number of rollbacks to minimum Rollbacks
  • 23. • Data control for developer on laptop • Data control on test / integration system • Masking / GDPR / Privacy Data control
  • 24. • Potential solutions: – Multiple databases ( V1, V2, almost prod, UAT, preprod ) – Backups – Snapshots ( check my presentation “Pipeline my database” ) • ML/AL examples: • DOLT - https://dbdb.io/db/dolt • DVC Data control
  • 25. • Seed data only – Docker + schema + plus inserts – Seed PDB + schema + plus inserts • What if you want to have a production like database locally ? – Clone whole database but mask all sensitive columns – Prepare working rules for sub-setting data sets but still mask all sensitive columns – Is this really necessary Local development
  • 26. • Virtual machine snapshots or Docker snapshots • Titan – an open-source to control a version of Docker container databases ( not active for some time - https://titan-data.io/ ) • Use snapshots on your Linux file system: ( ZFS, BTRFS, others ) • Bonus - APEX ”source control” Local development – data control
  • 27. © 2017 Delphix. All Rights Reserved. Private and Confidential. Data catalog - Full copy of production database - Full masked copy of the production database - Subset of 1, 10, 50 percent of the masked production database - Different set of the synthetic data Shared databases
  • 28. • How: – Snapshots clones • File system clones • clonedb.pl • ASM Flex clones – PDB clone • snapshot clone • Normal clone – 3rd party: • Delphix • Storage providers - Pure, NetApp – Backup / restores Shared databases
  • 29. • Deploy changes using an automated way – ideally same as for production update • It’s allows you to test all at early stage • End goal is: Masked production like data + new schema changes Shared databases
  • 30. • Data control allows you to run destructive tests using different data sets • utPLSQL is a great tool – data control allows you to use it with “commit” in your code Shared databases
  • 32. 32 Database: DEV Docker container Docker volume mapped to file system with snapshots Database: DEV Docker container Database: DEV Docker container Shared databases
  • 33. © 2018 Delphix. Q & A marcin@delphix.com @pioro