Oracle Privileges Required by XWiki

Last modified by Eleni Cojocariu on 2026/11/25 14:49

Reference

Configure Oracle Manually grants the DBA role to the xwiki user, for simplicity. XWiki needs much less, and the groups below are the whole of it. They are not all needed at the same time: an instance that never creates a wiki never needs the last two.

To move an existing installation off the DBA role, follow Restrict the Privileges of the Oracle User.

Everyday operation

PrivilegeWhat XWiki does with it
CREATE SESSIONConnect to the database.
RESOURCECreate the tables, sequences and indexes of its own schema.
SELECT ANY TABLE, SELECT ANY SEQUENCERead the schema of any wiki of the farm.
INSERT ANY TABLE, UPDATE ANY TABLE, DELETE ANY TABLEWrite to the schema of any wiki of the farm.

The ANY forms cover the tables of the other wikis of the farm, which XWiki reaches through the same connection rather than by connecting as each wiki's own user.

Schema migrations

XWiki runs its schema migrations when it starts on a new version, and again for each wiki it creates. They create and alter tables in schemas the xwiki user does not own, so they need the ANY forms too.

PrivilegeWhat XWiki does with it
CREATE ANY TABLE, DROP ANY TABLE, ALTER ANY TABLEAdd, remove and reshape tables of a wiki's schema.
CREATE ANY INDEX, ALTER ANY INDEXAdd and reshape the indexes of those tables.
CREATE ANY SEQUENCEAdd the sequences those tables use.
GRANT CREATE ANY TABLE TO xwiki;
GRANT DROP ANY TABLE TO xwiki;
GRANT ALTER ANY TABLE TO xwiki;
GRANT CREATE ANY INDEX TO xwiki;
GRANT ALTER ANY INDEX TO xwiki;
GRANT CREATE ANY SEQUENCE TO xwiki;

Wiki creation

PrivilegeWhat XWiki does with it
CREATE USERCreate the Oracle user of a new wiki. Not needed when wiki.createDatabase is false.

Creating a wiki also runs the migrations above, so grant both groups together.

GRANT CREATE USER TO xwiki;

Wiki deletion

PrivilegeWhat XWiki does with it
DROP USERRemove the Oracle user of a deleted wiki, with the tables it owns.
GRANT DROP USER TO xwiki;

Returning to the everyday privileges

Each of the three groups above is used at a moment you choose, so it can be revoked once the wiki creation, the wiki deletion or the upgrade is over.

REVOKE CREATE USER FROM xwiki;
REVOKE DROP USER FROM xwiki;
REVOKE CREATE ANY TABLE FROM xwiki;
REVOKE DROP ANY TABLE FROM xwiki;
REVOKE ALTER ANY TABLE FROM xwiki;
REVOKE CREATE ANY INDEX FROM xwiki;
REVOKE ALTER ANY INDEX FROM xwiki;
REVOKE CREATE ANY SEQUENCE FROM xwiki;

FAQ

Is granting the DBA role wrong?

It is convenient rather than wrong, and it is what the installation steps do. It also lets the instance do anything to every schema of that Oracle database, which is worth avoiding on a server XWiki shares.

Which privilege is missing when Oracle answers ORA-01031?

ORA-01031: insufficient privileges names none. Read it against the groups above through what XWiki was doing: a failure while creating a wiki points at CREATE USER, one during the first start on a new version at the migration group.

Related

Get Connected