Home  >  Article  >  Database  >  How to check database instance name in oracle

How to check database instance name in oracle

下次还敢
下次还敢Original
2024-04-07 17:03:19533browse

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 check database instance name in oracle

How to query the Oracle database instance name

Method 1: Use SQL*Plus

  1. Connect to Oracle database:

    <code>sqlplus / as sysdba</code>
  2. Execute the following query:

    <code>select name from v$instance;</code>

Method Two: Use Oracle Enterprise Manager (OEM)

  1. to log in to the OEM console.
  2. In the left navigation bar, expand the "Database" node.
  3. In the "Database Instance" list, find and select the database instance you want to query.
  4. In the right panel, look for the Properties section, where the instance name will appear.

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!

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