edit sequence start with value

rcm

Member
Hello,

I am using PL/SQL developer 5.1.0.656. I have a question. Not sure how you guys are doing this but it's kind of cool.

If I'm logged on as a user who has create sequence privileges and I create a sequence in the command window:

create sequence junk increment by 2 start with 5;

How are you able to edit a sequence's "start with" value without dropping and recreateing the sequence? If I were to try this with a SQL alter sequence statement "alter sequence junk start with 10;", I get the standard error.

I notice that the last_ddl_time is updated in dba_objects but the created column remains unchanged. This is very misleading to a DBA who is trying to track down how the start with value is all of the sudden lower than the primary key column value of the table that the sequence populates.

Now make this even more misleading. Revoke the create sequence privilege from the user who created the sequence. Bring a new DBA into the group. Have the new DBA figure out how the user who does not have create sequence priviliges is still able to edit the sequences start with value through PL/SQL developer and the dba_objects created column remains the same while the last_ddl_time is updated.

How are you still able to edit the start with value of the sequence without dropping and recreating the sequence?
 
The start value is set by setting the increment to the difference between the current value and the new start value, reading the next value, and resetting the increment to its original value.

------------------
Marco Kalter
Allround Automations
 
Back
Top