# Akka Persistence - ORA-00942: table or view does not exist

**URL:** <https://discuss.akka.io/t/akka-persistence-ora-00942-table-or-view-does-not-exist/8085>\
**Category:** Akka Libraries\
**Tags:** akka, java, configuration\
**Created:** [April 6, 2021, 7:00pm UTC](https://discuss.akka.io/t/akka-persistence-ora-00942-table-or-view-does-not-exist/8085 "2021-04-06T19:00:11Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![rrevi](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.akka.io/rrevi/32/2302_2.png) [@rrevi](https://discuss.akka.io/u/rrevi)\
**Post date:** [April 6, 2021, 7:00pm UTC](https://discuss.akka.io/t/akka-persistence-ora-00942-table-or-view-does-not-exist/8085/1 "2021-04-06T19:00:12Z")

</div>

Hello,

I am new to everything Akka. I’ve setup a POC project/app with Akka Persistence with an Oracle DB instance.

When I run the Akka app, I get the following error:

> akka.persistence.typed.internal.JournalFailureException: Exception during recovery from snapshot. PersistenceId [SomeActor|some-actor-01]. ORA-00942: table or view does not exist

Can someone help understand how to have Akka P auto generate the tables? or point me to some documentation 🙏🏽

Thanks in advance,  
Rafael

---

<div class="post-metadata">

**Author:** ![johanandren](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.akka.io/johanandren/32/85_2.png) [@johanandren](https://discuss.akka.io/u/johanandren)\
**Post date:** [April 7, 2021, 11:43am UTC](https://discuss.akka.io/t/akka-persistence-ora-00942-table-or-view-does-not-exist/8085/2 "2021-04-07T11:43:15Z")

</div>

Use `SchemaUtils`  
[https://doc.akka.io/docs/akka-persistence-jdbc/current/configuration.html#database-schema](https://doc.akka.io/docs/akka-persistence-jdbc/current/configuration.html#database-schema)

Note that it is not recommended to auto-generate tables for production environments.

---

<div class="post-metadata">

**Author:** ![rrevi](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.akka.io/rrevi/32/2302_2.png) [@rrevi](https://discuss.akka.io/u/rrevi)\
**Post date:** [April 7, 2021, 2:15pm UTC](https://discuss.akka.io/t/akka-persistence-ora-00942-table-or-view-does-not-exist/8085/3 "2021-04-07T14:15:57Z")

</div>

Thanks @johanandren !

Once I ran the [oracle-create-schemal.sql](https://github.com/akka/akka-persistence-jdbc/blob/v5.0.0/core/src/main/resources/schema/oracle/oracle-create-schema.sql) script, I kept getting the same error. Weird. So I decided to turn on DEBUG level log in logback.xml which made me realize this is the prepared statement which is causing the error:

> [2021-04-07 09:49:16,897] [DEBUG] [slick.jdbc.JdbcBackend.statement] [slick.db-1] - Preparing statement: select s94.s68, s94.s64, s94.s67, s94.s65, s94.s69, s94.s66, s94.s62, s94.s63, s94.s70 from (select “meta\_ser\_id” as s62, “meta\_ser\_manifest” as s63, “sequence\_number” as s64, “snapshot\_ser\_id” as s65, “snapshot\_payload” as s66, “created” as s67, “persistence\_id” as s68, “snapshot\_ser\_manifest” as s69, “meta\_payload” as s70 from “snapshot” where “persistence\_id” = ? order by “sequence\_number” desc) s94 where rownum \<= 1

If you compare the oracle-create-schema.sql file to the prepared statement above, it seems the create schema script is using **SNAPSHOT** as the name of the table/view where as the Akka app is referencing **snapshot**. I am wondering if the difference in case has something to do with this error?

---

<div class="post-metadata">

**Author:** ![rrevi](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.akka.io/rrevi/32/2302_2.png) [@rrevi](https://discuss.akka.io/u/rrevi)\
**Post date:** [April 7, 2021, 2:25pm UTC](https://discuss.akka.io/t/akka-persistence-ora-00942-table-or-view-does-not-exist/8085/4 "2021-04-07T14:25:46Z")

</div>

Perhaps the “incorrect table names” mentioned by @ning-nan [here](https://github.com/akka/akka-persistence-jdbc/issues/229) have something to do with this error/issue I am having (in which case it should obviously get fixed; either in the oracle-create-schema.sql script or in the [reference.conf](https://github.com/akka/akka-persistence-jdbc/blob/v5.0.0/core/src/main/resources/reference.conf) file)

---

<div class="post-metadata">

**Author:** ![johanandren](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.akka.io/johanandren/32/85_2.png) [@johanandren](https://discuss.akka.io/u/johanandren)\
**Post date:** [April 7, 2021, 2:45pm UTC](https://discuss.akka.io/t/akka-persistence-ora-00942-table-or-view-does-not-exist/8085/5 "2021-04-07T14:45:07Z")

</div>

Not sure if name case has anything to do with it, can’t say I have any Oracle specific knowledge here, but, there was at least one recent oracle related fix recently (5.0.1) [Oracle schema bug: wrong attribute name · Issue #502 · akka/akka-persistence-jdbc · GitHub](https://github.com/akka/akka-persistence-jdbc/issues/502) so I’m guessing once that was fixed it worked at least for that PR author (it’s possible he didn’t use snapshots though).

---

<div class="post-metadata">

**Author:** ![rrevi](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.akka.io/rrevi/32/2302_2.png) [@rrevi](https://discuss.akka.io/u/rrevi)\
**Post date:** [April 7, 2021, 3:13pm UTC](https://discuss.akka.io/t/akka-persistence-ora-00942-table-or-view-does-not-exist/8085/6 "2021-04-07T15:13:19Z")

</div>

Thanks again @johanandren !

Yeah, I just confirmed that the table names and columns are case sensitive in Oracle DB; I overwrote the **jdbc-snashot-store.tables.snaphot.tableName** field in my application.conf file and it got me passed the issue; perhaps the reference to

```auto
include "oracle-schema-overrides.conf"

```

in [Configuration • Akka Persistence JDBC](https://doc.akka.io/docs/akka-persistence-jdbc/current/configuration.html) does that exactly. Now if that file would be available somewhere for future developers to avoid running into this issue.

---

<div class="post-metadata">

**Author:** ![johanandren](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.akka.io/johanandren/32/85_2.png) [@johanandren](https://discuss.akka.io/u/johanandren)\
**Post date:** [April 7, 2021, 3:32pm UTC](https://discuss.akka.io/t/akka-persistence-ora-00942-table-or-view-does-not-exist/8085/7 "2021-04-07T15:32:01Z")

</div>

Please open up an issue in the [akka-persistence-jdbc issue tracker](https://github.com/akka/akka-persistence-jdbc/issues) about this, thanks!

---

<div class="post-metadata">

**Author:** ![rrevi](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.akka.io/rrevi/32/2302_2.png) [@rrevi](https://discuss.akka.io/u/rrevi)\
**Post date:** [April 7, 2021, 4:04pm UTC](https://discuss.akka.io/t/akka-persistence-ora-00942-table-or-view-does-not-exist/8085/8 "2021-04-07T16:04:04Z")

</div>

> <https://github.com/akka/akka-persistence-jdbc/issues/523>
>
> Versions used
> Akka version: 2.6.13
> akka-persistence-jdbc version: 5.0.0
> Expected Behavior
> Run the oracle-create-schema.sql script on a Oracle DB instance
> Run a Akka app with persistence without...
