top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration Why to Join

Facebook Login
Site Registration

How does one find the next value of a sequence in Oracle?

0 votes
56 views
How does one find the next value of a sequence in Oracle?
posted Jun 26, 2015 by Kunal Kapoor

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

Perform an "ALTER SEQUENCE ... NOCACHE" to unload the unused cached sequence numbers
from the Oracle library cache. This way, no cached numbers will be lost.
If you then select from the USER_SEQUENCES dictionary view, you will see the correct
high water mark value that would be returned for the next NEXTVALL call.
Afterwards, perform an "ALTER SEQUENCE ... CACHE" to restore caching.
You can use the above technique to prevent sequence number loss before a SHUTDOWN ABORT,
or any other operation that would cause gaps in sequence values.

answer Jun 30, 2015 by Arun Gowda
Contact Us
+91 9880187415
sales@queryhome.net
support@queryhome.net
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Bangalore-560102
Karnataka INDIA.
QUERY HOME
...