Documentation — Commands reference

lock

Locks a table or the cluster. unlock removes the lock.

Syntax

lock table TABLE_NAME;
unlock table TABLE_NAME;
lock cluster;
unlock cluster;

lock table

A locked table refuses all writes: insert, update, delete, truncate. Reading remains possible. You need the LOCK privilege on the table.

Use it to:

  • make a consistent backup (dump table requires it);
  • repair the table (repair table);
  • run several selects that must see the same data.

lock cluster

A locked cluster refuses every change of the dictionary: no new table, user or broker, no change of structure. Only administrators can lock and unlock it. It is required before create masterbroker and drop databroker.

Unfinished deployments

A deployment that ended with failures leaves its table locked. Do not unlock it to use it: see deploy.

← insert  |  repair →