Get the App
SLTechnology News&Howtos  ›  Database  › 

What do the created, last_ddl_time, timestamp fields mean in the user_objects view

Shulou Source: shulou.com Published: 2022-05-31 15:11:46 09月10日 Update

The main content of this article is to explain "what is the meaning of created, last_ddl_time and timestamp fields in user_objects view". Interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn what the created, last_ddl_time and timestamp fields mean in the user_objects view.

Meaning of created, last_ddl_time, timestamp fields in user_objects view

Created: the creation time of the object

Last_ddl_time: related to the object (not necessarily changing the structure of the object, but also other related, for example, if the object is a table, assigning select permission to the table to other users will also change the value of this field) the execution time of the last ddl operation

Timestamp: the time when the structure of the object changes, such as deleting fields, adding fields, etc.

SQL > conn dasong/dasong

Connected.

SQL > create table t_obj_time

2 (

3 col1 varchar2 (20)

4 col2 varchar2 (20)

5)

Table created.

SQL > col object_name for A20

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

Session altered.

If the table has just been created and no operation has been done on the table, the values of created, last_ddl_time and timestamp are the same.

SQL > select object_name, created, last_ddl_time, timestamp from user_objects where object_name='T_OBJ_TIME'

OBJECT_NAME CREATED LAST_DDL_TIME TIMESTAMP

T_OBJ_TIME 2012-02-10 08:56:05 2012-02-10 08:56:05 2012-02-10-02-10 purl 08 purl 56 purl 05

SQL > alter table t_obj_time add (col3 varchar2 (30))

Table altered.

-- after adding a field to the table, the values of last_ddl_time and timestamp are updated, and the values of last_ddl_time and timestamp remain the same, but are no longer the same as created

SQL > select object_name, created, last_ddl_time, timestamp from user_objects where object_name='T_OBJ_TIME'

OBJECT_NAME CREATED LAST_DDL_TIME TIMESTAMP

T_OBJ_TIME 2012-02-10 08:56:05 2012-02-10 08:57:23 2012-02-10-02-10 purl 08PUR 57 JV 23

SQL > grant select on t_obj_time to sys

Grant succeeded.

After the select permission of the table is assigned to the sys user, the LAST_DDL_TIME field is updated again, and the values of the three fields are different.

SQL > select object_name, created, last_ddl_time, timestamp from user_objects where object_name='T_OBJ_TIME'

OBJECT_NAME CREATED LAST_DDL_TIME TIMESTAMP

T_OBJ_TIME 2012-02-10 08:56:05 2012-02-10 08:57:49 2012-02-10-02-10 purl 08PUR 57 JV 23

At this point, I believe you have a deeper understanding of "what created, last_ddl_time, and timestamp fields mean in user_objects view". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Tags: Field object view meaning time same content permission user structure learning update practical deeper consistent three interest meaning practicality reality Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple Shulou Information macOS OPPO Reno MySQL