Need answer for the situation on RAC
A reader, January 19, 2017 - 8:35 am UTC
Thx for your response, yes we understand. This is a situation in a customer environment where we can't change code or test anything right now, hence these questions.
To explain the situation further - we use the reset because the seqs are used in Truncate/Reload ETLs run daily so that the numbers don't grow indefinitely.
For the seq in question we see that the increment is stuck at -9mil even though the table only loads 3 mil rows.
So we think the increment is set incorrectly in the proc because of the different curr values on different nodes.
This problem occurred after long successful production time, after something (crash, hang) happened in one of the nodes.
We mainly need an answer to these questions below.
MAIN QUESTIONS:
On RAC, you have two nodes with cached seq ids like this: node 1:1-100, node 2:101-200.
You call nextval from node 1. You can get say 10, but from node 2 you can get 120.
Now, if you call the reset proc from node 1, what will you get as a result of step 3 ? Is it 0 (10-10) or 110 (120-10) ?
Will node 1 reset it to 0 even though the curr val on node 2 is 120 ?
Basically, do you have to be aware of the highest taken curr val across all nodes to correctly set the negative increment ?
How can you even find out about the seq status from one node on a different node ?
January 20, 2017 - 12:11 pm UTC
"Basically, do you have to be aware of the highest taken curr val across all nodes to correctly set the negative increment ? "
My point is this - you *always* run the risk of getting a negative, whether its RAC or single instance. The issue is if the sequence is in use when you do the reset. If it is - then the risk is there. All you can do *reduce* the risk, not eliminate it.
Indirection
lh, January 19, 2017 - 8:50 am UTC
Hi
One way to reset sequences is to use synonym which is actually pointing to sequence. And then You change the synonym to point to another sequence.
January 20, 2017 - 12:11 pm UTC
True - but you do run the risk of invalidations