D
D
DigitalGod2013-12-03 16:17:55
Oracle
DigitalGod, 2013-12-03 16:17:55

What are the ways to link the Oracle database (packages, triggers, indexes, table structure, etc.) with the version control system (GIT, SVN)?

Good day to all.
The question has been brewing for a long time and now the time has come:
How can I link the Oracle database (packages, triggers, indexes, table structure, etc.) with the version control system (GIT, SVN)?

I know there are several software solutions (RedGate and Liquibase). Also comes the decision in the forehead - to register all objects in sql files and already bring them into version control.

I would like to know how you work with the database in a team? How is controlled what and who changed.

The main problem is to find out who changed a particular database object (there were sad precedents). In addition, of course, the transfer of data from develop to production.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
mrstrictly, 2013-12-03
@DigitalGod

If we are talking about a production database, then the most reliable and time-tested algorithm is perhaps the following:
1. Changes in the database are made in the form of a so-called. migrations. There are plenty of engines for implementing SQL migrations. In the simplest case, a migration is just a set of DDL/DML formatted as, for example, an SQL script.
2. Migrations are stored in VCS. You can see who made the changes.
3. In production, migrations are applied automatically under the control of the DBA, or by the hands of the DBA itself. The role of DBA can be performed by any responsible person, if you do not have a separate person in your state.
4. (bonus) After each migration application, the database schema in production is uploaded to the same VCS as a separate script and contains only DDL and reference data (example: data for filling the table of car brands, data for filling the table of countries, etc.) . This is useful for quickly deploying development environments in sync with the current production schema of the database.
Something like this.

G
Geny, 2013-12-05
@Geny

If "The main problem is to find out who changed a specific database object (there were sad precedents).", then you can hang a trigger on the schema and log changes DDL
CREATE OR REPLACE TRIGGER ddl_log_and_lock_trigger
AFTER
CREATE OR ALTER OR DROP
ON SCHEMA
BEGIN
.....
END;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question