user6447827 user6447827 - 1 year ago 107
SQL Question

Unable to execute command [create sequence hibernate_sequence start with 1 increment by 1]

I am getting unsufficient privilages error while generating sequence.

@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "eventId_seq")
@SequenceGenerator(name = "eventId_seq", sequenceName = "Event_seq",allocationSize = 1)
private int eventId ;

and i have tried following commands using sys and XYZ user.

grant usage on sequence XYZ.eventId_seq to XYZ

it is giving me 'missing or invalid privilege' error.

Please help.

Answer Source

If sequence is in XYZ schema you don't need any grant to use it. But you may need grant to create sequence to user utilised to connect database (I guess it is XYZ):

grant create sequence to XYZ;
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download