Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagesql
titleUpdate Sequences
/* Neither of these is fully tested. After it is better tested, then this should become part of step 9 or 10. */

/* Option 1. Benefit of this version: simpler.  */
DROP SEQUENCE SEQ_LOADID;
CREATE SEQUENCE SEQ_LOADID START WITH <old_sequence_val noted in step 9>;
DROP SEQUENCE SEQ_BATCHID;
CREATE SEQUENCE SEQ_BATCHID START WITH <old_sequence_val noted in step 9>;
/* Do not forget to re-grant permissions as needed. */

 
/* Option 2. Benefit of this alternate version: the sequence does not get dropped, so its permissions remain unchanged. */ 
ALTER SEQUENCE REFRESH_DEV_REPOSITORY.SEQ_LOADID INCREMENT BY <old_sequence_val noted in step 9, by difference needed for DEV to exceed PROD's LoadID>;
select REFRESH_DEV_REPOSITORY.SEQ_LOADID.nextval from dual;
ALTER SEQUENCE REFRESH_DEV_REPOSITORY.SEQ_LOADID INCREMENT BY 1;
select REFRESH_DEV_REPOSITORY.SEQ_LOADID.nextval from dual;

ALTER SEQUENCE REFRESH_DEV_REPOSITORY.SEQ_BATCHID INCREMENT BY <old_sequence_val noted in step 9, by difference needed for DEV to exceed PROD's BatchID>;
select REFRESH_DEV_REPOSITORY.SEQ_BATCHID.nextval from dual;
ALTER SEQUENCE REFRESH_DEV_REPOSITORY.SEQ_BATCHID INCREMENT BY 1;
select REFRESH_DEV_REPOSITORY.SEQ_BATCHID.nextval from dual;
/* No need to re-grant permissions because the sequences were not dropped. */
 

...