如何找出Oracle数据库的网址?[英] how to you find out the Oracle database's url?

本文是小编为大家收集整理的关于如何找出Oracle数据库的网址?的处理/解决方法,可以参考本文帮助大家快速定位并解决问题,中文翻译不准确的可切换到English标签页查看源文。

问题描述

如何找出oracle db的网址和端口?



示例




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




< p>编辑:有一个sql命令或日志/配置文件我可以看看


推荐答案

code> tnsnames.ora 定义数据库地址的文件.此文件通常位于 $ ORACLE_HOME / network / admin 中,并由oracle客户端(如sqlplus或Toad)使用.这里是一个样本tns条目:



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

(CONNECT_DATA =
(SERVICE_NAME = ORA11)




从这个条目,你可以计算出你的jdbc连接字符串:



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

本文地址:https://www.itbaoku.cn/post/597646.html

问题描述

How do you find out the url and port for an oracle db?

example

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

edit: is there an sql command or log/configuration file i can look at

推荐答案

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)
    )
  )

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

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