First, the database name
What is a database name?
The database name is the identity of a database, just like a person's ID number. He used parameters
Db_name says that if a machine is loaded with multiple databases, every database
has a database name. After the database installation or creation is complete, the parameter db_name is written
Parameter file. The format is as follows:
Db_name=myorcl
...
You should consider the database name when you create the database, and after you create the database, the data
The library name should not be modified, even if you want to modify it will be cumbersome. Because the database name is also written to control
file, the control file is stored in binary type, the user cannot modify the control file within the
Capacity. Suppose the user modifies the database name in the parameter file, that is, modifies the value of the db_name. But
is when Oracle starts, because the db_name in the parameter file and the database in the control file
The database fails to start, and a ORA-01103 error is returned.
The role of database names
The database name is installed in the database, creating a new database, creating a database control file, repairing the
Data structures, backup and restore databases are required.
There are many Oracle installation file directories that are associated with database names, such as:
Winnt:d:oracleproduct10.1.0oradatadb_name ...
Unix:/home/app/oracle/product/10.1.0/oradata/db_name/...
Pfile
Winnt:d:oracleproduct10.1.0admindb_namepfileini.ora
Unix:
/home/app/oracle/product/10.1.0/admin/db_name/pfile/init$ora
Cle_sid.ora
Trace 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 DB command is also associated with the parameter
The value of the db_name parameter in the file is consistent, otherwise an error is generated.
Similarly, modify the database structure of the statement alter, and of course also indicate that you want to modify
The name of the database.
If the control file is corrupted or missing, the database cannot be loaded, and the control text will be re-created
Start the instance in Nomount mode, and then use the Create Controlfile command
Create a control file, and of course this command also refers to Db_name.
There are also database names that need to be used when backing up or recovering a database.
In short, the database name is important to understand exactly what it does.
Querying the current data name
Method One: select name from V$database;
Method two: Show parameter db
Method Three: View the parameter file.
Modify Database name
Previous recommendation: The database name should be determined when the database is created, and the database name should not be modified
, because modifying the database name is a complex matter. So let's just explain now,
How to modify the database name after the data has been created. The steps are as follows:
1. Close the database.
2. Modify the value of the db_name parameter in the database parameter file to the new database name.
3. Launch the instance in Nomount mode and build the control file (for the command language to create the control file
Refer to Oracle documentation)
Second, the database instance name
What is a DB instance name?
The database instance name is the identity used to contact the operating system, which means that the database and operations
The interaction between systems is with the database instance name. The instance name is also written to the parameter file, which
The parameter is instance_name, and in 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 a one-to-two relationship, but if the Oracle and
Database name and instance name in a row server architecture (i.e. Oracle real-time application cluster) is a one-to-many
The relationship.
Querying the current DB instance name
Method One: Select instance_name from V$instance;
Method Two: Show parameter instance
Method Three: Query in the parameter file.
DB Instance name and Oracle_sid
Although both tables are Oracle instances, there is a difference between the two. instance_name is
Oracle database parameters. ORACLE_SID is an environment variable for the operating system.
Oracld_sid is used to interact with the operating system, that is, from the operating system's perspective to access real
Example name, must pass ORACLE_SID. Under Winnt, Oracle_sid still needs to exist in the registration
Table.
And the Oracle_sid must match the value of the instance_name, otherwise you will receive a
Error, on UNIX platform, is "ORACLE not available", on Winnt platform, is
"TNS: Protocol Adapter Error".
DB instance name and network connection
DB instance name in addition to interacting with the operating system, Oracle Server for network connectivity
Identity. When you configure the Oracle host connection string, you need to specify the instance name. Of course 8i
Later versions of the network components require the service name service_name to be used. This concept is followed by
To illustrate.
Third, the database domain name
What is a database domain name?
In a distributed database system, between different versions of the database server, regardless of the operating
The system is UNIX or Windows, and can be used between servers through the database link
Remote replication, the database domain name is primarily used for replication in an Oracle distributed environment. Examples Show
Such as:
A distributed database of national transport and transportation systems, including:
Fujian node: Fj.jtyz
Xiamen, Fujian 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, and his parameter is Db_domain.
Querying database domain names
Method One: Select value from v$parameter where name =
' Db_domain ';
Method two: Show parameter domain
Method Three: Query in the parameter file.
Global database name
Global database name = database name + database domain name, as described above Fujian node global database name
Yes: Oradb.fj.jtyz
Iv. Database service Name
What is the database service name?
Starting with the Oracle9i version, a new parameter, the database service name, was introduced. Name of parameter
It's service_name.
If the database has a domain name, the database service name is the global database name; otherwise, the database
The service name is the same as the database name.
Querying database service Names
Method One: Select value from v$parameter where name =
' Service_Name ';
Method two: Show parameter service_name
Method Three: Query in the parameter file.
Database service name and network connection
Oracle network components that are open from Oracle8i, database and client connection host string use
The database service name. Previously used is ORACLE_SID, which is the database instance name .
ORACLE database name, instance name, Oracle_sid, service name, global database name