Generate upgrade script to ALTER TABLE based on CR

2019-08-10 09:12发布

This question already has an answer here:

Is it possible in Oracle to generate a bunch of ALTER TABLE statements based on existing table in schema plus CREATE TABLE statement with newer definition of that table?

Let's say I have a schema with some previous version of an application. I have an installation script for newest version of the application. The script creates all tables and sequences from scratch performing CREATE TABLE (and probably CREATE SEQUENCE) statements.

I'd like to update the schema to the newest version of the application without loosing any data (e.g. without performing DROP TABLE).

Is it possible with using of standard Oracle 11gR2 or third party components?

2条回答
欢心
2楼-- · 2019-08-10 09:30

You can create a procedure in PLSQL to:

  • create new table when it not exists in new DB
  • alter table when it exists, feeding it with ALL_TAB_COLUMNS
查看更多
何必那么认真
3楼-- · 2019-08-10 09:32

You can try CORT : www.softcraftltd.co.uk/cort It's free

查看更多
登录 后发表回答