概述
--统计某个用户下面的对象个数
--包括表,视图,同义词,函数,存储过程,包,触发器,索引,约束,序列。
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
最后
以上就是冷艳苗条为你收集整理的统计某个用户下面的对象个数的全部内容,希望文章能够帮你解决统计某个用户下面的对象个数所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复