During post-refresh, one or more of the following issues occur:
Microsoft SQL Server:
The table sequences are stored in a one row table with a prefix of CMN_SEQ. Below are examples of checking the sequence for common tables. This is not inclusive of all table sequences.
select * from CMN_SEQ_PRTASK;
select max(prid) FROM PRTASK;
select * from CMN_SEQ_PRTEAM;
select max(prid) from PRTEAM;
select * from CMN_SEQ_PRTIMEENTRY;
select max(prid) from PRTIMEENTRY;
If the above query returns a lower number than the bottom query, then the table sequence number is out of sync with the maximum data record id.
The next table sequence number will need to be updated using an update statement.
Here is an example:
update CMN_SEQ_PRTASK
set last_id = ??????? (here you can enter a number 1000 higher than the max id from the prtask table)
After updating the LAST_ID column, restart the APP and BG services. Often the old sequence value is cached in memory on the application server, therefore a restart will be needed to ensure that the new value in the database is used.
Oracle:
In Oracle many sequences are stored in a standard oracle sequence. Most of which are standardized as the <tablename> followed by an _S1 suffix.
SELECT TABLE_NAME_S1.nextval FROM dual ;
SELECT MAX(ID) FROM TABLE_NAME ;
If the top query returns a lower number than the bottom query then the table sequence number is out of sync with the maximum data record Id. This will need to be updated. You can run the sequence check again (perhaps several times) because each time it is executed, the actual table sequence value is increased by 1.
Alternatively, to increase the next value in the sequence by a higher amount, run the 4 following queries one by one (replace TABLE_NAME with actual table name) :
ALTER SEQUENCE TABLE_NAME_S1 increment by 10000; --- Use a bigger number here if the MAX(ID) is over 10,000 greater than the next value in the sequence.
SELECT TABLE_NAME_S1.nextval FROM dual;
ALTER SEQUENCE TABLE_NAME_S1 increment by 1;
SELECT TABLE_NAME_S1.nextval FROM dual;
Note: You must run all four statements one by one