统计某个用户下面的对象个数
包括表,视图,同义词,函数,存储过程,包,触发器,索引,约束,序列。
1. sql语句
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
2. 执行结果
手机扫一扫
移动阅读更方便
你可能感兴趣的文章