Networking for Oracle Database
Oracle Net is a software layer that maintains connection between the client and the database over the network. Client application identifies the database it wants to connect to, through the service name which is the logical representation of the database. Multiple services can be configured on the single database.
What is Oracle Listener?
Oracle listener is a process to listen request from client connection to database server. Default listener configuration is stored in the listener.ora file located at $ORACLE_HOME/network/admin directory.
When listener starts, database and its services gets dynamically registered with the listener. PMON is responsible for database service registration to the listener. When services gets registered there is no need of any modifications to the listener.ora file.
Listener Commands
1) Starting the listener
[oracle@cobra01 ~]$ lsnrctl start
[oracle@cobra01 ~]$ lsnrctl start
2) Stopping the listener
[oracle@cobra01 ~]$ lsnrctl stop
3) Check the listener status
[oracle@cobra01 ~]$ lsnrctl status
4) Check if listener process is running
[oracle@cobra01 ~]$ ps -ef|grep tns
What is NETCA?
NETCA is the utility used to configure listener and also used to add an entry to tnsnames.ora file. Connection descriptors gets stored on the tnsnames.ora file that identifies their net service names
Configure Listener using NETCA utility
1) Run netca command to invoke the network configuration assistant
[oracle@cobra01 ~]$ netca
2) Select Add option and click on Next
3) Provide Oracle service name or database name then click on Next
4) We will select TCP protocol option in the list box and click on Next
5) Provide the Hostname and port number. Default port is 1521, in our case will will keep port number as it is. Then click on Next
6) Select Option Yes, perform a test. This is to make sure that a connection can access the database
7) Here in the screen shot provided, tests have been cleared. In case the test fails check if you have entered the correct login credentials. Login credentials can be updated by pressing change login button. Everything seems to be fine, so click on Next to proceed forward
8) Click on No Option and click Next
9) We have successfully completed listener configuration, finally click on Next
10) Click on the Finish button, this will close the netca window
11) Now check the listener status, it must have started already
[oracle@cobra01 ~]$ lsnrctl status
LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 30-AUG-2016 19:14:05
Copyright (c) 1991, 2009, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=cobra01.localdomain)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date 30-AUG-2016 19:13:01
Uptime 0 days 0 hr. 1 min. 4 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/cobra01/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=cobra01.localdomain)(PORT=1521)))
Services Summary...
Service "KMDB" has 1 instance(s).
Instance "KMDB", status READY, has 1 handler(s) for this service...
Service "KMDBXDB" has 1 instance(s).
Instance "KMDB", status READY, has 1 handler(s) for this service...
The command completed successfully
No comments:
Post a Comment