oracle - Deploy ddl as declarative xml states -
i'm working oracle database , many of have same problem deploying ddl statements not declarative.
i'm looking tool export table structures/sequences/constraints/indexes 1 instance xml file , import instance. import intelligent, mean if difference between importing table , existing 1 one new column added in schema, "alter table add column" executed. if column type changed "alter table modify" executed, missing tables/constraints/indexes created , on.
this way can version database state in declarative manner , store such xmls in version control system.
for i'm not looking lookup tables content, structures.
any suggestions?
i know of no such thing exists..
your first requirement of having xml representation of table relativley straightforward
create table my_table (col1 varchar2(10),col2 number(5,3), col3 date); table my_table created. set pagesize 500 set long 10000 select sys.dbms_metadata.get_sxml('table','my_table') dual; sys.dbms_metadata.get_sxml('table','my_table') -------------------------------------------------------------------------------- <table xmlns="http://xmlns.oracle.com/ku" version="1.0"> <schema>mi_par</schema> <name>my_table</name> <relational_table> <col_list> <col_list_item> <name>col1</name> <datatype>varchar2</datatype> <length>10</length> </col_list_item> <col_list_item> <name>col2</name> <datatype>number</datatype> <precision>5</precision> <scale>3</scale> </col_list_item> <col_list_item> <name>col3</name> <datatype>date</datatype> </col_list_item> </col_list> <physical_properties> <heap_table> <segment_attributes> <segment_creation_deferred></segment_creation_deferred> <pctfree>10</pctfree> <pctused>40</pctused> <initrans>1</initrans> <tablespace>users</tablespace> <logging>y</logging> </segment_attributes> <compress>n</compress> </heap_table> </physical_properties> </relational_table> </table> as converting delta that's left exercise reader.. :p
but seriously.. options passing xml script/procedure on destination database. compare, generate delta , eiterh output user or apply directly via dbms_sql/execute immediate
sorry if wasnt more help
Comments
Post a Comment