Document Type | Technical Information
Category | Administration
Document Number | TADTI087
Overview
In Tibero DBMS, by default, it is possible to grant the TRUNCATE privilege to other users.
You can grant the TRUNCATE privilege on a specific table or on all tables. To do this, you must first enable the
USE_TRUNCATE_PRIVILEGE parameter. This article introduces how to enable this parameter.NoteTheUSE_TRUNCATE_PRIVILEGEparameter can be set starting from Tibero 5 r73542 version and above.
Procedure
Setting the USE_TRUNCATE_PRIVILEGE Parameter
Check the USE_TRUNCATE_PRIVILEGE Parameter
USE_TRUNCATE_PRIVILEGE parameter is initially set to NO by default.SQL> show parameter USE_TRUNCATE_PRIVILEGE NAME TYPE VALUE ---------------------------- -------- ----------------------------------------- USE_TRUNCATE_PRIVILEGE Y_N NO
In this state, granting TRUNCATE privilege on specific tables is not possible.
SQL> grant truncate on testtable to testuser; TBR-7002: Unsupported DDL.
Also, granting the truncate any table privilege, which allows truncating all tables, is not possible.
SQL> grant truncate any table to testuser; TBR-7002: Unsupported DDL.
Change the USE_TRUNCATE_PRIVILEGE Parameter Value
USE_TRUNCATE_PRIVILEGE parameter value should be set to YES as shown below.USE_TRUNCATE_PRIVILEGE is a dynamic parameter, so it can be changed while the system is running.SQL> alter system set USE_TRUNCATE_PRIVILEGE=Y; System altered. SQL> grant truncate on testtable to testuser; Granted. SQL>grant truncate any table to testuser; Granted. SQL>