从 oracle 数据库中获取所有表

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9979863/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 00:42:02  来源:igfitidea点击:

Getting all tables from an oracle database

sqloracle

提问by Brandon Wamboldt

I'm trying to retrieve a list of tables from an Oracle connection. I'm not very familiar with Oracle terminology and thus, having hard time finding the information I need.

我正在尝试从 Oracle 连接中检索表列表。我不太熟悉 Oracle 术语,因此很难找到我需要的信息。

Right now I can use Microsoft Access to connect via ODBC and it pops up with a "Link Tables" dialog that lists all tables, not just the ones I "own". None of the queries I've tried so far, give me this data.

现在我可以使用 Microsoft Access 通过 ODBC 进行连接,它会弹出一个“链接表”对话框,列出所有表,而不仅仅是我“拥有”的表。到目前为止,我没有尝试过任何查询,请给我这些数据。

I'm trying "SELECT * FROM all_tables" but that doesn't show me the right data.

我正在尝试“ SELECT * FROM all_tables”,但这并没有向我显示正确的数据。

回答by Justin Cave

ALL_TABLESwill show you all the tables that you have access to SELECTfrom. DBA_TABLESwill show you all the tables that exist in the database though you'll need an additional privilege grant to be able to query the DBA*data dictionary objects.

ALL_TABLES将显示您有权访问的所有表SELECTDBA_TABLES将向您显示数据库中存在的所有表,但您需要额外的权限授予才能查询DBA*数据字典对象。

回答by hkutluay

It can be.. (If user has dba role)

它可以是..(如果用户具有 dba 角色)

select * from dba_tables

回答by DoctorMick

Try select * from all_tables, that should do what you want.

尝试select * from all_tables,那应该做你想做的。

回答by Vasin Yuriy

SELECT owner, table_name
  FROM all_tables

回答by denied

You can also try

你也可以试试

SELECT * FROM USER_TABLES

It will return list of tables owned by your user.

它将返回您的用户拥有的表列表。

回答by simplePerson43

SELECT * FROM TAB;that will show you all the table and views

从选项卡中选择 *;这将向您显示所有表格和视图