I'm doing pretty serious operations on my DB and I would like to keep my data safe.
Unfortunately something is going wrong, look:
SAVEPOINT before_foo_update; CREATE TABLE AUX_FOO as SELECT * FROM FOO; TRUNCATE TABLE FOO; ALTER TABLE FOO MODIFY(BAR NUMBER(11) NOT NULL); INSERT INTO FOO SELECT * FROM AUX_FOO; DROP TABLE AUX_FOO; ROLLBACK TO SAVEPOINT before_foo_update;
Unfortunately I'm getting an error:
ROLLBACK TO SAVEPOINT before_foo_update Error report: SQL Error: ORA-01086: savepoint 'BEFORE_FOO_UPDATE' never established 01086. 00000 - "savepoint '%s' never established" *Cause: Trying to roll back to a save point that was never established
Now FOO table is empty... And AUX_FOO wasn't dropped. Do you know what I'm doing wrong?