user_objects——查看用户的所有对象!

查看表T是否被截断过:

SQL> select OBJECT_ID,DATA_OBJECT_ID,OBJECT_NAME from user_objects where OBJECT_NAME = 'T';

 OBJECT_ID DATA_OBJECT_ID OBJECT_NAME
---------- -------------- -------------------------
     73463          73463 T

SQL> truncate table t;

表被截断。

SQL> select OBJECT_ID,DATA_OBJECT_ID,OBJECT_NAME from user_objects where OBJECT_NAME = 'T';

 OBJECT_ID DATA_OBJECT_ID OBJECT_NAME
---------- -------------- -------------------------
     73463          73486 T

SQL> truncate table t;

表被截断。

SQL> select OBJECT_ID,DATA_OBJECT_ID,OBJECT_NAME from user_objects where OBJECT_NAME = 'T';

 OBJECT_ID DATA_OBJECT_ID OBJECT_NAME
---------- -------------- -------------------------
     73463          73486 T

SQL> truncate table t;

表被截断。

SQL> select OBJECT_ID,DATA_OBJECT_ID,OBJECT_NAME from user_objects where OBJECT_NAME = 'T';

 OBJECT_ID DATA_OBJECT_ID OBJECT_NAME
---------- -------------- -------------------------
     73463          73486 T
可以看见在表没有被truncate之前,OBJECT_ID和DATA_OBJECT_ID是一样的。在表T被truncate之后,OBJECT_ID和DATA_OBJECT_ID就不一样了。

你可能感兴趣的:(sql,object,user,table,TSQL)