質問

I have a spring batch admin application. We recently tried to increase security by creating new oracle users with minimal privileges. After replacing the user for the spring batch application, I get this error.

exception: org.springframework.dao.DataAccessResourceFailureException: Could not obtain sequence value; nested exception is java.sql.SQLException: ORA-00942: table or view does not exist

After looking through the application and tomcat log, I've found that the application tries 3 times to execute this query before throwing the error.

SELECT JOB_INSTANCE_ID, JOB_NAME from BATCH_JOB_INSTANCE where JOB_NAME = ? and JOB_KEY = ? I tried this same query from sql developer, with the values stated in the log, and it came back with no results -but completed successfully. (no table not found error.)

I tried searching the log for instances of the same JOB_KEY, thinking there would be an insert statement, but i see none in this log.

Is there anyone familiar with Spring Batch that can help me verify what privileges the oracle user needs? Our new user does not have create or drop privileges. Can you help me verify that those are require, and why. -Meaning is it creating and dropping temporary tables? I tried to find this in the different log files but I've been unsuccessful so far.

Thanks!

役に立ちましたか?

解決

The error indicates that it can't find a sequence value. That would lead me to believe that the new db id you have has access to the tables, but not the sequences. The Oracle schema for Spring Batch has three sequences it uses beyond the tables: BATCH_STEP_EXECUTION_SEQ, BATCH_JOB_EXECUTION_SEQ, and BATCH_JOB_SEQ.

他のヒント

Please check your context.xml file for proper Database Type.It could be you are using My/Sql in Code whereas actual DB is Oracle.
property name="databaseType" value="oracle"

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top