如何找出Oracle数据库的url? [英] how to you find out the Oracle database's url?
问题描述
如何找出oracle db的网址和端口?
How do you find out the url and port for an oracle db?
示例
jdbc:oracle:thin:@host:port:dbName,userName,password);
"jdbc:oracle:thin:@host:port:dbName","userName", "password");
编辑:有一个sql命令或日志/配置文件我可以看看
edit: is there an sql command or log/configuration file i can look at
推荐答案
code> 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屋!