SET_TABLE_PREFS

2023-12-25 08:49:42  Updated

The SET_TABLE_PREFS procedure sets the statistics preferences of a table owned by the specified user.

Syntax

DBMS_STATS.SET_TABLE_PREFS (
  ownname    IN  VARCHAR2,
  tabname    IN  VARCHAR2,
  pname      IN  VARCHAR2,
  pvalue     IN  VARCHAR2);

Parameters

Parameter Description
ownname The username. If the username is set to NULL, the current logon username is used by default.
tabname The name of the table.
pname The name of the preference.
pvalue The value of the preference.

Exceptions

Error code Description
ORA-20000 The object does not exist, or you do not have the required privileges.
ORA-20001 Input values are invalid.

Considerations

  • To call this procedure, you must connect to the database as the specified user, or have the SYSDBA privilege.

  • The parameters of this procedure are of the VARCHAR2 type and their values must be enclosed with parentheses.

Examples

Set the default value of DEGREE to 128 for the statistics collection strategy of tbl1 of the testUser01 user.

obclient> CALL DBMS_STATS.SET_TABLE_PREFS('testUser01', 'tbl1', 'DEGREE', '128');
Query OK, 0 rows affected

Contact Us