View the name of the Oracle database server

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.