WHITEPAPER. Database DevOps with the Redgate Deployment Suite for Oracle

Similar documents
Continuous integration for databases using Red Gate tools

Redgate Database Lifecycle Management (DLM) vs SQL Server Data Tools (SSDT)

What is database continuous integration?

DEVOPSIFYING NETWORK SECURITY. An AlgoSec Technical Whitepaper

Improved Database Development using SQL Compare

1Copyright 2012, Oracle and/or its affiliates. All rights reserved.

Modernizing your database processes with DevSecOps

CASE STUDY IT. Albumprinter Adopting Redgate DLM

I keep hearing about DevOps What is it?

AEM Code Promotion and Content Synchronization Best Practices

Controlling Costs and Driving Agility in the Datacenter

Test Automation Strategies in Continuous Delivery. Nandan Shinde Test Automation Architect (Tech CoE) Cognizant Technology Solutions

Enabling Agile Database Development with Toad

COMPLIANCE AUTOMATION BRIDGING THE GAP BETWEEN DEVELOPMENT AND INFORMATION SECURITY

How to set up SQL Source Control The short guide for evaluators

DevOps, Continuous Integration & Automated Testing: Rule Them All

Automated Testing of Tableau Dashboards

Continuous Integration / Continuous Testing

Utilizing Fast Testing to Transform Java Development into an Agile, Quick Release, Low Risk Process

The Salesforce Migration Playbook

Accelerate Your Enterprise Private Cloud Initiative

Liquibase Version Control For Your Schema. Nathan Voxland April 3,

DevOps Anti-Patterns. Have the Ops team deal with it. Time to fire the Ops team! Let s hire a DevOps unit! COPYRIGHT 2019 MANICODE SECURITY

What is version control? (discuss) Who has used version control? Favorite VCS? Uses of version control (read)

Google Cloud & the General Data Protection Regulation (GDPR)

platform Development Process Optimization For Drupal centric projects

Continuous Integration Ensemble / HealthShare Health Connect

Sunil Shah SECURE, FLEXIBLE CONTINUOUS DELIVERY PIPELINES WITH GITLAB AND DC/OS Mesosphere, Inc. All Rights Reserved.

HP Application Lifecycle Management. Upgrade Best Practices

Migration. 22 AUG 2017 VMware Validated Design 4.1 VMware Validated Design for Software-Defined Data Center 4.1

The Seven Steps to Implement DataOps

Deployment Within a Traditional IT environment

Moving from a Paper to Paperless validation effort and how to get the most efficient mix of Manual vs. Automated testing.

CASE STUDY FINANCE. Republic Bank Streamlining database deployments with SQL Compare

ORACLE DATABASE LIFECYCLE MANAGEMENT PACK

Virtual protection gets real

SERVICE TRANSITION ITIL INTERMEDIATE TRAINING & CERTIFICATION

IBM s Integrated Data Management Solutions for the DBA

2018 Database DevOps Survey DBmaestro 1

THE TOP 5 DEVOPS CHALLENGES

BUILDING APPLICATION SECURITY INTO PRODUCTION CONTAINER ENVIRONMENTS Informed by the National Institute of Standards and Technology

Nicman Group Test Data Management 2.0 Leveraging Copy Data Virtualization Technology in QA for SQuAD. November 2016

Getting Started with Team Coding Applicable to Toad for Oracle Suite 2016 (v12.9) and higher

Orchestrating the Continuous Delivery Process

Best Practice for Creation and Maintenance of a SAS Infrastructure

Whitepaper. 3 reasons to invest in database source control

Javaentwicklung in der Oracle Cloud

Tips and Tricks for Organizing and Administering Metadata

cdsummit Continuous Delivery Seminars Automating the deployment process 9 th September 2014

The Danger of Invalid Database Objects

Version Control for PL/SQL

Jenkins: A complete solution. From Continuous Integration to Continuous Delivery For HSBC

How Can Testing Teams Play a Key Role in DevOps Adoption?

Dell helps you simplify IT

LEVERAGING VISUAL STUDIO TEAM SYSTEM 2008 Course LTS08: Five days; Instructor-Led Course Syllabus

COURSE BROCHURE. ITIL - Intermediate Service Transition. Training & Certification

A guide for assembling your Jira Data Center team

Duration: 5 Days Course Code: M20764 Version: B Delivery Method: Elearning (Self-paced)

[Docker] Containerization

White Paper(Draft) Continuous Integration/Delivery/Deployment in Next Generation Data Integration

Microsoft SQL Server

Data Virtualization Implementation Methodology and Best Practices

The Value of Migrating from Cisco Tidal Horizon to Cisco Process Orchestrator

JetBrains TeamCity Comparison

About HP Quality Center Upgrade... 2 Introduction... 2 Audience... 2

Git with It and Version Control!

CA Test Data Manager Key Scenarios

Upgrading to UrbanCode Deploy 7

Continuous Integration and Delivery with Spinnaker

Training 24x7 DBA Support Staffing. Administering a SQL Database Infrastructure (40 Hours) Exam

WHAT CIOs NEED TO KNOW TO CAPITALIZE ON HYBRID CLOUD

ORACLE SERVICES FOR APPLICATION MIGRATIONS TO ORACLE HARDWARE INFRASTRUCTURES

CASE STUDY FINANCE. ABSA Bank Introducing database automation with SQL Toolbelt

Continuous Integration. Johannes Seitz

WHO SHOULD ATTEND? ITIL Foundation is suitable for anyone working in IT services requiring more information about the ITIL best practice framework.

Weaving Security into Every Application

Focus On: Oracle Database 11g Release 2

Struggling to Integrate Selenium into Your Ice Age Test Management Tools?

CICD pipeline for your extensions with Visual Studio Team Services

The Time For IT Resilience Is NOW

Accelerate at DevOps Speed With Openshift v3. Alessandro Vozza & Samuel Terburg Red Hat

Administering a SQL Database Infrastructure

Service Lifecycle and Versioning SOA 2/2559

Configuration changes such as conversion from a single instance to RAC, ASM, etc.

Development Practice and Quality Assurance. Version Control. The first thing you should be told when you start a new job - Steve Freeman

Simplify Backups. Dell PowerVault DL2000 Family

Guide to Mitigating Risk in Industrial Automation with Database

Überraschend mehr Möglichkeiten. Orcas: Continuous Delivery for Databases. A Framework for Continuous Delivery in Database Environments.

JOB TITLE: Senior Database Administrator PRIMARY JOB DUTIES Application Database Development

Data is moving faster than ever, the volume of data is exploding, the

Disclaimer This presentation may contain product features that are currently under development. This overview of new technology represents no commitme

Backup and Recovery. Backup and Recovery from Redstor. Making downtime a thing of the past Making downtime a thing of the past

Ensuring Compliance with Data Privacy Directives using Virtual Databases

Strengthen and Scale security using DevSecOps

Best practices for OO 10 content structuring

ECONOMICAL, STORAGE PURPOSE-BUILT FOR THE EMERGING DATA CENTERS. By George Crump

DevOps Using VSTS and Azure

AWS Reference Design Document

Virtual Private Networks with Cisco Network Services Orchestrator Enabled by Tail-f - Fast, Simple, and Automated

"Charting the Course... MOC C: Administering an SQL Database Infrastructure. Course Summary

Transcription:

WHITEPAPER Database DevOps with the Redgate Deployment Suite for Oracle 1

Abstract Building great software is never just about the code. It s also about managing multiple teams, timelines, and frequently changing business or customer requirements. As organizations face increasing pressure to create and release software more rapidly, DevOps has emerged as an effective way to help teams collaborate and speed up the delivery cycle. At the heart of the DevOps approach is the concept of continuous delivery. Coupled with the cultural change that DevOps requires, continuous delivery enables teams to work together to produce software in short cycles so they no longer need to rely on big bang releases to provide value to customers. Instead, they have reliable and repeatable processes in place to provide a steadier stream of more frequent deployments, both increasing efficiency and reducing risk in the software release process. One of the biggest advantages is in automating the repetitive development and testing processes that database development teams use to deliver, manage, and maintain the database. From version controlling changes to deploying them to different environments, and, when ready, choosing to deploy to production, continuous delivery helps teams reduce risk and increase both efficiency and reliability in the software release process. This whitepaper explains how you can apply DevOps practices like continuous delivery to databases, and how Redgate tools for Oracle can support you along the way. 2

Contents There s more to DevOps than tooling but it can be a good place to star 4 Source control is the first step to continuous delivery and brings immediate, lasting advantages 5 Continuous Integration speeds up releases and reduces deployment problems 6 Release management is safer, easier, and matches the way you already work 7 Redgate Oracle tools as the building blocks for database DevOps 10 Version Control 10 Continuous Integration 11 Database Build 11 Invalid Objects 11 Unit Testing 11 Static Code Analysis 11 Release Management 12 Deployment artifacts 12 Orchestrating the deployment 12 Database Drift 12 Masking 13 Recovery 13 Conclusion 13 Resources and Further Reading 14 3

There s more to DevOps than tooling but it can be a good place to start Sharing common processes and tooling can be one of the best ways to open up communication channels between development and operations teams, paving the way for a culture of collaboration. Redgate offers a suite of Oracle tools that work alongside best of breed third party software, including CI build servers and release management tooling. These help to automate processes and make it possible to safely and quickly deliver database changes alongside application code. Support is available for the full database lifecycle from connected development, versioning, to automating the build, and deployment of database changes. DevOps is not all about automation but it enables fast feedback loops and encourages a culture of collaboration. James Betteley, Head of Education, DevOpsGuys 4

Source control is the first step to continuous delivery and brings immediate, lasting advantages Version controlling, or source controlling, database changes is the first and vital step to better database development practices. It ensures database development teams communicate their changes with others in the team, always have a version to roll back to if required, and maintain a solid audit trail. With the ability to share code, multiple people and teams can access pieces of code, or a database, at the same time. Introducing source control for databases, however, can be problematic if new tools enforce strict, unfamiliar procedures and compel database developers to work in a different way from application developers. This can make the divide between them wider rather than bridging it. The key is to integrate with existing application version control systems like Git, Team Foundation Server or Subversion, thereby making the most of the knowledge that already exists inside organizations. Source Control for Oracle, for example, allows developers to check in changes made directly in their development environments using their preferred IDE. Behind the scenes it scripts out files that represent the new state of each object and saves them to whichever version control system is in use. It also enables developers to check in static data, so teams can track any changes to, and migrate, any static data required for an application to function. (This might typically be non-transactional data that is updated infrequently, like a table of US states.) Every proposed change to your systems, whether to an application, your infrastructure, your database schema, or your build, test and deployment process itself, should be made via source control. Jez Humble, Continuous Delivery and ITIL: Change Management 5

Continuous Integration speeds up releases and reduces deployment problems Continuous integration (CI) is the process of ensuring that the code and related resources in a development project are integrated regularly and tested by an automated build system, allowing teams to detect problems early. A CI server uses a build script to execute a series of commands that build an application. Generally, these commands clean directories, run a compiler on source code, and execute automated tests. For applications that rely on a database backend, build scripts can be extended to perform additional tasks such as testing and updating a database. It s this process of generating, testing, and deploying the database build scripts that makes continuous integration for databases possible. With a DLM Automation license, included with Deployment Suite for Oracle, the Schema Compare command line can be used with existing CI build servers like Jenkins, Visual Studio Team Services, Bamboo or TeamCity. On each check-in to source control (or however often you set it to run), it takes care of the whole database CI process: It builds and validates the SQL creation scripts that represent the Desired State, which is necessary for the CI tool to deploy the changes. It syncs an existing database with the latest version in source control. It checks the production target for unexpected drift prior to deployment. "Whenever we have a successful build, by packaging the database artifacts along with the application artifacts, we have a complete and synchronized version history of both application and database." Martin Fowler and Pramod Sadalage, Evolutionary Database Design 6

Dev Requirements Trigger Dev Development Release management is safer, easier, and matches the way you already work Although the CI environment often mirrors the production environment as closely as possible for applications, this is rarely the case for databases. The artifact published at the CI stage therefore needs to be deployed against a staging database, which should be an exact copy of the production database, or as near as possible. This will generate an upgrade script for deployment, and the whole artifact can then be reviewed by the DBA to confirm it is production-ready. It is also a wise some would say essential move to check if there have been changes to the production database. Someone may have made a hotfix in an emergency, for example. To guard against deployment issues resulting from unexpected changes like these, which will have caused the database to drift from its expected (and therefore untested) state, a pre-deployment drift check must be employed. There are two deployment methodologies available when considering production deployments, manual and automated. These methodologies can be combined to form a hybrid process, or used alongside one other. This works so long as the source of truth for both manual and automated deployments is version control. For manual deployment Schema Compare for Oracle is used to generate a script to run against staging or acceptance. This practice deployment allows for a review step and is effectively a rehearsal for deployment. Should everything deploy as expected, the now validated deployment script should be used once more to update the production database. 7

Development Release Restore production Generate deployment script DBA review Backup Deploy Deploy ACCEPTANCE PRODUCTION Indicates where Redgate tooling or artifacts are in play A simple manual deployment pipeline Automated continuous delivery leverages continuous integration and release management tools. A deployment script is generated at release-time by comparing the versioned scripts folder containing the desired state against acceptance or another copy of production. DBAs can review the deployment SQL script alongside the change report and warnings report, and on approval, use the same script against production. Because automation is being used, many more test processes and validation checks can be included, affording increased confidence in the ultimate success of the release. 8

Development Continuous Integration Release Management Build Database Restore production Restore production Restore production Backup Drift check Drift check Mask Mask Trigger TEST Find invalid objects Upgrade Upgrade Warning check* Deploy DBA review Deploy Unit tests Static analysis INTEGRATION QA ACCEPTANCE PRODUCTION Automated tests Manual tests Rollback test Rollback Continuous feedback to development Indicates where Redgate tooling or artifacts are in play *High warnings suggest that scripts customization could be required An automated deployment pipeline As setting up an automated DevOps pipeline can appear daunting, the remainder of this document will run through the process, describing the rationale of each step along the way. 9

Redgate Oracle tools as the building blocks for database DevOps For each topic in this section there are worked examples and code samples on Redgate s Oracle DevOps documentation pages. Version Control There are few organizations that don t have a version control system in place today. Code versioning has long since been regarded as an indispensable development practice and has well-understood benefits: Object level history A mechanism to easily share changes between developers An audit trail of who made changes, what changed and when The ability to recover to a previous historic version Branching allows different workstreams to exist in parallel Version control stores the source of truth and is therefore a prerequisite for continuous integration and automated releases Unlike application code, the database has two key version control artifacts: the object code (tables, views, stored procedures), and the deployment scripts (the code that upgrades the existing database state to the next state). Source Control for Oracle unlocks all of the benefits of version control listed above, managing the schema state and its history in a folder structure in your version control system. Each object type has its own subfolder, which in turn contains one.sql creation script for each individual object. This scripts folder represents the desired state source of truth for subsequent deployments. Static data (lookup data, reference data, seed data) can also be source controlled alongside the schema objects, and deployed using Data Compare for Oracle. Upon deployment, the Schema Compare for Oracle engine compares the state represented in the scripts folder with the target database, calculating a dependency-aware deployment script to upgrade the target to the newer version. This script becomes the key deployment artifact that will be validated and re-used throughout the release pipeline. 10

Continuous Integration Whereas application code is compiled and unit tested as part of a CI process, database code can be used to build a database, can be checked for invalid objects, and as with application code, can be unit tested. Database Build By triggering an automated build when you check database changes into source control, you get early feedback on whether changes can be successfully built and have a stable current build consistently available. This is analogous to checking whether application code compiles. Schema Compare for Oracle can be tasked to build a database from the desired state scripts, along with a full database creation script. Invalid Objects The SQL that Schema Compare for Oracle generates in its deployment script is dependency-aware and are therefore changes are ordered accordingly. This reduces the chance of ending a deployment with uncompiled objects, and their associated performance-impacting runtime recompilation. However, an extreme class of uncompiled objects, invalid objects, exist simply because they can t compile. These come about if an object references a second object that has since been renamed or removed. Oracle itself is forgiving about the existence of invalid objects, and will not prevent a database from building successfully if they exist. This means that a separate build check is necessary to track them down so they can be fixed. Although invalid objects can often be spotted during the course of development, nothing prevents invalid objects from being inadvertently checked into version control, or as the by-product of a mismanaged branch merge. Unit Testing The established pattern for unit testing application code is to isolate the code under test using mocks and stubs. This means that the database layer is abstracted out of the tests and often gets excluded from the testing process, which introduces risk. To ensure that coverage includes the database code, a database unit testing framework such as utplsql can be employed. This exercises database objects, such as packages, functions, and procedures, and also benefits from code coverage reporting. Static Code Analysis Static code analysis checks inspect the code for smells, best practices, deprecated syntax and naming conventions. Static analysis tools offer a selection of rules that can be customized according to an organization s own chosen standards, conventions and policies. 11

Release Management Whereas the build and CI process is more concerned with testing, release management is focused on orchestration and supplying confidence that the deployment will occur predictably and safely. Confidence comes from having a review and approval step, where the deployment script can be scrutinized by an expert, and putting in place a reliable and repeatable process to orchestrate the deployments. Deployment artifacts The key deployment artifact is the SQL deployment script generated by Schema Compare for Oracle as this is what will eventually be run against production. Schema Compare for Oracle can also output a report detailing the full set of object changes with their respective before and after differences. The schema comparison engine can raise deployment warnings for changes that could lose data, or have potential to adversely impact the deployment and therefore warrant further inspection. Orchestrating the deployment While CI tools are great at building chains of dependent tasks to assemble, compile and test an application, release tools specialize in simplifying the process of provisioning environments and the orchestration of deployments, promoting changes through the pipeline all the way to production. The philosophy behind such tools is to build once, deploy many, which minimizes the number of moving parts, thereby strengthening the predictability of the deployment process. However, the one moving part that can be hard to control is the database itself. This is because the database suffers from a unique tendency to change out of process. This is known as database drift. Database Drift Database drift is the name given for unexpected structural change to a database. Databases can drift for a number of reasons - either because a deployment has been made outside the mandated process without informing the necessary stakeholders, or because a necessary emergency fix has been applied directly to production. The unpredictability of drift introduces high risk to the deployment process as it invalidates the integrity of the validation stages. If the state of the intermediate test databases differs from that of production, how can there be confidence that the production deployment will be successful? Schema Compare for Oracle can be used to check for drift throughout the release process, ensuring that if drift is detected, the process can be halted. 12

Masking With increasing regulatory need to safeguard the privacy of organizational data, particularly Personally Identifiable Information, data masking is emerging as a practical solution to both allow realistic data to be used in dev and test environments, while also obfuscating the sensitive data. Redgate Data Masker for Oracle can be leveraged to assist in the provisioning of development database instances, and environments further down the release pipeline. Recovery Although backups provide the most comprehensive recovery solution, Schema Compare for Oracle can be used to generate roll-back scripts and schema snapshots, allowing a rapid recovery mechanism for those circumstances where recovery wouldn t lose any data. Conclusion This whitepaper has demonstrated how database deployments can be faster, easier, and error-free by extending DevOps practices to databases. It has shown how development and operations teams can orchestrate database processes in order to better safeguard data. It has also highlighted the importance of continuous delivery for databases in encouraging the organization, and development and operations teams to work together to build and deliver great software. The very first step on this path to the continuous delivery of database changes starts at version controlling your database code. This vital step ensures that there is one source of truth for your CI build server to work from, enabling every committed change to be built and tested. Once teams have the database under version control, they can use further Redgate tools, together with their chosen CI build server, to continuously integrate and test each change committed. This speeds up releases to customers, reduces the risk of deployment problems, and frees developers from time-consuming, manual change management tasks. As part of this CI process, a database deployment artifact can be created and, with minimal effort, promoted through multiple environments using a release management tool. Importantly, your teams can continue using the software they re already familiar with, making the transition simple and easy. 13

Resources and Further Reading To find out more about the benefits of Database DevOps or learn how you can set up these processes for your team, please consult the following resources. Oracle Database DevOps (including worked examples) Deployment Suite for Oracle documentation Redgate Data Masker