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?

Jon Heller
  • 34,999
  • 6
  • 74
  • 132
filip_j
  • 993
  • 1
  • 14
  • 22

3 Answers3

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.

Community
  • 1
  • 1
Alex Poole
  • 183,384
  • 11
  • 179
  • 318
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.

TechnoCrat
  • 710
  • 10
  • 20
  • 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. – Jon Heller Feb 26 '15 at 03:28
  • @JonHeller its sequence not synonyms. :) – TechnoCrat Feb 26 '15 at 03:51
  • 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. – Jon Heller Feb 26 '15 at 06:46
  • Hmm agree ...! @JonHeller – TechnoCrat Feb 26 '15 at 08:56
0

enter image description here

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

TechnoCrat
  • 710
  • 10
  • 20