SQL和Oracle中统计数据库中表个数及表名

SQL中统计表的个数:

SELECT    count(*)  FROM    sysobjects    WHERE     XType='U'    //表个数

SELECT    count(*)  FROM    sysobjects    WHERE     XType= 'V'    //视图个数

SELECT    count(*)  FROM    sysobjects    WHERE     XType= 'P'    //存储过程个数

SQL获得表名:

SELECT name  FROM sysobjects WHERE XTYPE='U'

 

ORCALE中统计数据表的总个数:

SELECT    count(*)   FROM    dba_tables    WHERE     owner='用户名'    ————有DBA权限

SELECT    count(*)   FROM    all_tables     WHERE     owner='用户名'    ————普通用户权限

ORCALE获得表名:

SELECT    name    FROM    dba_tables    WHERE     owner='用户名' 

SELECT    name    FROM    all_tables     WHERE     owner='用户名' 

 

posted @ 2013-02-25 10:49  伊广源  阅读(601)  评论(0编辑  收藏  举报