Example Analysis of oracle sequence reaching the maximum value
This article mainly introduces the example analysis of the oracle sequence reaching the maximum value, which has a certain reference value, and interested friends can refer to it. I hope you will gain a lot after reading this article.
The client found that the sequence on a large table reached the maximum, reported an error and asked for help to check it.
Set linesize 180
Set long 90000
SELECT dbms_metadata.get_ddl ('SEQUENCE',' SEQUENCE_NAME','TABLENAME') FROM DUAL
It is estimated that the statement created at that time set the maximum value, which has now been reached, and the business rule does not allow loops:
Create sequence sequence_name start with 1 increment by 1 maxvalue 2147483647
What is the default maximum value for oracle? 999999999999999999999
Recommendations:
Adjust the sequence definition and specify a larger maximum value or use the default maximum value if the business does not allow recycling.
Alter sequence sequence_name nomaxvalue
Later, the default maximum value was used to solve the problem.
Thank you for reading this article carefully. I hope the article "sample Analysis of oracle sequence reaching the maximum value" shared by the editor will be helpful to everyone. At the same time, I also hope that you will support and pay attention to the industry information channel. More related knowledge is waiting for you to learn!