Setting up a persistence in an Oracle database
In the quick start guide, you worked on a persistence in YAML files. Now let's see how to set up a database persistence, in this case using Oracle.
Defining the type of persistence
When working on the creation of cluster, you saw that the persistence definition was isolated in its own YAML file. You must therefore set up the database connection in this file :
northwind.connectionstring.yaml:
# Persistence type
PersistenceType: Oracle
# The connection string that includes the source database name, and other parameters needed to establish the initial connection
ConnectionString: DATA SOURCE=[SERVER IP OR NAME]/[LISTENER];PERSIST SECURITY INFO=True;USER ID=[USER];PASSWORD=[PASSWORD]
Generating the database
The database will automatically be created/updated as soon as the neos server is launched:
neos run
Filtered indexes on Oracle
Oracle has no native partial or filtered index. A filter (OracleFilter) is therefore allowed only on a unique index, where Neos emulates it as a function-based unique index (CASE WHEN <filter> THEN <column> END). This preserves partial-uniqueness semantics but brings no query-optimization benefit. A filter on a non-unique Oracle index is a validation and generation error.
With unquoted identifiers (Database:QuotedIdentifiers = false), Oracle upper-cases string-literal values when storing the function-based-index expression, so a string-literal filter on a filtered unique index is not fully supported in that mode (it may be recreated on each migration). The default quoted-identifier mode is unaffected; prefer numeric/non-string conditions for filtered unique indexes on unquoted-identifier Oracle clusters.
See Filtered indexes for the full authoring model and the per-engine support matrix.