PL/SQL (MOSC)

MOSC Banner

How to avoid Oracle Sequence gap?

Hi All

Kindly, I need to create a sequence with no gap of 100%, what is the optimal way to achieve this?


as shown in this demo video, I created a Sequence with no cache and still, there is a chance to get a gap if there is any transaction did not commit due to any reason, is there is any way to avoid this?

https://youtu.be/ynlUtIGSP2Y


this is the steps I follow to produce the issue:


-- Create table

create table rep.t1(s1 number,a1 varchar2(100));

-- Create sequence

create sequence REP.seq1

minvalue 1

maxvalue 999999999

start with 1

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center