Original: View the name of the Oracle database server
In Windows
1. SelectName fromv$Database;
It can be viewed directly by running the
2. Check the Tnsnames.ora connection, there is a sid,sid is the service name
1. View the installation directory for Oracle,
method is to view the registry:
such as: Hkey_local_machine\software\oracle\oracle_home REG_SZ E:\ORACLE\ORA92
Get the installation directory for Oracle
In general, if the server is installed with a default value then this value is: D:\ORACLE\ORA92
2. Locate the Tnsnames.ora file
Locate the \network\admin\tnsnames.ora file below the root directory and open
3. Take a closer look at the Tnsnames.ora configuration inside
For example
# TNSNames. ORA Network Configuration File:d:\oracle\ora92\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.
wzz=
(DESCRIPTION =
(Address_list =
(ADDRESS = (PROTOCOL = TCP) (HOST = wzz) (PORT = 1521))
)
(Connect_data =
(SERVER = dedicated)
(service_name = wzz)
)
)
The service_name is the service name, such as the above file, the service name is Wzz
C # Gets the Oracle server name:
#regionRead the value of the installation home directory from the registry
/// <summary>
///read the value of the installation home directory from the registry
/// </summary>
/// <param name= "Setupkey" ></param>
/// <returns></returns>
PublicStaticstringReadhomedirectory (stringSetupkey)
{
RegistryKey ReadKey;
Try
{
ReadKey = Registry.LocalMachine.OpenSubKey
("software\\oracle",false);
foreach(stringNameinchReadkey.getvaluenames ())
{
if(name = = Setupkey)
{
returnReadkey.getvalue (name). ToString ();
}
}
returnNULL;
}
Catch
{
returnNULL;
}
}
#endregion
Under Linux system
1.
SYS @SZTYORA > Show Parameter Servic
2.CD $ORACLE _base/admin Look at a couple of them.
View the name of the Oracle database server