flyway clean is not dropping Oracle scheduler jobs or programs #761
Comments
Could you add a small snippet containing the offending statements? This way I can make sure your case will be covered when we fix this. |
I"m not sure what you need - I included the error message I got back. I'll On Wed, May 21, 2014 at 10:28 PM, Axel Fontaine notifications@github.comwrote:
|
Yes
|
Is there a schedule or ETA for v3.1? I didn't find any info on flywaydb.org. Thank you! |
End of July |
Thanks so much! I'd like to contribute some code to your project at some On Wed, Jun 18, 2014 at 11:08 AM, Axel Fontaine notifications@github.com
|
Fixed with #799 |
Looks like this problem still exists in flyway 4.0.1 when pointing to Oracle 10G (10.2.0.4) as we are on one of the dev teams. (Same flyway scripts work fine on 11G) |
@johnlmorgan If the problem persists, please open a new issue containing clear steps how to reproduce as well as a possible solution. Pull request with test case welcome! |
I recently added a scheduler job and program to my development schema. When I tried to refresh the schema, I did a flyway clean, and then a flyway migrate.
I got the following error:
ERROR: Found non-empty schema "TESTDATA" without metadata table! Use init() or set initOnMigrate to true to initialize the metadata table.
When I dropped the job and program by hand, I was then able to run migrate again.
Note: I see the option -initOnMigrate, but this causes me two problems:
StackOverflow link for this problem:
http://stackoverflow.com/questions/23767341/flyway-clean-is-not-dropping-scheduler-jobs-or-programs
Thank you
Update:
Statements used to create the stored procedure
CREATE OR REPLACE PACKAGE CLEANUP AS
PROCEDURE DONIGHTLY;
END CLEANUP;
CREATE OR REPLACE PACKAGE BODY CLEANUP AS
PROCEDURE DONIGHTLY IS
BEGIN
-- blah blah blah
NULL;
END;
END CLEANUP;
Statement used to create the program:
BEGIN
SYS.DBMS_SCHEDULER.CREATE_PROGRAM
(
program_name => 'DO_NIGHTLY'
,program_type => 'STORED_PROCEDURE'
,program_action => 'CLEANUP.DONIGHTLY'
,number_of_arguments => 0
,enabled => FALSE
,comments => NULL
);
SYS.DBMS_SCHEDULER.ENABLE
(name => 'DO_NIGHTLY');
END;
Statement used to create the job:
BEGIN
SYS.DBMS_SCHEDULER.CREATE_JOB
(
job_name => 'TEST_CLEANUP'
,schedule_name => 'SYS.DAILY_PURGE_SCHEDULE'
,program_name => 'DO_NIGHTLY'
,comments => NULL
);
SYS.DBMS_SCHEDULER.SET_ATTRIBUTE
( name => 'TEST_CLEANUP'
,attribute => 'RESTARTABLE'
,value => FALSE);
SYS.DBMS_SCHEDULER.SET_ATTRIBUTE
( name => 'TEST_CLEANUP'
,attribute => 'LOGGING_LEVEL'
,value => SYS.DBMS_SCHEDULER.LOGGING_OFF);
SYS.DBMS_SCHEDULER.SET_ATTRIBUTE_NULL
( name => 'TEST_CLEANUP'
,attribute => 'MAX_FAILURES');
SYS.DBMS_SCHEDULER.SET_ATTRIBUTE_NULL
( name => 'TEST_CLEANUP'
,attribute => 'MAX_RUNS');
BEGIN
SYS.DBMS_SCHEDULER.SET_ATTRIBUTE
( name => 'TEST_CLEANUP'
,attribute => 'STOP_ON_WINDOW_CLOSE'
,value => FALSE);
EXCEPTION
-- could fail if program is of type EXECUTABLE...
WHEN OTHERS THEN
NULL;
END;
SYS.DBMS_SCHEDULER.SET_ATTRIBUTE
( name => 'TEST_CLEANUP'
,attribute => 'JOB_PRIORITY'
,value => 3);
SYS.DBMS_SCHEDULER.SET_ATTRIBUTE_NULL
( name => 'TEST_CLEANUP'
,attribute => 'SCHEDULE_LIMIT');
SYS.DBMS_SCHEDULER.SET_ATTRIBUTE
( name => 'TEST_CLEANUP'
,attribute => 'AUTO_DROP'
,value => FALSE);
SYS.DBMS_SCHEDULER.ENABLE
(name => 'TEST_CLEANUP');
END;
These are the statements I use to clean up the jobs by hand:
BEGIN
SYS.DBMS_SCHEDULER.DROP_JOB
(job_name => 'TEST_CLEANUP');
END;
BEGIN
DBMS_SCHEDULER.DROP_PROGRAM
(program_name => 'DO_NIGHTLY');
END;
The text was updated successfully, but these errors were encountered: