您好,登錄后才能下訂單哦!
本篇內(nèi)容主要講解“user_objects視圖中created、last_ddl_time、timestamp字段是什么意思”,感興趣的朋友不妨來看看。本文介紹的方法操作簡(jiǎn)單快捷,實(shí)用性強(qiáng)。下面就讓小編來帶大家學(xué)習(xí)“user_objects視圖中created、last_ddl_time、timestamp字段是什么意思”吧!
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)建,沒有做關(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字段是什么意思”有了更深的了解,不妨來實(shí)際操作一番吧!這里是億速云網(wǎng)站,更多相關(guān)內(nèi)容可以進(jìn)入相關(guān)頻道進(jìn)行查詢,關(guān)注我們,繼續(xù)學(xué)習(xí)!
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。