Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

ORA-02289: sequence does not exist

Posted on 2011-02-24
5
Medium Priority
?
6,437 Views
Last Modified: 2012-05-11
I've inherited another developer's code and this query:

select id_seq.nextval from dual

Is causing this error:

ORA-02289: sequence does not exist
02289. 00000 -  "sequence does not exist"
*Cause:    The specified sequence does not exist, or the user does
           not have the required privilege to perform this operation.
*Action:   Make sure the sequence name is correct, and that you have
           the right to perform the desired operation on this sequence.
Error at Line: 1 Column: 7

I'm pretty sure the user has the required privileges to run this query. How can I fix this?

Thanks.
0
Comment
Question by:greddin
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 74

Accepted Solution

by:
sdstuber earned 2000 total points
ID: 34971216
3 possibilities

the sequence really does not exist   - check dba_sequences
the user you are using doesn't have privileges   -check dba_tab_privs
a synonym pointing to the sequence doesn't exist  - check dba_synonyms
0
 
LVL 74

Expert Comment

by:sdstuber
ID: 34971249
it must be at least 1 of those 3.

When looking for existence, check for misspellings including possible case sensitivity.

For example did somebody create the sequence as "id_seq"  instead of id_seq?  
0
 

Author Comment

by:greddin
ID: 34971687
Thanks, do I need to use a system user to access and view these dba_sequences, dba_tab_privs, and dba_synonyms tables?

0
 
LVL 74

Expert Comment

by:sdstuber
ID: 34971801
you will need to have privileges to read those,  doesn't necessarily mean SYSTEM or other DBA users though.


you can try using the "ALL_" versions instead of "DBA_" versions of the views, but, those are based on permissions.  So, if you don't have permission to read the object then you won't see them in the ALL_ views either, thus giving a false-negative.

If you don't have permission yourself, ask have to ask your DBA or another privileged user to do it for you.
0
 

Author Closing Comment

by:greddin
ID: 34972926
The sequence didn't exist on this database yet. DBA migrated them over now and all is good.

Thanks for your help.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
Via a live example, show how to take different types of Oracle backups using RMAN.
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question