What is OracleToGit

OracleToGit is a simple tool for making comprehensible version controlled backups of your database in form of DDL queries.

To make the long story short, it is a demon script which exports your database DDL scripts in realtime and allows you to track changes in code of your triggers, tables, packages, fuctions, views, etc.

You will be able to see, who changed your code, when he did it and what exactly he has done. For example, that’s how it looks on bitbucket:
3a9e8b895cc0236fdff5e2e3785b0c25[1]

We don’t recommend installing this tool for production database – it may have some impact both on security and performance. However, this is very useful for developer database – you will never lose any cool code again!

Yeah, just in case – OracleToGit does not store any DML (data from tables). This ridiculously large task must be accomplished with expdp utility, rman, tape drives and etc. And – belive me – you just don’t need your DML in version control system.

Are you interested? Ready to give it a try? Let’s go to the installation guide!

One thought on “What is OracleToGit

  1. Liam

    Great tool that I’m using just to do a DB extract … thanks.
    I’ve fixed a bug in your Job extraction as it wasn’t writing files for me – I tried to use Git to upload the source but got rejected, so here’s a patch file instead :
    From 76abae85a0ee4261d8da0339766775f656bb3d1b Mon Sep 17 00:00:00 2001
    From: Liam Drew
    Date: Fri, 19 Aug 2016 14:35:55 +1200
    Subject: [PATCH] Fixed bug that was stopping job files from being written


    oracle_magic.php | 5 +++–
    1 file changed, 3 insertions(+), 2 deletions(-)

    diff –git a/oracle_magic.php b/oracle_magic.php
    index 3b03bb7..8f82690 100644
    — a/oracle_magic.php
    +++ b/oracle_magic.php
    @@ -1091,8 +1091,9 @@ function update_job($bkp_dir, $name, $owner, $this_update_begin_time)
    if ($owner === ‘SYS’) #sys job source is not available
    return;
    $owner_dir = $bkp_dir . ‘data/’ . strtolower($owner) . ‘/’;
    – @mkdir($owner_dir, 0777, 1);
    – $file = $owner_dir . ‘job/’ . $name . ‘.sql’;
    + $file_dir = $owner_dir . ‘job/’;
    + @mkdir($file_dir, 0777, 1);
    + $file = $file_dir . $name . ‘.sql’;
    if (@filemtime($file) < $this_update_begin_time) //if no file or it is older then current session
    {
    if ($f = get_job($name, $owner))

    2.9.2.windows.1

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

CAPTCHA ImageReload Image