Database Management
Every Odoo environment on OEC.sh runs on its own dedicated PostgreSQL database, created automatically at deployment time and isolated from other environments. It stores all your Odoo business data: customers, products, invoices, orders, user accounts, configuration, installed modules, and attachment metadata.
Viewing Database Information
To see your database details:
- Go to Environments and select your environment
- Click the Settings tab
- Click the Database sub-tab
Here you will find:
- PostgreSQL optimization settings
- Connection pooling configuration
- Read replica status (Odoo 18+ only)
Health Indicators
OEC.sh monitors your database health automatically. In the environment overview you can see:
| Indicator | Meaning |
|---|---|
| Running | Database is running normally |
| Stopped | Database container is stopped |
| Error | Connection or configuration issue detected |
If you see an error status, try restarting the environment. If problems persist, check your server connectivity or contact support.
Backups
Your database is included in every backup. OEC.sh snapshots:
- All database tables and records
- Your filestore (attachments and images)
- Configuration files
See Backups for how to create and restore backups.
PgBouncer Connection Pooling
PgBouncer pools database connections, reducing overhead and improving performance for high-traffic environments.
Note: PgBouncer is available on Pro plans and above.
Enabling PgBouncer
- Go to your environment's Settings > Database tab
- Find the PostgreSQL Optimization panel
- Enable the PgBouncer toggle
- Configure pool size (default: 20)
- Save and redeploy your environment
Read Replicas
A read replica is a synchronized copy of your database that handles read-only queries (reports, dashboards) while the primary handles writes. This helps when you have many concurrent users or run complex reports.
Note: Read replicas are available on Pro plans and above, for Odoo 18.0+ only.
Requirements
- Odoo 18.0 or newer
- Pro plan or above
- Sufficient resource quota
Enabling a Read Replica
- Go to your environment's Settings > Database tab
- Find the PostgreSQL Optimization panel
- Check Enable Read Replica
- Click Save Settings
- Redeploy the environment to apply changes
- After redeployment, click Deploy Replica to deploy the read replica
- Wait for deployment to complete (usually 1-5 minutes)
Monitoring Replica Health
Once deployed, the Read Replica Status widget shows:
| Status | Description |
|---|---|
| Online | Replica is synchronized and healthy |
| Lagging | Replica is falling behind the primary database |
| Offline | Replica is disconnected |
| Error | Replication error occurred (see error details) |
The widget also displays:
- Lag (Bytes): Amount of WAL data not yet replicated
- Lag (Time): How far behind the replica is in seconds
- Last Checked: When the health check last ran
Lag thresholds:
- Warning: over 50MB or 15 seconds behind
- Critical: over 100MB or 30 seconds behind
If the replica shows a lagging, offline, or error status, you can rebuild it by clicking the Rebuild button.
Removing a Read Replica
If you no longer need the replica:
- Go to your environment's Settings > Database tab
- Click Remove in the Read Replica section
- Confirm the removal
Removing the replica does not affect your primary database.