How to query the Oracle database instance name: Use SQL*Plus to connect and run the query: select name from v$instance; Navigate to "Database Instance" through Oracle Enterprise Manager (OEM) and view "Properties"; Check the environment Variable: %ORACLE_SID% in Windows, $ORACLE_SID in Linux/Unix.
How to query the Oracle database instance name
Method 1: Use SQL*Plus
Connect to Oracle database:
<code>sqlplus / as sysdba</code>
Execute the following query:
<code>select name from v$instance;</code>
Method Two: Use Oracle Enterprise Manager (OEM)
Method 3: Check environment variables
For Windows systems:
<code>echo %ORACLE_SID%</code>
For Linux/Unix systems:
<code>echo $ORACLE_SID</code>
The difference between instance name and SID
The instance name and SID are usually the same, but sometimes they may be different. The instance name is the human-readable name of the Oracle server instance, and the SID is the system identifier of the Oracle database itself.
The above is the detailed content of How to check database instance name in oracle. For more information, please follow other related articles on the PHP Chinese website!