oracle 通过数据库链接描述?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/495465/
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-18 17:44:08  来源:igfitidea点击:

DESCRIBE via database link?

sqloracle

提问by guerda

I tried to execute the DESCRIBEcommand via a database link, but this was the return message:

我试图DESCRIBE通过数据库链接执行命令,但这是返回消息:

DESCRIBE <table>@<database>;
ERROR:                               
------------------------------------ 
ERROR: object <table> does not exist 

1 rows selected

A SELECTon this table works well.

SELECT这张桌子上的A效果很好。

Does Oracle permitts DESCRIBEvia a database link?

Oracle 是否允许DESCRIBE通过数据库链接?

I'm using the Oracle SQL Developer 1.5.1.

我使用的是 Oracle SQL Developer 1.5.1。

Edit:

编辑:

Is there another option to describe a table?

是否有另一种选择来描述表格?

Thanks in advance!

提前致谢!

回答by gpojd

You could do something with the all_tab_columnstable to get some table information.

您可以对all_tab_columns表做一些事情来获取一些表信息。

select column_name, data_type from all_tab_columns where table_name = 'TABLE_NAME';

回答by Otávio Décio

I think DESCRIBE is a SQL*Plus feature. See here.

我认为 DESCRIBE 是 SQL*Plus 的一个特性。见这里

回答by knowone

If you do a select of the metadata from all_tab_columns for that table present on the DBLink, it'll provide the description of the table. For Ex:

如果您为 DBLink 上存在的该表从 all_tab_columns 中选择元数据,它将提供该表的描述。例如:

select * from all_tab_Columns@dblink where table_name='ASDF' and owner='XYZ';

select * from all_tab_Columns@dblink where table_name='ASDF' and owner='XYZ';

回答by Quassnoi

You seem to be using PL/SQL Developer.

您似乎正在使用PL/SQL Developer.

DESCRIBEis not an SQL command, it's a query tool alias that gets converted into a series of queries to the system tables.

DESCRIBE不是 SQL 命令,它是一个查询工具别名,可以转换为对系统表的一系列查询。

PL/SQL Developercan not describe tables from remote databases, while native SQL*Pluscan.

PL/SQL Developer不能描述来自远程数据库的表,而本机SQL*Plus可以。

回答by user34850

The easiest way to get the description of a table on a remote server would be:

在远程服务器上获取表描述的最简单方法是:

CREATE OR REPLACE VIEW TMP_VIEW AS SELECT * FROM TABLE_A@SERVER
/
DESCRIBE TMP_VIEW
/

回答by anna

In PL/SQL Developer, you can right-click on the table name from the tables folder and click on describe...which gives the same result as the describe command in native SQL plus.

在 PL/SQL Developer 中,您可以右键单击表文件夹中的表名称,然后单击描述...,这与本机 SQL plus 中的描述命令的结果相同。

回答by MazarD

I can't check it right now, but maybe select * from v$tables@remotedb doesn't give similar information?

我现在无法检查,但也许 select * from v$tables@remotedb 没有提供类似的信息?

回答by Revoman

Using Oracle SQL Developer I was able to use DESCRIBE to show the definition of a remote table. However, I had to use the notation

使用 Oracle SQL Developer 我能够使用 DESCRIBE 来显示远程表的定义。但是,我不得不使用符号

describe schema.table@database

描述 schema.table@database