17,377
社区成员
发帖
与我相关
我的任务
分享
--视图(可查看拥有者、对象名称、创建时间、上次修改时间)
SELECT t.OWNER, t.OBJECT_NAME, t.CREATED, t.LAST_DDL_TIME FROM user_objects t;
SELECT t.OWNER, t.OBJECT_NAME, t.CREATED, t.LAST_DDL_TIME FROM all_objects t;
SELECT t.OWNER, t.OBJECT_NAME, t.CREATED, t.LAST_DDL_TIME FROM dba_objects t;
--ORACLE不自动跟踪操作的用户,如果有此要求,需要打开审计功能。
--all_objects视图
SQL> desc all_objects;
Name Type Nullable Default Comments
-------------- ------------ -------- ------- ----------------------------------------------------------------------------
OWNER VARCHAR2(30) Username of the owner of the object
OBJECT_NAME VARCHAR2(30) Name of the object
SUBOBJECT_NAME VARCHAR2(30) Y Name of the sub-object (for example, partititon)
OBJECT_ID NUMBER Object number of the object
DATA_OBJECT_ID NUMBER Y Object number of the segment which contains the object
OBJECT_TYPE VARCHAR2(19) Y Type of the object
CREATED DATE Timestamp for the creation of the object
LAST_DDL_TIME DATE Timestamp for the last DDL change (including GRANT and REVOKE) to the object
TIMESTAMP VARCHAR2(19) Y Timestamp for the specification of the object
STATUS VARCHAR2(7) Y Status of the object
TEMPORARY VARCHAR2(1) Y Can the current session only see data that it placed in this object itself?
GENERATED VARCHAR2(1) Y Was the name of this object system generated?
SECONDARY VARCHAR2(1) Y Is this a secondary object created as part of icreate for domain indexes?
SQL> select object_name,object_id,object_type,status,created
2 from all_objects
3 where owner=upper('scott')
4 /
OBJECT_NAME OBJECT_ID OBJECT_TYPE STATUS CREATED
------------------------------ ---------- ------------------- ------- -----------
DEPT 49047 TABLE VALID 2004-03-10
PK_DEPT 49048 INDEX VALID 2004-03-10
EMP 49049 TABLE VALID 2004-03-10
PK_EMP 49050 INDEX VALID 2004-03-10
BONUS 49051 TABLE VALID 2004-03-10
SALGRADE 49052 TABLE VALID 2004-03-10
VIEW_EMP_DEPT 51184 VIEW VALID 2011-04-08