问题
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?
回答1:
You can try CORT : www.softcraftltd.co.uk/cort It's free
回答2:
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
来源:https://stackoverflow.com/questions/28678190/generate-upgrade-script-to-alter-table-based-on-create-table-statement-in-oracle