Home >Database >Oracle >How to query the oracle database instance name

How to query the oracle database instance name

WBOY
WBOYOriginal
2022-08-02 15:55:5114227browse

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.

How to query the oracle database instance name

The operating environment of this tutorial: Windows 10 system, Oracle version 12c, Dell G3 computer.

How to query the oracle database instance name

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:

How to query the oracle database instance name

Enter the following code :

SELECT instance_name FROM v$instance;

How to query the oracle database instance name

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn