Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

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

2025-04-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

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!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report