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

你可能感兴趣的:(Orcale数据库)