2

I try to change the value of LAST_NUMBER in a sequence in sql developer v4 using the graphical interface only. When I click the edit icon next to the value I am unable to change the field. What I see is following:

enter image description here

My question is: is there a way to edit the value inline using only the graphical interface?

1
  • Your user probably doesn't have the proper grants to do so. Commented Feb 25, 2015 at 17:49

3 Answers 3

4

You can't change LAST_NUMBER, it's the database's internal record of the highest value reserved in the cache and written to disk for crash recovery. You generally can't (and shouldn't) change anything in the data dictionary.

If you want to reset the sequence to 1 then you can change the increment to a negative value (equal to the current value) and call nextval, then change the increment back to 1; or drop and recreate the sequence; or from 12c you can explicitly restart it. Since you're on 11g see How do I reset a sequence in Oracle?.

You could do some of that from the SQL Developer object viewer, but not in one step. You can change the increment by clicking on the edit button right under the 'details' tab, but would then have to call nextval somewhere else before changing back. And you could drop the sequence from the 'actions' drop-down, but then you'd need to recreate it as a separate action.

Sign up to request clarification or add additional context in comments.

Comments

0

you can get sql from 3rd tab of added in current snap given and change initial value from it and create sequence again with same name to reset it from 1.

4 Comments

It's usually not a good idea to drop and recreate synonyms if it can be avoided. The synonyms may have custom privileges that are lost from a drop.
@JonHeller its sequence not synonyms. :)
Woops, sorry. As you can guess, I meant to say sequences. I've occasionally ran into problems where we had to sync them up with the table values. Dropping and recreating was easier in a way, but we usually forgot to re-grant the privileges to roles and users.
Hmm agree ...! @JonHeller
0

enter image description here

click on marked edit button and enter value to start with in "Start with" textbox.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.