Brief description of Oracle Database Name, Instance name, service name

Source: Internet
Author: User

1) database name DB_NAME
The internal mark of the Oracle database. It also exists in the binary control file and parameter file pfile. Therefore, it cannot be modified after the database is installed.
You can see it in pfile.
DB_NAME = ora9i # ora9i can be any name
 
Its role: After the database is installed, DB_NAME must be used in the physical structure file directory of the database. For example, put the pfile file in:
/Home/app/oracle/admin/DB_NAME/pfile/init $ ORACLE_SID.ora
Database background process tracking file storage directory:
/Home/app/oracle/admin/DB_NAME/bdump
 
Note: When installing the Oracle Enterprise Edition database, you must specify both the Database Name (db_name) and domain name (db_domain ). For example, in ora9i.nic.hqzy.com.cn, db_domain is equal to nic.hqzy.com.cn.
 
Method for querying database names:
1. a) SQL> select name from v $ database
ORA9I
 
1. B) SQL> show parameter db
...
Db_name string ora9i
 
1. c) Search for the parameter file pfile
 
2) database instance name INSTANCE_NAME
The database instance name is used for the connection between the database and the operating system, that is, used for external connection. It can be modified.
The Database Name and database instance name are generally in a one-to-one relationship.
 
Method for querying database instance names:
2. a) SQL> select instance_name from v $ instance;
Ora9i
 
2. B) show parameter instance
...
Instance_name string ora9i
 
2. c) search in pfile
...
Instance_name = ora9i
 
3) ORACLE_SID
In fact, it is the name of the database instance. Only INSTANCE_NAME is the Oracle database parameter, while ORACLE_SID is the environment variable of the operating system.
Use ORACLE_SID in the database parameter file name, for example:
/Home/app/oracle/admin/DB_NAME/pfile/init $ ORACLE_SID.ora
 
Importantly, If you connect to a database through sqlplus, it is connected to a database with the instance name $ ORACLE_SID by default.
 
$ ORACLE_SID = ora9i
$ Export ORACLE_SID
$ Sqlplus "/sysdba" --> link to the database named ora9i of the Instance
 
Of course, you can change ORACLE_SID to connect to other databases.
$ ORACLE_SID = ora9ia
$ Export ORACLE_SID
$ Sqlplus "/sysdba" --> link to the database named ora9ia of the Instance
 
Of course, this involves the issue of operating system authentication, which will be discussed later.
 
4) database Domain Name
As mentioned above, the database domain name is often used in the distributed database environment. Two databases need to transmit data remotely through the database link, and in the same network environment, the data names of the two databases are the same, and their domain names are different. They can also be identified by unique landmarks. For example, prod1.nic. hgzy and prod1.cic. hgzy.
 
Query the database Domain Name:
4. a) SQL> select value from v $ parameter
2> where name = 'db _ domain'
Value
------------------
Nic.hqzy.com.cn
 
4. B) SQL> show parameter domain
 
4. c) query the parameter file
...
Db_domain = nic.hqzy.com.cn
 
5) Global Database Name: www.2cto.com
Global Database Name = database name + domain name.
 
6) Database Service name
If the database has a domain name, the Database Service name is the global database name. If the database does not have a domain name, the Database Service name is the database name.
 
Query database service names
6. a) SQL> select value from v $ parameter
2> where name = 'sevice _ names'
 
6. B) SQL> show paramter service_names
 
6. c) query the parameter file
......
Service_names = ora9i.nic.hqzy.com.cn

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.