SQL> SELECT TABLE_NAME,
2 PARTITIONING_TYPE TYPE,
3 P.SUBPARTITIONING_TYPE,
4 P.PARTITION_COUNT
5 FROM USER_PART_TABLES P
6 WHERE P.TABLE_NAME = 'P_PARTITION_RANG';
TABLE_NAME TYPE SUBPARTITIONING_TYPE PARTITION_COUNT
------------------------------ ------- -------------------- ---------------
P_PARTITION_RANG RANGE NONE 4
SQL> ANALYZE TABLE P_PARTITION_RANG validate structure cascade;
ANALYZE TABLE P_PARTITION_RANG validate structure cascade
*
ERROR at line 1:
ORA-14508: specified VALIDATE INTO table not found
[ID 111990.1] 中记录了这个错误,要手工执行utivalid.sql创建表INVALID_ROWS 后才可以执行。
SQL> @?/rdbms/admin/utivalid.sql
SP2-0310: unable to open file "/oracle/app/oracle10g/rdbms/admin/utivalid.sql"
SQL> @?/rdbms/admin/UTLVALID
SP2-0310: unable to open file "/oracle/app/oracle10g/rdbms/admin/UTLVALID.sql"
SQL> host more $ORACLE_HOME/rdbms/admin/utlvalid.sql
rem
Rem Copyright (c) 1990, 1995, 1996, 1998 by Oracle Corporation
Rem NAME
REM UTLVALID.SQL
Rem FUNCTION
Rem Creates the default table for storing the output of the
Rem analyze validate command on a partitioned table
Rem NOTES
Rem MODIFIED
Rem syeung 06/17/98 - add subpartition_name
Rem mmonajje 05/21/96 - Replace timestamp col name with analyze_timestamp
Rem sbasu 05/07/96 - Remove echo setting
Rem ssamu 01/09/96 - new file utlvalid.sql
Rem
create table INVALID_ROWS (
owner_name varchar2(30),
table_name varchar2(30),
partition_name varchar2(30),
subpartition_name varchar2(30),
head_rowid rowid,
analyze_timestamp date
);
SQL> create table INVALID_ROWS (
2 owner_name varchar2(30),
3 table_name varchar2(30),
4 partition_name varchar2(30),
5 subpartition_name varchar2(30),
6 head_rowid rowid,
7 analyze_timestamp date
8 );
Table created.
SQL> ANALYZE TABLE P_PARTITION_RANG validate structure cascade;
Table analyzed.