本篇內(nèi)容主要講解“user_objects視圖中created、last_ddl_time、timestamp字段是什么意思”,感興趣的朋友不妨來(lái)看看。本文介紹的方法操作簡(jiǎn)單快捷,實(shí)用性強(qiáng)。下面就讓小編來(lái)帶大家學(xué)習(xí)“user_objects視圖中created、last_ddl_time、timestamp字段是什么意思”吧!
創(chuàng)新互聯(lián)主營(yíng)察哈爾右翼中旗網(wǎng)站建設(shè)的網(wǎng)絡(luò)公司,主營(yíng)網(wǎng)站建設(shè)方案,app軟件定制開(kāi)發(fā),察哈爾右翼中旗h5微信平臺(tái)小程序開(kāi)發(fā)搭建,察哈爾右翼中旗網(wǎng)站營(yíng)銷推廣歡迎察哈爾右翼中旗等地區(qū)企業(yè)咨詢
user_objects視圖中created、last_ddl_time、timestamp字段含意
created:對(duì)象的創(chuàng)建時(shí)間
last_ddl_time:跟對(duì)象相關(guān)的(不一定是改變對(duì)象的結(jié)構(gòu),也可以是其他相關(guān),如,如果此對(duì)象是表,則將該表的select權(quán)限賦給其他用戶也會(huì)改變這個(gè)字段的值)最后ddl操作的執(zhí)行時(shí)間
timestamp:對(duì)象自身結(jié)構(gòu)發(fā)生改變的時(shí)間,比如刪除字段、添加字段等
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.
--此時(shí)表剛創(chuàng)建,沒(méi)有做關(guān)于表的任何操作,則created、last_ddl_time、timestamp的值是一樣的
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:08:56:05
SQL> alter table t_obj_time add(col3 varchar2(30));
Table altered.
--給表新增一個(gè)字段后,則last_ddl_time、timestamp的值被更新,last_ddl_time、timestamp的值保持一致,但與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:08:57:23
SQL> grant select on t_obj_time to sys;
Grant succeeded.
--將表的select權(quán)限賦給sys用戶后,LAST_DDL_TIME字段再一次被更新,此時(shí)三個(gè)字段的值各不相同
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:08:57:23
到此,相信大家對(duì)“user_objects視圖中created、last_ddl_time、timestamp字段是什么意思”有了更深的了解,不妨來(lái)實(shí)際操作一番吧!這里是創(chuàng)新互聯(lián)網(wǎng)站,更多相關(guān)內(nèi)容可以進(jìn)入相關(guān)頻道進(jìn)行查詢,關(guān)注我們,繼續(xù)學(xué)習(xí)!