Recreate of Sequences

In the current beta there is no possibility to recreate the sequences to change the next value

In the release version 13.1, there is a popup menu for that.

well, that didn’t take long. I was hoping to be able to get rid of that. An easy workaround is go to the script tab, get the drop/create script, and run it in the editor.

Be sure to choose the “start with minval” option, and include grants.

I’ll add back a way to do this in the “alter sequence” window.

Next beta, you can double-click the sequence from schema browser to open the “alter sequence” window, then check “Reset” and OK.

Unfortunately, this does not help me, because I do not have to reset the sequencings but have to set to a certain initial value.

That was quite easy so far and now this function should not exist anymore.

Why?

I just removed it because it didn’t seem very important. I guess I was wrong about that. I can bring it back like before. That’s why I do these things early in the beta cycle. :blush:

OK, it’s back again for next beta. I’ve reworked it a bit so that it uses the create/alter dialog in a new “drop/create” mode. We could now easily apply this idea to other object types if needed.

The menu item is back, but it does not work correctly. The sequences always start with 0

Where did you find the menu item? I’ve just downloaded and installed beta .81 and cannot find the menu item.
I’ve tried to figure out how to make the same functionallity with the ALTER menu but failed.
after opening the popup Isee the current parameter.
I tried to set the min value to 10 (“start with” was 6)- after click on OK I got ORA-04007.
Cancel and I was back in the popup.
There I’ve clicked on reset and the start with value was set to 10 (!)
then I’ve set the min value back to 1 and Click on OK again
Back in the schema browser it seemed it worked, but in fact the value wasn’t set to 10 but to 2 !!!
Also the info panel on the right was still showing 6.
I would like to have back the recreate sequence menu or a likewise functionalty on the alter popup.

I found it there

Mit freundlichen Grüßen

Stefan Graf

Prokurist

common solutions GmbH & Co. KG

Telefon: +49 234 5885 – 102

Fax: +49 234 5885 – 191

www.levitaio.de

www.storelogix.de

www.common-solutions.de

Deiters nutzt storelogix aus Überzeugung:

cid:image002.jpg@01D4AE71.15E2A760

grafik

That’s what I can see in 13.2.0.81

Kind regards,
Juergen

Hi,

Is it possible that you are not logged in to the scheme you selected?

Then it looks like this with me.

Mit freundlichen Grüßen

Stefan Graf

Prokurist

common solutions GmbH & Co. KG

Telefon: +49 234 5885 – 102

Fax: +49 234 5885 – 191

www.levitaio.de

www.storelogix.de

www.common-solutions.de

Deiters nutzt storelogix aus Überzeugung:

cid:image002.jpg@01D4AE71.15E2A760

Yes, indeed!
But that doesn’t Make any sense, as I’m logged in as a DBA which has all rights to create and alter any objects in any schemes…

Kind regards,
Juergen

The “Recreate Sequence” menu item will only appear if you are logged in as the owner of the sequence. I can add a check for drop/create/grant any sequence and enable it if all of those are present.

OK, next beta, the “Recreate Sequence” option will be available for sequences in other schemas if you have the following system privileges: CREATE ANY SEQUENCE, DROP ANY SEQUENCE, GRANT ANY OBJECT PRIVILEGE.

Hi,
Just tested the new beta and found the “Recreate Sequence” menu item. Unfortunately this function ignores the “Start With” value and always resets the sequence to 1…

Thanks. I see that and have fixed it for next beta.

Hi Juergen,

As you discovered with the ORA-04007, oracle won’t let you change minval to be greater than the current value. Nor can maxval be less than the current value. Nor can min value be less than maxvalue.

I’ve put some checks into the Alter Sequence window to warn you of this and not run any SQL.

Also, the non-drop-and-create method can’t get you back to the same state as dropping and recreating the sequence. It can only get you to the 2nd call of “NextVal”. This is because we alter the sequence to get it to loop around, but once it loops around, the first value of the sequence has already been used. The “Reset” option from the schema browser will drop and recreate the sequence (and redo the grants) to get you to the first value.

I’ve added a node to the top of the “alter” script to that effect.

Sorry for the confusion, and thanks for your patience.

-John