The own database in Oracle#
Empowerment Center stores its own data (the metadata, security, workbooks, the portal, the audit, sessions) in its own database, which by default is a PostgreSQL. If your organization has its data in Oracle and does not want to maintain another engine, the own database can be an Oracle schema, in the same database as the data or in another one. This page only says what changes: everything else about the installation applies the same.
Before you start#
- You need whoever administers the Oracle database: the ECenter user is created in it.
- The way to install is the same: with Docker Compose, with another orchestrator or without containers. Only where the three own database variables point to changes.
- PostgreSQL is still the default engine and that of the sample installation. The engine is chosen at installation: ECenter does not come with a tool to move to Oracle an installation that already works on PostgreSQL, or the other way round.
- An installation has a single own database, with all its connections. Connections do not change: with the own database in Oracle you can still analyze SQL Server or PostgreSQL databases.
Requirements#
| What | Requirement |
|---|---|
| Version | Oracle Database 19c or later, in any edition. |
| Character set | The database in AL32UTF8. |
| Options | None: no Spatial, Text or Partitioning. |
| User | A single one for ECenter, owner of its schema, with four privileges and quota in its tablespace (below). |
The PostGIS and pg_trgm extensions, which the own database requires in PostgreSQL, are not needed.
The ECenter user#
In Oracle a schema is a user: the tables of the own database will be those of the user you create for ECenter. An example, best adapted to your standards (the name, the tablespace and the quota):
CREATE USER ecenter IDENTIFIED BY "change-this-key" DEFAULT TABLESPACE users QUOTA UNLIMITED ON users;
GRANT CREATE SESSION, CREATE TABLE, CREATE SEQUENCE, CREATE TRIGGER TO ecenter;
- It needs
CREATE SESSION,CREATE TABLE,CREATE SEQUENCEandCREATE TRIGGER, and quota in its tablespace. - Do not give it any more: neither
DBAnorSELECT ANY TABLE. - With them, ECenter creates its schema on the first start and updates it on starting each new version.
Warning
It is not the data user. The user with which each connection queries the customer's data is another one, and it cannot read the ECenter schema: do not give it privileges on its tables or SELECT ANY TABLE. Administrators write SQL that runs with the connection's user (SQL lists, metadata expressions), and with that privilege it would reach ECenter's users, encrypted credentials and audit. ECenter watches for it when saving and testing each connection and with a critical alert: see The connection user and the own database.
Configuration#
The engine is chosen with the URL of the own database. No other property says it: it comes from the URL, which must start with jdbc:postgresql: or jdbc:oracle:.
| Variable | Value |
|---|---|
ECENTER_DB_URL |
jdbc:oracle:thin:@//<server>:1521/<service> |
ECENTER_DB_USER |
The user of the ECenter schema (ecenter in the example). |
ECENTER_DB_PASSWORD |
Its password. |
- Without containers, the three go in the service's environment file (see Install without containers).
- With Docker Compose,
deploy/compose.yamlbrings its own PostgreSQL (thedbservice) and setsECENTER_DB_URLandECENTER_DB_USERitself. To use your organization's Oracle, the backend must receive the three variables with the details of that Oracle, and thedbservice is not needed.deploy/compose.oracle.yamlshows how to do it with an added Compose file (see Try it with Docker Compose).
The first time it starts, the backend creates the ECenter schema (in Oracle, a few seconds) and, as the database has no users, the first administrator. Then continue with The license and First start and go-live, as in any installation.
What is checked at startup#
Before creating anything in the database, the backend checks:
- that the Oracle version is 19c or later;
- that the database character set is
AL32UTF8; - that its user has
CREATE TABLE,CREATE SEQUENCEandCREATE TRIGGER(its own or through a role) and quota in its tablespace.
If any is not met, the backend does not start and its log says which, with all the missing privileges. It is checked beforehand because in Oracle a schema creation that fails halfway is not undone. The messages are in Startup, license and access.
Sessions and space#
| What | With the own database in Oracle |
|---|---|
| Sessions | Those of the backend pool: 10 per instance by default (SPRING_DATASOURCE_HIKARI_MAXIMUM_POOL_SIZE), as in PostgreSQL. Count them in the database's PROCESSES and SESSIONS, for each backend instance (see Resources, jobs and queries). |
| Settings of each session | On opening, each session sets NLS_COMP and NLS_SORT to BINARY and the period as decimal separator, so that nothing depends on the language of the backend's machine. |
| Space | What grows is the audit, the kept data of cubes, the frozen versions of the portal and the geographic layers with their tiles. Documents are stored in CLOB columns and kept data in BLOB. |
| Operations console | The Own DB card of the Summary gives the Engine with its version and the Schema (see The operations console). |
If you give the pool its own session initialization SQL (spring.datasource.hikari.connection-init-sql), ECenter keeps it and does not set these settings: include them in it.
What is different from PostgreSQL#
The application is the same: the same screens, the same API and the same rules. This changes:
| What | With the own database in Oracle |
|---|---|
| Maps | They use neither PostGIS nor Oracle Spatial. The geometry is calculated by the application, and each tile is stored the first time it is requested. A file in another reference system is only accepted if it is on a list (see Geographic layers). |
| Contains in the audit | It has no text index: it goes through the entries of the requested period. Without a From, if it does not finish in 10 seconds (ecenter.audit.contains-timeout) it is cut off, and the screen then asks to narrow the dates (see Search, filter and export). |
| Text order | Where the application itself does not sort them, it is binary: uppercase before lowercase and accented letters at the end. |
| Backups | With Oracle's tools, not PostgreSQL's (see Backups and restore). |
| Upgrades | A migration that fails halfway is not undone: the backup before upgrading is not optional (see Upgrade to a new version). |
| Connections | If the own database is in the same database as the data, a connection's user cannot see the ECenter schema (see Prepare the database). |
Try it with Docker Compose#
deploy/compose.oracle.yaml is added to deploy/compose.yaml and starts the application with an Oracle Free in a container, instead of PostgreSQL:
- It removes the
dbservice and adds theoracleservice (the imagegvenzl/oracle-free:23-slim-faststart, pinned by its digest), with its data in theoracle-datavolume and a memory limit of 3 GB (ECENTER_DB_MEMORY). - The first time it starts, with the volume empty,
deploy/oracle-init/20-ecenter.shcreates theecenteruser with the privileges on this page and the password fromECENTER_DB_PASSWORD. Oracle does not accept every character in a password without quotes: use letters, digits and_,#or$. - The backend waits for Oracle to be healthy and signs in with
jdbc:oracle:thin:@//oracle:1521/FREEPDB1and theecenteruser.
The rest is as in Install with Docker Compose: the same deploy/.env, the same steps and the same checks.
Important
It is for trying it out, not for production: in production, the Oracle database is the organization's, with its backups and its administration.