oracle统计某个用户的对象个数
--统计某个用户下面的对象个数
--包括表,视图,同义词,函数,存储过程,包,触发器,索引,约束,序列。
SELECT
(SELECT COUNT(*) FROM USER_TABLES) AS TABLES,
(SELECT COUNT(*) FROM USER_VIEWS)AS VIEWS,
(SELECT COUNT(*) FROM USER_SYNONYMS)AS SYNONYMS,
(SELECT COUNT(*) FROM USER_OBJECTS WHERE OBJECT_TYPE=‘FUNCTION‘) AS FUNCTIONS,
(SELECT COUNT(*) FROM USER_OBJECTS WHERE OBJECT_TYPE=‘PROCEDURE‘) AS PROCEDURES,
(SELECT COUNT(*) FROM USER_OBJECTS WHERE OBJECT_TYPE=‘PACKAGE‘) AS PACKAGES,
(SELECT COUNT(*) FROM USER_OBJECTS WHERE OBJECT_TYPE=‘TRIGGER‘) AS TRIGGERS,
(SELECT COUNT(*) FROM USER_INDEXES) AS INDEXES,
(SELECT COUNT(*) FROM USER_CONSTRAINTS) AS CONSTRAINTS,
(SELECT COUNT(*) FROM USER_SEQUENCES) AS SEQUENCES
FROM DUAL
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。