Oracle中关于数据库实例名与数据库服务名(转载)

今天同事,出现了数据库连接失败的问题,一起百度了一下,结果总算解决了,以下是一些转载过来的普及知识。

1、查询数据库名:select name,dbid from v$database;或者命令行:show parameter db_name;
2、查询实例名:select instance_name from v$instance;或者命令行:show parameter instance_name;
3、查询数据库域名:select value from v$parameter where name='db_domain';或者命令行:show parameter domain;
4、查询数据库服务器:select value from v$parameter where name='service_name';或者命令行:show parameter service;或者命令行:show parameter names;
5、数据库服务名:此参数是数据库标识类参数,用service_name表示。数据库如果有域,则数据库服务名就是全局数据库名;如果没有,则数据库服务名就是数据库名。命令行查询:show parameter service_name;

转载:

http://doudouweed.blog.sohu.com/117454473.html

http://blog.csdn.net/f_zongjian/article/details/5835425(详细的介绍)

 

同样的问题:

http://blog.163.com/xoq_412885496/blog/static/85157205201242171518892/

 

备注:

oracle数据库连接URL
1)、普通SID方式
jdbc:oracle:thin:@Host:port:SID
如:jdbc:oracle:thin:@127.0.0.1:1521:orcl
 
2)、普通ServerName方式
jdbc:oracle:thin:@Host:port/ServerName
如:jdbc:oracle:thin:@127.0.0.1:1521/orcl

 

posted @ 2015-03-21 17:30  qingyezhu  阅读(218)  评论(1编辑  收藏  举报