Modifying and listening IP address of oracle
Reference and combine these two blogs
Modifying and listening IP address of oracle
Oracle modify listening IP address
In a very simple way, the problem of monitoring is solved.
Now let's combine and rearrange it
1. In cmd, enter hostname discovery hostname
2. Modify the hosts file in the folder: c:\windows\system32\drivers\etc
# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host
# localhost name resolution is handled within DNS itself.
# 127.0.0.1 localhost
# ::1 localhost
[Host IP] [host name]
Add on last line
Native IP host name
3. Modify oracle's listening file
- Open listener.ora, and in the file f: \ app \ young \ product \ 11.2.0 \ dbhome 1 \ network \ admin, change the localhost to its middle host name.
# listener.ora Network Configuration File: F:\app\young\product\11.2.0\dbhome_1\network\admin\listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = F:\app\young\product\11.2.0\dbhome_1)
(PROGRAM = extproc)
(ENVS = "EXTPROC_DLLS=ONLY:F:\app\young\product\11.2.0\dbhome_1\bin\oraclr11.dll")
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = Young-PC)(PORT = 1521))//Young PC was originally localhost
) ) ADR_BASE_LISTENER = F:\app\young
- Modify tnsnames.ora, the directory is the same as above, and will also. localhost changes to the middle host name.
# tnsnames.ora Network Configuration File: F:\app\young\product\11.2.0\dbhome_1\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.
LISTENER_ORCL =
(ADDRESS = (PROTOCOL = TCP)(HOST = Young-PC)(PORT = 1521))//Young PC was originally localhost
ORACLR_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
(CONNECT_DATA =
(SID = CLRExtProc)
(PRESENTATION = RO)
)
)
ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = Young-PC)(PORT = 1521))//Young PC was originally localhost
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
- Restart TNSLSNR
Open the CMD and enter the following command.
lsnrctl stop
lsnrctl start
lsnrctl stat
Connect remotely again. The ip address of this machine can be used to connect successfully.