Database Name, database instance name and database domain name I. Database Name what is 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 database name is used when you install the database, create a new database, create a database control file, modify the data structure, and back up and restore the database. There are many Oracle installation file directories related to database names, such as: winnt: d: \ oracle \ product \ 10.1.0 \ oradata \ DB_NAME \... unix:/home/app/oracle/product/10.1.0/oradata/DB_NAME /... pfile: winnt: d: \ oracle \ product \ 10.1.0 \ admin \ DB_NAME \ pfile \ ini. oraUnix:/home/app/oracle/product/10.1.0/admin/DB_NAME/pfile/init $ ORACLE_SID.ora tracking file directory: winnt: /home/app/oracle/product/10.1.0/admin/DB_NAME/bdump /... in addition, when creating data, the database name in the careate database command must be consistent with the value of the DB_NAME parameter in the parameter file. Otherwise, an error occurs. Similarly, the alter database statement for modifying the database structure should also indicate 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. Method 1: select name from v $ database; Method 2: show parameter 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 winnt 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. Method 1: select instance_name from v $ instance; Method 2: show parameter 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 winnt 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". On the winnt 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 the distributed database system, database servers of different versions can be remotely copied between servers, regardless of whether the operating system is unix or windows, 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: select value from v $ parameter where name = 'db _ domain '; Method 2: show parameter 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. jtyz. 4. 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: select value from v $ parameter where name = 'service _ name'; Method 2: show parameter service_name method 3: query in the parameter file. The Database Service name and network connection are oracle network components opened from oracle8i. The connection host string between the database and the client uses the Database Service name. Previously, we used ORACLE_SID, that is, the database instance name to create an Oracle database (taking Oracle10g as an example). There are two ways to create a database: one is to create a database manually by using a command line script; the other is to create a database by using the Database Configuration Wizard provided by Oracle. This document describes how to create an Oracle database using a command line script on Unix and Windows. A complete database system should contain a physical structure, a logical structure, a memory structure, and a process structure. If you want to create a new database, all these structures must be completely created.