- Tools from Oracle, Quest, etc. may have VC capabilities, but you never know whether you'll have the tool available in any particular situation, and you never know when the workings of the tools will change beyond recognition. (I'm looking at you, Oracle.)
- The tools are separate from the mainstream of version control in software development - you're learning quirky specialty tools instead of widely-known industry standards.
- They lack some of the modern capabilities of distributed version control.
We're better off using standard software development VC.
But, of course, those tools are meant for text files, so there needs to be a handy way to get this stuff from DDL inside the database to version-controlled text files.It's easy with sqlpython 1.5.3
The new sqlpython commands svn, bzr, and hg all do the following:
- Create or update a directory tree, beginning at your current working directory, containing text files with the DDL for all the objects in your schema
- Put these files under version control and commit
For example,
testschema@orcl> !pwd
/home/catherine/oracle_vc
testschema@orcl> ls
NAME
--------------
INDEX/XPK_PLAY
TABLE/PLAY
2 rows selected.
testschema@orcl> bzr
added testschema
added testschema/index
added testschema/index/xpk_play.sql
added testschema/table
added testschema/table/play.sql
Committing to: /home/catherine/oracle_vc/
added testschema
added testschema/index
added testschema/table
added testschema/index/xpk_play.sql
added testschema/table/play.sql
Committed revision 1.
testschema@orcl> alter table play add (opening_night DATE);
Executed
testschema@orcl> bzr
bzr: ERROR: Already a branch: ".".
Committing to: /home/catherine/oracle_vc/
modified testschema/table/play.sql
Committed revision 2.
testschema@orcl> alter table play add (performances NUMBER(5,0));
Executed
testschema@orcl> create index xif1_play on play (opening_night);
Executed
testschema@orcl> bzr index/
bzr: ERROR: Already a branch: ".".
added testschema/index/xif1_play.sql
Committing to: /home/catherine/oracle_vc/
added testschema/index/xif1_play.sql
Committed revision 3.