Home » SQL & PL/SQL » SQL & PL/SQL » error in using dbms_stats.gather_table_stats
|
Re: error in using dbms_stats.gather_table_stats [message #112137 is a reply to message #112128] |
Wed, 23 March 2005 03:52   |
 |
Barbara Boehmer
Messages: 9106 Registered: November 2002 Location: California, USA
|
Senior Member |
|
|
Are you sure that you have the correct partition name? Your code works fine for me. Using a non-existent partition name produces the error that you are getting. Please see the demonstration below.
scott@ORA92> create table client
2 (col1 number)
3 partition by range (col1)
4 (partition under300000000 values less than (300000000),
5 partition final values less than (maxvalue))
6 /
Table created.
scott@ORA92> select partition_name from user_tab_partitions where table_name = 'CLIENT'
2 /
PARTITION_NAME
------------------------------
UNDER300000000
FINAL
scott@ORA92> exec dbms_stats.gather_table_stats ('SCOTT', 'CLIENT')
PL/SQL procedure successfully completed.
scott@ORA92> exec dbms_stats.gather_table_stats ('SCOTT', 'CLIENT', 'UNDER300000000')
PL/SQL procedure successfully completed.
scott@ORA92> exec dbms_stats.gather_table_stats ('SCOTT', 'CLIENT', 'NONEXISTENT_PARTITION')
BEGIN dbms_stats.gather_table_stats ('SCOTT', 'CLIENT', 'NONEXISTENT_PARTITION'); END;
*
ERROR at line 1:
ORA-20000: Unable to analyze TABLE "SCOTT"."CLIENT" NONEXISTENT_PARTITION, insufficient privileges
or does not exist
ORA-06512: at "SYS.DBMS_STATS", line 9127
ORA-06512: at "SYS.DBMS_STATS", line 9150
ORA-06512: at line 1
scott@ORA92>
|
|
|
|
|
|
|
|
Goto Forum:
Current Time: Sat Jul 12 14:05:54 CDT 2025
|