Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm getting "ORA-00990: missing or invalid privilege" on this kind of statement:

GRANT USAGE ON SEQUENCE SOME_SEQUENCE TO SOME_USER;

I've researched this all over the Internet and AFAICT, this syntax is absolutely correct, the name of the sequence is correct, the user is correct, and similar grants for table access work just fine, but I just can't grant access to the sequence. And if SOME_USER does try to call the sequence, I get the dreaded "ORA-00942: table or view does not exist".

Adding insult to injury is that this used to work, but the IT people recreated the database (no, I don't know what exactly they did, and they probably don't either) and now this is happening.

Anyone have any idea what I'm doing wrong?

Answer: @Gary pointed me in the right direction; the actual syntax is:

 GRANT SELECT ON SOME_SEQUENCE TO SOME_USER;

Curiously, I had already tried:

 GRANT SELECT ON SEQUENCE SOME_SEQUENCE TO SOME_USER;

and got the error "ORA-00905: missing keyword", which is a curious message when the problem is an extra keyword.

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

The Oracle documentation doesn't show the existence of a 'USAGE' privilege. I've never used anything other than a SELECT privilege on a sequence.

That syntax does show up for Postgres/DB2

share|improve this answer
    
Thanks! I also updated my question with the correct syntax in full. –  Joshua Frank Jan 4 '12 at 13:26
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.