The GET_PREFS function obtains the default value of the specified preference.
Syntax
DBMS_STATS.GET_PREFS (
pname IN VARCHAR2,
ownname IN VARCHAR2 DEFAULT NULL,
tabname IN VARCHAR2 DEFAULT NULL)
RETURN VARCHAR2;
Parameters
| Parameter | Description |
|---|---|
| pname | The name of the preference. |
| ownname | The username. If the username is set to NULL, the current logon username is used by default. |
| tabname | The name of the table. |
Exceptions
| Error code | Description |
|---|---|
| ORA-20000 | The resource manager is not started and statistics cannot be collected. |
| ORA-20001 | The input value is invalid. |
Examples
Obtain the default value of the GRANULARITY parameter in thetbl1 table of the testUser01 user.
obclient> SELECT DBMS_STATS.GET_PREFS ('GRANULARITY','testUser01','tbl1') FROM DUAL;
+----------------------------------------------------------+
| DBMS_STATS.GET_PREFS ('GRANULARITY','testUser01','tbl1') |
+----------------------------------------------------------+
| AUTO |
+----------------------------------------------------------+
1 row in set