oracle exp 命令接受主机和端口以导出远程数据库表

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

exp command accepts host and port to export remote DB tables

oracle

提问by Pokuri

In oracle we have exputility. we use that as exp username/password@database. Here can we use provide host and port details to export to remote db tables? If yes, what is the format to provide those? Thanks

在 oracle 中,我们有exp实用程序。我们将其用作exp username/password@database. 这里我们可以使用提供主机和端口详细信息来导出到远程数据库表吗?如果是,提供这些的格式是什么?谢谢

回答by Alex Poole

You can use an alias from your tnsnames.ora, or provide a connection string in a similar format, or use the Easy Connectsyntax:

您可以使用 中的别名tnsnames.ora,或提供类似格式的连接字符串,或使用Easy Connect语法:

exp user/password@host:port/service_name

Note that this requires the service nameof the database, which might not be the same as the SID. You can get the services by running lsnrctl serviceson the remote server (if you can) or by querying the v$parameterview (if you have access and permission), or by asking the DBA for the remote server.

请注意,这需要数据库的服务名称,该名称可能与 SID 不同。您可以通过lsnrctl services在远程服务器上运行(如果可以)或通过查询v$parameter视图(如果您具有访问权限和权限)或通过向 DBA 询问远程服务器来获取服务。

The connection options are the same as for any other tool, so if you can connect to the remote database using SQL*Plus then you can use the same connect string for exp. If you're using @databaseto connect to a local instance then that is probably already defined in your tnsnames.ora, and you could add entries for the remote database there too. If this is a one-off then the Easy Connect is simpler.

连接选项与任何其他工具相同,因此如果您可以使用 SQL*Plus 连接到远程数据库,那么您可以对exp. 如果您正在使用@database连接到本地实例,那么它可能已经在您的 中定义,您tnsnames.ora也可以在那里为远程数据库添加条目。如果这是一次性的,那么 Easy Connect 会更简单。

Also, if you're not still on an old version (pre-10g), you should use datapump (expdp) rather than the old exptool.

此外,如果您还没有使用旧版本(10g 之前),则应该使用 datapump ( expdp) 而不是旧exp工具。