您如何找到Oracle数据库的URL? [英] How do you find out the Oracle database's URL?

查看:1200
本文介绍了您如何找到Oracle数据库的URL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何找到Oracle数据库的URL和端口?

How can I find out the URL and port for an Oracle database?

示例:

"jdbc:oracle:thin:@host:port:dbName","userName","password");

"jdbc:oracle:thin:@host:port:dbName","userName", "password");

是否可以查看SQL命令或日志/配置文件?

Is there an SQL command or log/configuration file I can look at?

推荐答案

对于oracle,有一个tnsnames.ora文件,用于定义数据库地址.该文件通常在$ORACLE_HOME/network/admin中找到,并且由oracle客户端(例如sqlplus或Toad)使用.这是一个示例tns条目:

With oracle, there is a tnsnames.ora file which defines database addresses. This file is normally found in $ORACLE_HOME/network/admin and is used by oracle clients like sqlplus or Toad. Here is a sample tns entry:

ORA11 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = hostname)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = ORA11)
    )
  )

从此条目中可以得出您的jdbc连接字符串为:

From this entry you can work out that your jdbc connection string would be:

jdbc:oracle:thin:@hostname:1521:ORA11

这篇关于您如何找到Oracle数据库的URL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆