Oracle中的sid与servicename

在平时自己创建库的时候,习惯的将sid与servicename取同名,但是在实际生产中这两个名字很有可能不一致,再使用jdbc连接数据库的url时就需要注意区分了,否则创建不了数据库连接

//serviceName
url = "jdbc:oracle:thin:@ip:port/servicename";
//sid
url = "jdbc:oracle:thin:@ip:port:sid";

 同样的,在tnsname.ora中也是要注意区分 servicename = ...sid = ....

test =
(DESCRIPTION =
	(ADDRESS = (PROTOCOL = TCP)(HOST = 10.10.68.91)(PORT = 1521))
	(CONNECT_DATA =
	  (SERVER = DEDICATED)
	  (SERVICE_NAME = orcl)   #serviceName
#        (SID = orcl)
	)
)

 

posted @ 2016-07-16 10:50  WhyToHow  阅读(1889)  评论(0编辑  收藏  举报