In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly introduces how to achieve oracle network configuration, the article introduces in great detail, has a certain reference value, interested friends must read it!
The method of network configuration:
1. Tnsname client-A modifies the file directly
B through the client tool "Network configuration Assistant"-- the winside directly opens and invokes the Linux side, and the netca command calls up the configuration tool
2. Listener configuration-server side
Client configuration monitoring service room does not make any sense, because the client does not have oracle server
Listener configuration file: / u01/oracle/product/10.2.0/db_1/network/admin/listener.ora
[oracle@oracle3 admin] $cat listener.ora
# listener.ora Network Configuration File: / u01/oracle/product/10.2.0/db_1/network/admin/listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = / u01/oracle/product/10.2.0/db_1)
(PROGRAM = extproc)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC) (KEY = EXTPROC1))
(ADDRESS = (PROTOCOL = TCP) (HOST = oracle3) (PORT = 1521))
)
)
Configure a listener on the server side
[oracle@oracle3 admin] $cat listener.ora
# listener.ora Network Configuration File: / u01/oracle/product/10.2.0/db_1/network/admin/listener.ora
# Generated by Oracle configuration tools.
LISTENER1 =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = oracle3) (PORT = 1522))
)
)-- New listener, listener listener is port 1522
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = / u01/oracle/product/10.2.0/db_1)
(PROGRAM = extproc)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC) (KEY = EXTPROC1))
(ADDRESS = (PROTOCOL = TCP) (HOST = oracle3) (PORT = 1521))
)
)
A database instance is monitored by multiple listeners
[oracle@oracle3 admin] $lsnrctl status-LISTENER is turned on by default
[oracle@oracle3 admin] $lsnrctl status LISTENER1-- the second listener is open
LSNRCTL for Linux: Version 10.2.0.4.0-Production on 06-JUN-2014 14:28:42
Copyright (c) 1991, 2007, Oracle. All rights reserved.
Connecting to (DESCRIPTION= (ADDRESS= (PROTOCOL=TCP) (HOST=oracle3) (PORT=1522)
STATUS of the LISTENER
-
Alias LISTENER1
Version TNSLSNR for Linux: Version 10.2.0.4.0-Production
Start Date 06-JUN-2014 14:26:15
Uptime 0 days 0 hr. 2 min. 26 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File / u01/oracle/product/10.2.0/db_1/network/admin/listener.ora
Listener Log File / u01/oracle/product/10.2.0/db_1/network/log/listener1.log
Listening Endpoints Summary...
(DESCRIPTION= (ADDRESS= (PROTOCOL=tcp) (HOST=oracle3) (PORT=1522))
The listener supports no services
The command completed successfully
Register ORCL with the second listener:
Modify the listener configuration file:
LISTENER1 =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = oracle3) (PORT = 1522))
)
)
SID_LIST_LISTENER1 =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = / u01/oracle/product/10.2.0/db_1)
(PROGRAM = extproc)
)
(SID_DESC =
(SID_NAME=ORCL)
(ORACLE_HOME = / u01/oracle/product/10.2.0/db_1)
)
)
Access through listener 2: create a connection string access for port 1522.
LISTENER1 (1522) LISTENER (1521)
| | |
-
| |
ORCL
| |
Oracle software
Concurrent access: one group is accessed through 1521, and one group is accessed through 1522.
-
One listener listens to multiple port cases
Method 1: add ports on the server side with the netmgr tool
[oracle@oracle3 admin] $cat listener.ora
# listener.ora Network Configuration File: / u01/oracle/product/10.2.0/db_1/network/admin/listener.ora
# Generated by Oracle configuration tools.
LISTENER1 =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = oracle3) (PORT = 1522))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = oracle3) (PORT = 1527))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = oracle3) (PORT = 1528))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = oracle3) (PORT = 1529))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = oracle3) (PORT = 1530))
)
)
SID_LIST_LISTENER1 =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = / u01/oracle/product/10.2.0/db_1)
(PROGRAM = extproc)
)
(SID_DESC =
(SID_NAME = ORCL)
(ORACLE_HOME = / u01/oracle/product/10.2.0/db_1)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC) (KEY = EXTPROC1))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = oracle3) (PORT = 1521))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = oracle3) (PORT = 1523))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = oracle3) (PORT = 1524))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = oracle3) (PORT = 1525))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = oracle3) (PORT = 1526))
)
)
Method 2: change the configuration file directly
The other two listeners need to configure the SID_LIST_ string, and the listener configuration file is finally:
[oracle@oracle3 admin] $cat listener.ora
# listener.ora Network Configuration File: / u01/oracle/product/10.2.0/db_1/network/admin/listener.ora
# Generated by Oracle configuration tools.
LISTENER1 =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = oracle3) (PORT = 1522))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = oracle3) (PORT = 1527))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = oracle3) (PORT = 1528))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = oracle3) (PORT = 1529))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = oracle3) (PORT = 1530))
)
)
SID_LIST_LISTENER1 =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = / u01/oracle/product/10.2.0/db_1)
(PROGRAM = extproc)
)
(SID_DESC =
(SID_NAME = ORCL)
(ORACLE_HOME = / u01/oracle/product/10.2.0/db_1)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC) (KEY = EXTPROC1))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = oracle3) (PORT = 1521))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = oracle3) (PORT = 1523))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = oracle3) (PORT = 1524))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = oracle3) (PORT = 1525))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = oracle3) (PORT = 1526))
)
)
Architecture diagram:
LISTENER1 (1522, 1527-1530) LISTENER (1521, 1523-1526)
| | |
-
| |
ORCL
| |
Oracle software
Try to access oracle server through different listeners and different ports
[oracle@oracle3 admin] $lsnrctl status LISTENER
LSNRCTL for Linux: Version 10.2.0.4.0-Production on 06-JUN-2014 14:54:41
Copyright (c) 1991, 2007, Oracle. All rights reserved.
Connecting to (DESCRIPTION= (ADDRESS= (PROTOCOL=IPC) (KEY=EXTPROC1)
STATUS of the LISTENER
-
Alias LISTENER
Version TNSLSNR for Linux: Version 10.2.0.4.0-Production
Start Date 06-JUN-2014 14:48:35
Uptime 0 days 0 hr. 6 min. 5 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File / u01/oracle/product/10.2.0/db_1/network/admin/listener.ora
Listener Log File / u01/oracle/product/10.2.0/db_1/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION= (ADDRESS= (PROTOCOL=ipc) (KEY=EXTPROC1)
(DESCRIPTION= (ADDRESS= (PROTOCOL=tcp) (HOST=oracle3) (PORT=1521))
(DESCRIPTION= (ADDRESS= (PROTOCOL=tcp) (HOST=oracle3) (PORT=1523))
(DESCRIPTION= (ADDRESS= (PROTOCOL=tcp) (HOST=oracle3) (PORT=1524))
(DESCRIPTION= (ADDRESS= (PROTOCOL=tcp) (HOST=oracle3) (PORT=1525))
(DESCRIPTION= (ADDRESS= (PROTOCOL=tcp) (HOST=oracle3) (PORT=1526))
Services Summary...
Service "ORCL" has 2 instance (s).
Instance "ORCL", status UNKNOWN, has 1 handler (s) for this service...
Instance "ORCL", status READY, has 1 handler (s) for this service...
Service "ORCLXDB" has 1 instance (s).
Instance "ORCL", status READY, has 1 handler (s) for this service...
Service "ORCL_XPT" has 1 instance (s).
Instance "ORCL", status READY, has 1 handler (s) for this service...
Service "PLSExtProc" has 1 instance (s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler (s) for this service...
The command completed successfully
[oracle@oracle3 admin] $lsnrctl status LISTENER1
LSNRCTL for Linux: Version 10.2.0.4.0-Production on 06-JUN-2014 14:54:47
Copyright (c) 1991, 2007, Oracle. All rights reserved.
Connecting to (DESCRIPTION= (ADDRESS= (PROTOCOL=TCP) (HOST=oracle3) (PORT=1522)
STATUS of the LISTENER
-
Alias LISTENER1
Version TNSLSNR for Linux: Version 10.2.0.4.0-Production
Start Date 06-JUN-2014 14:49:08
Uptime 0 days 0 hr. 5 min. 39 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File / u01/oracle/product/10.2.0/db_1/network/admin/listener.ora
Listener Log File / u01/oracle/product/10.2.0/db_1/network/log/listener1.log
Listening Endpoints Summary...
(DESCRIPTION= (ADDRESS= (PROTOCOL=tcp) (HOST=oracle3) (PORT=1522))
(DESCRIPTION= (ADDRESS= (PROTOCOL=tcp) (HOST=oracle3) (PORT=1527))
(DESCRIPTION= (ADDRESS= (PROTOCOL=tcp) (HOST=oracle3) (PORT=1528))
(DESCRIPTION= (ADDRESS= (PROTOCOL=tcp) (HOST=oracle3) (PORT=1529))
(DESCRIPTION= (ADDRESS= (PROTOCOL=tcp) (HOST=oracle3) (PORT=1530))
Services Summary...
Service "ORCL" has 1 instance (s).
Instance "ORCL", status UNKNOWN, has 1 handler (s) for this service...
Service "PLSExtProc" has 1 instance (s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler (s) for this service...
The command completed successfully
Static registration-the listening parameters are added manually to force the ORCL to be registered with the listener after the listening is started. Because it is mandatory, you can only confirm that the listener is correct, but
The database is not necessarily accessible, so the status is UNKNOW. But access has nothing to do with this state.
Dynamic registration-according to the configuration in the listening configuration file, the oracle background process pmon registers the ORCL with the listener and must be able to access it, because the PMON process will test. However, PMON does not register all the time, and there is a time interval, so it is not necessary to start the database first and then start listening.
Immediately monitored, there is a time delay, because there is a time interval between pmon's work. Once the monitor is heard, the status is ready, that is, it must be able to access.
[oracle@oracle3 admin] $ps-ef | grep ora_pmon
Oracle 9190 1 0 11:07? 00:00:00 ora_pmon_ORCL
The registration method for Oracle default listeners is dynamic registration, that is, to register with the default listener LISTENER. SID_LIST_LISTENER is not required in the listener.ora file. But static registration must be SID_LIST_ listener string and LISTENER string.
LISTENER1 =-- LISTENER1 static registration
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = oracle3) (PORT = 1522))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = oracle3) (PORT = 1527))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = oracle3) (PORT = 1528))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = oracle3) (PORT = 1529))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = oracle3) (PORT = 1530))
)
)
SID_LIST_LISTENER1 =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = / u01/oracle/product/10.2.0/db_1)
(PROGRAM = extproc)
)
(SID_DESC =
(SID_NAME = ORCL)
(ORACLE_HOME = / u01/oracle/product/10.2.0/db_1)
)
)
LISTENER =-- LISTENER dynamic registration
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC) (KEY = EXTPROC1))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = oracle3) (PORT = 1521))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = oracle3) (PORT = 1523))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = oracle3) (PORT = 1524))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = oracle3) (PORT = 1525))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = oracle3) (PORT = 1526))
)
)
You can change the default registration listener: to change the default listener from LISTENER to LISTENER1 (LISTENER1 to dynamic, LISTENER to static), you need to do the following steps:
Step1: configure a connection string in the tnsname.ora file of oracle server:
ORCL =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP) (HOST = 10.1.3.3) (PORT = 1522)-- 1522 listeners are non-default LISTENER1
)
)
Step2: modify oracle parameters:
SQL > alter system set local_listener=ORCL
The system has changed. -- in this way, oracle registers dynamically with the listener corresponding to 1522 by default.
Step3: modifying listener.ora fil
[oracle@oracle3 admin] $cat listener.ora
# listener.ora Network Configuration File: / u01/oracle/product/10.2.0/db_1/network/admin/listener.ora
# Generated by Oracle configuration tools.
LISTENER1 =-- LISTENER1 becomes dynamic registration
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = oracle3) (PORT = 1522))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = oracle3) (PORT = 1527))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = oracle3) (PORT = 1528))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = oracle3) (PORT = 1529))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = oracle3) (PORT = 1530))
)
)
SID_LIST_LISTENER =-- LISTENER becomes static registration
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = / u01/oracle/product/10.2.0/db_1)
(PROGRAM = extproc)
)
(SID_DESC =
(SID_NAME = ORCL)
(ORACLE_HOME = / u01/oracle/product/10.2.0/db_1)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC) (KEY = EXTPROC1))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = oracle3) (PORT = 1521))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = oracle3) (PORT = 1523))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = oracle3) (PORT = 1524))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = oracle3) (PORT = 1525))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = oracle3) (PORT = 1526))
)
)
Step4: dynamic registration cannot take effect immediately. You have to wait for the pmon process. There is a delay, but you can force it immediately.
SQL > alter system register;-- compulsory registration without waiting for pmon
The system has changed.
Step5: confirm
[oracle@oracle3 admin] $lsnrctl status
LSNRCTL for Linux: Version 10.2.0.4.0-Production on 06-JUN-2014 16:05:49
Copyright (c) 1991, 2007, Oracle. All rights reserved.
Connecting to (DESCRIPTION= (ADDRESS= (PROTOCOL=IPC) (KEY=EXTPROC1)
STATUS of the LISTENER
-
Alias LISTENER
Version TNSLSNR for Linux: Version 10.2.0.4.0-Production
Start Date 06-JUN-2014 15:46:21
Uptime 0 days 0 hr. 19 min. 28 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File / u01/oracle/product/10.2.0/db_1/network/admin/listener.ora
Listener Log File / u01/oracle/product/10.2.0/db_1/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION= (ADDRESS= (PROTOCOL=ipc) (KEY=EXTPROC1)
(DESCRIPTION= (ADDRESS= (PROTOCOL=tcp) (HOST=oracle3) (PORT=1521))
(DESCRIPTION= (ADDRESS= (PROTOCOL=tcp) (HOST=oracle3) (PORT=1523))
(DESCRIPTION= (ADDRESS= (PROTOCOL=tcp) (HOST=oracle3) (PORT=1524))
(DESCRIPTION= (ADDRESS= (PROTOCOL=tcp) (HOST=oracle3) (PORT=1525))
(DESCRIPTION= (ADDRESS= (PROTOCOL=tcp) (HOST=oracle3) (PORT=1526))
Services Summary...
Service "ORCL" has 1 instance (s).
Instance "ORCL", status UNKNOWN, has 1 handler (s) for this service... -- LISTENER is statically registered
Service "PLSExtProc" has 1 instance (s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler (s) for this service...
The command completed successfully
[oracle@oracle3 admin] $lsnrctl status LISTENER1
LSNRCTL for Linux: Version 10.2.0.4.0-Production on 06-JUN-2014 16:06:24
Copyright (c) 1991, 2007, Oracle. All rights reserved.
Connecting to (DESCRIPTION= (ADDRESS= (PROTOCOL=TCP) (HOST=oracle3) (PORT=1522)
STATUS of the LISTENER
-
Alias LISTENER1
Version TNSLSNR for Linux: Version 10.2.0.4.0-Production
Start Date 06-JUN-2014 15:46:28
Uptime 0 days 0 hr. 19 min. 56 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File / u01/oracle/product/10.2.0/db_1/network/admin/listener.ora
Listener Log File / u01/oracle/product/10.2.0/db_1/network/log/listener1.log
Listening Endpoints Summary...
(DESCRIPTION= (ADDRESS= (PROTOCOL=tcp) (HOST=oracle3) (PORT=1522))
(DESCRIPTION= (ADDRESS= (PROTOCOL=tcp) (HOST=oracle3) (PORT=1527))
(DESCRIPTION= (ADDRESS= (PROTOCOL=tcp) (HOST=oracle3) (PORT=1528))
(DESCRIPTION= (ADDRESS= (PROTOCOL=tcp) (HOST=oracle3) (PORT=1529))
(DESCRIPTION= (ADDRESS= (PROTOCOL=tcp) (HOST=oracle3) (PORT=1530))
Services Summary...
Service "ORCL" has 1 instance (s).
Instance "ORCL", status READY, has 1 handler (s) for this service... -- LISTENER1 is dynamic registration
Service "ORCLXDB" has 1 instance (s).
Instance "ORCL", status READY, has 1 handler (s) for this service...
Service "ORCL_XPT" has 1 instance (s).
Instance "ORCL", status READY, has 1 handler (s) for this service...
The command completed successfully
Note:
1. An instance can only have one dynamically registered listener, and can have multiple listeners that are statically registered.
2. Dynamic registration listeners are not available at certain times. When pmon is off, you need to add a static registration listener to ensure that the database can be accessed at all times.
3. Multiple listeners can balance the load of access.
4. Whether to use default listeners or non-default listeners for dynamic registration depends on the local_listener parameter. The default is NULL, which means that the default LISTENER is dynamically registered. If there is a value, find the dynamically registered listener based on the value.
The above is all the contents of the article "how to achieve Network configuration in oracle". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.