Oracle Database Name, Instance name, database domain name, Database Service name, global database name details database name, Instance name, database domain name, Global Database Name, service name, this is a few confusing concepts for many beginners. I believe that many beginners are confused by these concepts on the title just like me. Now let's figure them out. 1. What is a database name? The database name is the ID of a database, just like the ID card number of a person. He uses the DB_NAME parameter to indicate that if multiple full databases are installed on a machine, each database has a database name. After the database is installed or created, the parameter DB_NAME is written to the parameter file. The format is as follows: DB_NAME = myorcl... the database name should be taken into account when creating the database, and the database name should not be modified after the database is created, even if it needs to be modified, it will be very troublesome. Because the database name is also written into the control file and the control file is stored in binary format, you cannot modify the control file content. Assume that you have modified the database name in the parameter file, that is, the value of DB_NAME. But at Oracle startup, because DB_NAME In the parameter file is inconsistent with the database name in the control file, causing database startup failure, a ORA-01103 error is returned. The job database name of the database name must be used to install the database, create a new database, create a database control file, modify the data structure, and back up and restore the database. [Plain] Many Oracle installation file directories are related to database names, such as win: d: \ oracle \ product \ 10.1.0 \ oradata \ DB_NAME \... unix:/home/app/oracle/product/10.1.0/oradata/DB_NAME /... pfile: win: d: \ oracle \ product \ 10.1.0 \ admin \ DB_NAME \ pfile \ ini. ora Unix:/home/app/oracle/product/10.1.0/admin/DB_NAME/pfile/init $ ORACLE_SID.ora tracking file directory: win: /home/app/oracle/product/10.1.0/admin/DB_NAME/bdump /... in addition, when creating data, the database name in the careatedatabase command must also be consistent with DB_NAM In the parameter file. The values of the E parameter are the same; otherwise, an error occurs. Similarly, the statement alterdatabase for modifying the database structure should also specify the name of the database to be modified. If the control file is damaged or lost, the database cannot be loaded. In this case, you need to re-create the control file by starting the instance in nomount mode, and then run the create controlfile command to create the control file, of course, this command also refers to DB_NAME. You also need to use the database name to back up or restore the database. In short, the database name is very important and it must be understood accurately. Query the current database name [plain] Method 1: select name from v $ database; Method 2: showparameter db method 3: view the parameter file. Before modifying the database name, we recommend that you determine the database name when creating the database. The database name should not be modified because it is complicated to modify the database name. Now let's take a look at how to modify the database name after the data has been created. Step 1: Shut down the database. 2. Modify the value of DB_NAME in the database parameter file to the new database name. 3. Start the instance in NOMOUNT mode and build the control file (for the command syntax for creating the control file, refer to the oracle document) 2. What is the database instance name? The database instance name is the identifier used to contact the operating system, that is, the interaction between the database and the operating system uses the database instance name. The instance name is also written to the parameter file. The parameter is instance_name. On the win platform, the Instance name is also written to the Registry. The Database Name and Instance name can be the same or different. In general, the database name and Instance name are one-to-one, but in the oracle Parallel Server Architecture (that is, the oracle Real-time application cluster, the Database Name and Instance name are one-to-multiple relationships. This is illustrated in the first article. Method 1: selectinstance_name from v $ instance; Method 2: showparameter instance method 3: query in the parameter file. Although both database instance names and ORACLE_SID are oracle instances, they are different. Instance_name is an oracle database parameter. ORACLE_SID is the environment variable of the operating system. ORACLD_SID is used to interact with the operating system. That is to say, the Instance name accessed from the operating system must be accessed through ORACLE_SID. There are no win instances, and ORACLE_SID must also exist in the registry. And ORACLE_SID must be consistent with the value of instance_name. Otherwise, you will receive an error. On the unix platform, it is "ORACLE not available", and on the win platform, it is "TNS: protocol adapter error ". In addition to operating system interaction, the database instance name and Network Connection database instance name are also used as the oracle server identification for network connection. When configuring an oracle host connection string, you need to specify the Instance name. Of course, for network components later than 8i, the service name SERVICE_NAME is required. This concept is explained later. 3. What is a database domain name? In distributed database systems, different versions of database servers, whether running on unix or windows, can be remotely copied between servers through the database link, the database domain name is mainly used for replication in the oracle distributed environment. Example: the distributed database of the National Transportation Administration System, in which: Fujian node: fj. jtyz Fujian Xiamen node: xm. fj. jtyz Jiangxi: jx. jtyz Shangrao, Jiangxi: sr. jx. jtyz: This is the database domain name. The database domain name exists in the parameter file. Its parameter is db_domain. method 1: selectvalue from v $ parameter where name = 'db _ domain '; Method 2: showparameter domain method 3: query in the parameter file. Global Database Name: Global Database Name = database name + database domain name. For example, the Global Database Name of the Fujian node is oradb. fj. jtyz4. What is the database service name? A new parameter, that is, the Database Service name, is introduced from oracle9i. The parameter name is SERVICE_NAME. If the database has a domain name, the Database Service name is the global database name; otherwise, the Database Service name is the same as the database name. Method 1: selectvalue from v $ parameter where name = 'service _ name'; Method 2: showparameter service_name method 3: query in the parameter file. The Database Service name and network connection are oracle network components starting from oracle8i. The connection host string between the database and the client uses the Database Service name. Previously, ORACLE_SID was used, that is, the database instance name and above content mainly come from the network. The specific original post cannot be found and is transferred everywhere, but in short it is very good, so I also learned from it. The following is my supplement: Check the listening status-lsnrctl [plain] Service "elvis" has 2 instance (s ). instance "elvis", status UNKNOWN, has 1 handler (s) for this service... instance "elvis", status READY, has 1 handler (s) for this service... service "elvisXDB" has 1 instance (s ). instance "elvis", status READY, has 1 handler (s) for this service... the command completed successfully shows that The service name has been occupied by two systems, and The service name can have 64, but The system occupies two, that is, we can manually configure 62 service names. Change the Database Service name [SQL] alter system set service_names = B; after the change, the corresponding tnsname. ora file also needs to be modified. [Plain] Service "B" has 1 instance (s ). instance "elvis", status READY, has 1 handler (s) for this service... service "a" has 1 instance (s ). instance "elvis", status UNKNOWN, has 1 handler (s) for this service... service "elvis" has 1 instance (s ). instance "elvis", status READY, has 1 handler (s) for this service... service "elvisXDB" has 1 instance (s ). instance "elvis", status READY, has 1 handler (s) This service... the command completed successfully database instance name modification [SQL] alter system set instance_name = test2 scope = spfile; this is a dynamic parameter, so you need to specify The spfile and then restart The database to take effect.