I have to copy tables from an Oracle database to a db2 v7 one, and in order to do this (avoiding millions of drops and creates) I'd like to know if db2 has a feature like Oracle to enable / disable constraints temporarily without dropping them.
Thanks in advance, Mauro.
You can do:
ALTER TABLE <table-name> ALTER FOREIGN KEY <constraint-name> NOT ENFORCED
and then to re-enable:
ALTER TABLE <table-name> ALTER FOREIGN KEY <constraint-name> ENFORCED
http://publib.boulder.ibm.com/infocenter/mptoolic/v1r0/index.jsp?topic=/com.ibm.db2tools.ama.doc.ug/amacric0.htm
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With