Oracle Index – Does Rebuilding Update Last_DDL_Time Attribute?

indexoracle

I rebuilt an index and the last_ddl_time was modified, but I am not sure that's what caused it (someone else might have updated it in other way).

las_ddl_time is defined as follows in the Oracle documentation under ALL_OBJECTS:

Timestamp for the last modification of the object resulting from a DDL statement (including grants and revokes)

Thanks.

Best Answer

Yes.

SQL> alter session set nls_date_format='YYYY-MM-DD HH24:MI:SS';

Session altered.

SQL> create table tttt1(c1 number);

Table created.

SQL> create index iiii1 on tttt1(c1);

Index created.

SQL> select last_ddl_time from user_objects where object_name = 'IIII1';

LAST_DDL_TIME
-------------------
2018-05-07 16:32:46

SQL> alter index iiii1 rebuild;

Index altered.

SQL> select last_ddl_time from user_objects where object_name = 'IIII1';

LAST_DDL_TIME
-------------------
2018-05-07 16:33:10