11.2.0.3.0 comment 操作不再是ddl操作???

aaqwsh發表於2011-11-08

SQL> create table test(i int);

 

Table created

 

物件的 LAST_DDL_TIME

SQL> select aa.OBJECT_NAME,to_char(aa.LAST_DDL_TIME,'yyyy-mm-dd hh24:mi:ss')  from user_objects aa where aa.OBJECT_NAME='TEST'

  2  ;

 

OBJECT_NAME                                                                      TO_CHAR(AA.LAST_DDL_TIME,'YYYY

-------------------------------------------------------------------------------- ------------------------------

TEST                                                                             2011-11-08 15:23:42

 

SQL> SELECT COUNT(*) FROM TEST;

 

  COUNT(*)

----------

         0

 

驗證sql的執行計劃:

SQL>

SQL> select aa.SQL_TEXT,aa.LAST_LOAD_TIME,aa.LAST_ACTIVE_TIME from v$sql aa

  2    where upper(aa.SQL_TEXT) like '%SELECT COUNT(*) FROM TEST%'

  3  ;

 

SQL_TEXT                                                                         LAST_LOAD_TIME                                            LAST_ACTIVE_TIME

-------------------------------------------------------------------------------- --------------------------------------------------------- ----------------

 select aa.SQL_TEXT,aa.LAST_LOAD_TIME,aa.LAST_ACTIVE_TIME from v$sql aa   where  2011-11-08/15:26:24                                       2011-11-8 15:26:

 SELECT COUNT(*) FROM TEST                                                       2011-11-08/15:26:03                                     2011-11-8 15:26:

 

執行 comment操作:

SQL>  comment on column TEST.i is 'test';

 

Comment added

 

物件的 LAST_DDL_TIME

SQL> select aa.OBJECT_NAME,to_char(aa.LAST_DDL_TIME,'yyyy-mm-dd hh24:mi:ss')  from user_objects aa where aa.OBJECT_NAME='TEST';

 

OBJECT_NAME                                                                      TO_CHAR(AA.LAST_DDL_TIME,'YYYY

-------------------------------------------------------------------------------- ------------------------------

TEST                                                                             2011-11-08 15:23:42

 

驗證sql的執行計劃是否還存在:

SQL> select aa.SQL_TEXT,aa.LAST_LOAD_TIME,aa.LAST_ACTIVE_TIME from v$sql aa

  2  where upper(aa.SQL_TEXT) like '%SELECT COUNT(*) FROM TEST%';

 

SQL_TEXT                                                                         LAST_LOAD_TIME                                            LAST_ACTIVE_TIME

-------------------------------------------------------------------------------- --------------------------------------------------------- ----------------

 select aa.SQL_TEXT,aa.LAST_LOAD_TIME,aa.LAST_ACTIVE_TIME from v$sql aa   where  2011-11-08/15:26:24                                       2011-11-8 15:26:

 select aa.SQL_TEXT,aa.LAST_LOAD_TIME,aa.LAST_ACTIVE_TIME from v$sql aa where up 2011-11-08/15:27:42                                       2011-11-8 15:27:

 SELECT COUNT(*) FROM TEST                                                       2011-11-08/15:26:03                                       2011-11-8 15:26:

 

版本:

SQL> select * from v$version;

 

BANNER

--------------------------------------------------------------------------------

Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

PL/SQL Release 11.2.0.3.0 - Production

CORE    11.2.0.3.0      Production

TNS for Linux: Version 11.2.0.3.0 - Production

NLSRTL Version 11.2.0.3.0 - Production

 

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/758322/viewspace-710444/,如需轉載,請註明出處,否則將追究法律責任。

相關文章