Re: Creating builder sql script with sql
Date: 1997/11/04
Message-ID: <01bce901$4a9d6780$54110b87_at_clamagent>#1/1
Hi Don!
I wrote a PL/SQL package that reverse engineers a schema. You run it from
SQL*Plus. It prints syntactically correct CREATE…, ALTER…, GRANT…
statements for existing tables, secondary indexes, constraints, views,
synonyms, grants and sequence objects. It took me 3 weeks to write (along
with normal workload).
When I was doing the constraints part (foreign, primary, unique, check
(other than NOT NULL which were done in the create table section)), it
really helped to define the constraint and then examine the data dictionary
view dba_constraints to see what was actually stored and how it was
organized. It was a bit of effort, but I really learned a lot about it. I
compiled the package as SYS using the dba_* views so that any user could
reverse engineer any schema (and have just one global copy of the package
stored in the data dictionary).
- Dan Clamage
Don Fraser <don_at_clear.net.nz> wrote in article
<63nfu3$hou_at_granny.mac.co.nz>...
> I am aware that Database Designer and maybe Designer 2000 can build a
scipt
> from an existing database to recreate that database with tables,
triggers,
> sequences, synonyms etc all in place but;
> I would like to build a script from the system tables using sql. I think
I
> know how to do it although allowing for dependencies would take a fair
bit
> of time. Has someone done it or know someone who has.
Received on Tue Nov 04 1997 - 00:00:00 CET