Oracle sqldeveloper - 如何从命令行连接数据库

发布于 2024-11-27 18:58:45 字数 156 浏览 3 评论 0原文

我正在编写一个小型数据库实用程序。我想让用户能够直接从该实用程序打开 Oracle sqldeveloper 实例。是否可以打开已连接到特定数据库的 Oracle sqldeveloper IDE?

类似于 sqldeveloper USERID/PASSWORD@DATABASE

I am writing a small DB utility. I would like to give the user the ability to open an instance of Oracle sqldeveloper directly from this utility. Is it possible to open Oracle sqldeveloper IDE that already connected to a specific DB?

Something like sqldeveloper USERID/PASSWORD@DATABASE

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

自此以后,行同陌路 2024-12-04 18:58:45

现在可以使用免费的开源 扩展,只要您使用的是 SQL Developer 20.2 或更高版本。

我有 步骤这里有分步说​​明

它工作的快速 GIF...

在此处输入图像描述

This is now possible with a free, open-source extension as long as you're using version 20.2 or higher of SQL Developer.

I have step-by-step instructions here

A quick GIF of it working...

enter image description here

埖埖迣鎅 2024-12-04 18:58:45

/?比 /h 更有效。有一些选项可以覆盖配置文件,因此您是否可以这样做可能取决于配置文件提供的功能。

/? works rather than /h. There are options to override the cofiguration file so whether you can do that or not is probably determined by the facilities offered by the config file.

酒浓于脸红 2024-12-04 18:58:45

幸运的是,是的。现在可以使用 Oracle 的 ConnectionHelper 扩展来实现这一点。

不过,这是一个有点棘手的工作流程。希望他们能找到一种方法将其纳入 SQLDeveloper 本身,因为如果管理层了解如何添加“githubusercontent”存储库,他们可能会误判风险。

另外,请确保您使用最新的 SQLDeveloper (20.2+)。

但这里是这样的:

  1. 在 SQLDeveloper 中,通过转到“帮助”->“添加以下更新源”检查更新并点击“添加”:https://raw.githubusercontent.com/bjeffrie/sqldev-update-center/master/update-center.xml
  2. 选择“Connection Helper”并下一步- 完成向导(您需要重新启动 SQLDeveloper)。
  3. 转到工具 ->首选项,然后在左窗格中单击节点“连接助手”,然后在主窗格中启用“接受命令行连接”。您不需要任何其他复选框来满足您的要求。
  4. 关闭 SQLDeveloper 并从 CLI 启动它: sqldeveloper -myCLIconnection=user/pw@host:port/service

[这是 Oracle thatjeffsmith他的博客 以及 Oracle 的 Brian JeffriesOracle 的 github 存储库。]

Luckily, yes. This is now possible using Oracle's ConnectionHelper extension.

It's a bit of hacky workflow, though. Hopefully they'll figure out a way to include in SQLDeveloper itself, because if management learns about adding a 'githubusercontent' repo they might misjudge the risks.

Also, be sure you make use of a pretty recent SQLDeveloper (20.2+).

But here goes:

  1. In SQLDeveloper, add the following update source, by going to Help -> Check for Updates and hitting 'Add': https://raw.githubusercontent.com/bjeffrie/sqldev-update-center/master/update-center.xml
  2. Select 'Connection Helper' and next-next-finish the wizard (you'll need to restart SQLDeveloper).
  3. Go to Tools -> Preferences and in the left pane, click the node 'Connection Helper', then in the main pane enable 'Accept command line connections'. You don't need any of the other check boxes for what you're asking.
  4. Close SQLDeveloper and start it from CLI: sqldeveloper -myCLIconnection=user/pw@host:port/service

[This is a combination of what's documented by Oracle's thatjeffsmith on his blog and what Oracle's Brian Jeffries put in Oracle's github repo.]

弥繁 2024-12-04 18:58:45

看来并非如此。 sqldeveloper.exe /h 向我们展示了可能的启动参数,但它们似乎与您的需求没有任何共同点。

It doesn't seem so. sqldeveloper.exe /h shows us possible launch parameters, and none of them seem to have anything in common with your demand.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文