How to check the SID of Oracle database? Use SQL*Plus query Use the database connection tool to check the TNSNames.ora file Use environment variables to check the operating system's process list
How to check the SID of the Oracle database
Method 1: Use SQL*Plus query
Use the SQL*Plus command line tool directly to execute the following query:
<code>SELECT * FROM v$instance;</code>
Copy after login
This Will return the value of sid.
Method 2: Use a database connection tool
For example, use a connection tool such as SQL Developer or Toad to connect to the database, then:
- SQL Developer: Right-click the connection and select "Properties". On the Basics tab, you can see the SID.
-
Toad: In the left panel, under "Databases", find the database connection. Right-click and select Properties. On the Authentication tab, you can see the SID.
Other methods
-
Check the TNSNames.ora file: The SID is usually specified in the TNSNames.ora file for Connect to the database.
-
Using environment variables: If the ORACLE_SID environment variable has been set, it will contain the value of the SID. You can use the following command to check:
<code>echo $ORACLE_SID</code>
Copy after login
-
Check the process list of the operating system: Database processes are usually named in the form of "oracle@[sid]". The SID can be found by checking the operating system process list.
Tip
- SID is uppercase sensitive.
- If the database is running multiple instances, each instance has its own SID.
- The SID is required information when you connect to the database.
The above is the detailed content of How to read oracle database sid. For more information, please follow other related articles on the PHP Chinese website!