Database in Read Only Mode
This page explains how xAssets behaves when the underlying database is set to read-only mode. Read-only mode is a temporary measure used during database maintenance, migrations, or when providing standby access to a secondary database.
When to Use Read-Only Mode
Common scenarios for running in read-only mode:
- Database maintenance -- while performing index rebuilds, integrity checks, or schema updates on the primary database, a read-only copy can keep users productive.
- Migration -- during a server migration, the source database can be set to read-only to prevent changes while data is transferred.
- Reporting standby -- a read-only replica can serve as a reporting database, allowing users to run queries without affecting the primary server's performance.
- Disaster recovery testing -- verifying that a restored backup is complete and functional before promoting it to the primary.
How to Enable Read-Only Mode
Read-only mode is set at the database level using SQL Server or MariaDB administration tools. It cannot be enabled or disabled from within the xAssets user interface.
In SQL Server:
ALTER DATABASE [xAssetsDB] SET READ_ONLY
To return to read-write mode:
ALTER DATABASE [xAssetsDB] SET READ_WRITE
Warning: Setting the database to read-only while users are connected will affect all active sessions immediately. Coordinate with users or perform the change during a maintenance window.
What Users Can Do in Read-Only Mode
Users can still:
- Log in and navigate the application.
- View dashboards and their charts and KPIs.
- Run queries, search for records, and browse assets in the asset editor.
- Export query results to Excel or PDF.
- View the full menu structure and navigate between profiles.
What Is Disabled
All data modifications are disabled:
- Users cannot save changes to any record in any table.
- User tracking and logging is suspended -- no login activity, menu history, or user preferences are recorded.
- Batch jobs, transformations, and scheduled tasks cannot write results.
- Discovery data loads cannot process.
- Any attempt to save or modify data will produce an error message.
Tip: Inform users before entering read-only mode so they can save any in-progress work. Changes made in forms but not yet saved will be lost if the user tries to save after the database enters read-only mode.
Returning to Normal Operation
When the maintenance or migration is complete:
- Set the database back to read-write mode using the SQL command above.
- Users may need to refresh their browser or log in again for full functionality to resume.
- Verify that scheduled batch jobs and transformations resume correctly by checking Admin > Batch > Batch Jobs.
Note: Read-only mode is intended for temporary use only. It is not designed for long-term operation and some system features (such as login tracking and user preference saving) will not function correctly while it is active.
Related Articles
- Batch Jobs — background jobs that cannot run in read-only mode
- User Logon History — login tracking that is suspended in read-only mode
- Settings — system settings that cannot be changed in read-only mode