Today, colleagues, there is a database connection failure problem, together Baidu a bit, the results finally solved, the following is a number of popular knowledge reproduced.
1, Query database name: Select Name,dbid from v$database; or command line: Show parameter db_name;
2. Query instance Name: Select instance_name from v$instance; or command line: Show parameter instance_name;
3. Query the database domain name: Select value from V$parameter where name= ' db_domain '; or command line: Show parameter domain;
4. Query database server: Select value from V$parameter where name= ' service_name '; or command line: show parameter service; or command line: Show parameter Names
5. Database service Name: This parameter is a database identification class parameter, represented by Service_Name. If the database has a domain, the database service name is the global database name, and if not, the database service name is the database name. Command line query: Show parameter service_name;
Reproduced:
Http://doudouweed.blog.sohu.com/117454473.html
http://blog.csdn.net/f_zongjian/article/details/5835425 (Detailed introduction)
The same problem:
http://blog.163.com/xoq_412885496/blog/static/85157205201242171518892/
Note:
Oracle database connection URL1), normal SID mode Jdbc:oracle:thin: @Host:p ort:sid such as: JDBC:ORACLE:THIN:@127.0.0.1:1521:ORCL 2), Ordinary servername way Jdbc:oracle:thin: @Host:p ort/servername such as: JDBC:ORACLE:THIN:@127.0.0.1:1521/ORCL
Oracle about DB instance name and database service name (reprint)