如何查询Oracle数据库以显示Oracle数据库中所有表的名称?


当前回答

当前用户登录模式中的表

select * from tabs;

其他回答

    select object_name from user_objects where object_type='TABLE';

---------------- 或 ------------------

    select * from tab;

---------------- 或 ------------------

    select table_name from user_tables;

下面的查询只列出了所需的数据,而其他的答案给了我额外的数据,这只会让我感到困惑。

select table_name from user_tables;

要获得所有的表名,我们可以使用:

Select  owner, table_name  from all_tables;

如果你有dba权限,你可以使用:

Select owner, table_name from dba_tables;

试试下面的数据字典视图。

tabs
dba_tables
all_tables
user_tables

尝试从user_tables中选择,其中列出了当前用户拥有的表。