You can view the Oracle database instance by using SQL Plus to query the INSTANCE_NAME column in the V$INSTANCE table. Use command line instructions such as ps -ef (Linux) or tasklist /FI "imagename eq oracle.exe" (Windows). The query results will display the name of the currently running Oracle instance. Each instance has a unique name consistent with its associated database service.
How to view the Oracle database instance
To view the Oracle database instance, you can use the following method:
1. Via SQL Plus
<code class="sql">SELECT INSTANCE_NAME FROM V$INSTANCE;</code>
2. Via the command line
<code class="bash">ps -ef | grep pmon</code>
<code class="powershell">tasklist /FI "imagename eq oracle.exe"</code>
Output Explanation
The query results will display the name of the currently running Oracle instance. Each instance has a unique name consistent with its associated database service.
For example, if the query returns the following results:
<code>INSTANCE_NAME ---------------- ORCLCDB</code>
This means that an Oracle instance named "ORCLCDB" is running. This instance will be associated with a database service named "ORCLCDB".
The above is the detailed content of Check the instances of oracle database. For more information, please follow other related articles on the PHP Chinese website!