In Oracle, you can use the "SELECT instance_name FROM v$instance;" command to query the database instance name; "instance_name" represents the database instance, and the database instance name is an identifier used to contact the operating system, that is to say The interaction between the database and the operating system uses the database instance name.
The operating environment of this tutorial: Windows 10 system, Oracle version 12c, Dell G3 computer.
What is the database instance name?
The database instance name is an identifier used to contact the operating system. That is to say, the interaction between the database and the operating system uses the database instance name. The instance name is also written into the parameter file, which is instance_name. In the winnt platform, the instance name is also written into the registry.
The database name and instance name can be the same or different.
Under normal circumstances, the database name and instance name are in a one-to-one relationship, but in the Oracle parallel server architecture (that is, Oracle Real-time Application Cluster), the database name and instance name are in a one-to-many relationship. This was illustrated in the first article.
Query the current database instance name
Method: selectinstance_namefrom v$instance;
The example is as follows:
First, we double-click to open SQL PLUS application software
Then enter the user name: system, then enter the password and press Enter to log in, as shown in the figure:
Enter the following code :
SELECT instance_name FROM v$instance;
Finally, as shown in the figure: we can see the instance name
Recommended tutorial: "Oracle Video Tutorial》
The above is the detailed content of How to query the oracle database instance name. For more information, please follow other related articles on the PHP Chinese website!