Restrict the Privileges of the Oracle User
Last modified by Eleni Cojocariu on 2026/11/25 14:49
Content
Steps
Replace the DBA role that Configure Oracle Manually grants with the smaller set of privileges XWiki actually requires:
- Stop XWiki.
- Connect to Oracle as a DBA or system user, for example with SQL*Plus.
sqlplus system/<password>@//localhost:1521/<service name> - Revoke the DBA role from the xwiki user.
REVOKE DBA FROM xwiki; - Grant the privileges XWiki needs for everyday operation.
GRANT CREATE SESSION TO xwiki; GRANT RESOURCE TO xwiki; GRANT SELECT ANY TABLE TO xwiki; GRANT SELECT ANY SEQUENCE TO xwiki; GRANT INSERT ANY TABLE TO xwiki; GRANT UPDATE ANY TABLE TO xwiki; GRANT DELETE ANY TABLE TO xwiki; - Grant the schema migration privileges, which XWiki uses while starting to bring the tables to the shape of the version you run.
- Start XWiki and wait for it to finish starting.
- Revoke the schema migration privileges again.
- Open your wiki in a browser and save a page. The wiki serves and saves as before, and no ORA-01031: insufficient privileges error appears in the XWiki log.
FAQ
How do I create or delete a wiki once the privileges are restricted?
Grant the wiki creation or wiki deletion group before the operation and revoke it afterwards. The statements are in Oracle Privileges Required by XWiki.
Do I have to keep repeating this after an upgrade?
Only the migration group, and only while XWiki starts on the new version. The everyday privileges granted here are permanent.
TWhat if the wiki starts but a feature fails with ORA-00942?
ORA-00942: table or view does not exist is what a missing SELECT ANY TABLE looks like from inside XWiki, because Oracle hides tables the user cannot read rather than refusing the read. Check the everyday group first.