- Listener --> server side configuration file --> listener.ora
- TNSnames --> Client side configuration file --> tnsnames.ora
listener.ora
- it contains port.
- on which port the database is listening.
- protocol --> TCP ( on which protocol its running )
- hostname or IP address
- All these can assigned to Listener name, so that we can start and stop the listener ( Alias Name )
- location --> TNS admin ? --> network configuration location.
- This network location will be in $ORACLE_HOME/network/admin
- Listener Base --> Listener related logs will go here, its like a base directory.
- lsnrctl --> listener Control
lsnrctl start name_of_the_listener
lsnrctl status name_of_the_listener
- Change the listener port , now the scenario will be like --> Listener is running in 1522 but the LREG takes the details of DB and then search for 1521 port. Even if you wait for 60 secs it wont happen . So your Listener will never get the update of DB details. " The Listener supports no service " --> That means Listener doesn't have any DB details.
- show parameter local_listener;
- alter system set local_listener = ' ( Address = ... ) ' ;
- Now my LREG is aware where my listener is running.
Static Registration
- Static registration with SID OR Service name.
- Forcing the listener to register the DB details ( don't worry about the status of the DB , but just register )
- UNKNOWN is the static registration.
- What is the purpose of registering with Static registration ? --> Its used in Data Guard Build for online mode is one of the use case.
tnsnames.ora
- Its a client side configuration file.
- The client may connect from any application.
- Inside the file we need : Port , protocol , hostname or IP address , service name ( name of the DB will be equal to service name , most of the time )
- All these 4 details are required.
- The client will connect with these parameters along with username and password. -Each time all these details to be passed , to avoid this , Oracle came up with ALIAS NAME in the tnsnames.ora file which is inside the network admin file.
sqlnet.ora
- Both server and client side file.
- It can be used for many purposes.
- If there is any miss-match in version at any side , client or server side , at that time this HERO will come into picture. OR at TDE / Wallet usage.
- In simple terms , its used in : ( search in internet "sqlnet.ora" )
lower client version
wallet location
AD/LDAP
Connect Timeout ( Client to server connectivity )
40 or > 40 parameters can be defined.
NOTE
- Oracle_home will be more or less like --> /u01/app/oracle/product/19.0.0.1/dbhome_1
- Listener supports no service.
- For every 60 secs these pmon goes to listener and registers its details. what details ? DB details . This is as per 11g.
- LREG in 12c --> Listener register , every 60 secs it registers the DB details with the LISTENER. This registration happens only when the DB is running with 1521 PORT.
- Listener is a dynamic parameter.
- What is UNKNOWN ? when we check the listener status ? [TBD] --> Ready or Unknown. READY --> Dynamic Registration , UNKNOWN --> Static Registration --> we have the DB details in the listener configuration file and forcing the listener to register the DB details and don't worry about the DB status.
Commands
su - oracle
. oraenv
env | grep ORA
ps -ef|grep tns
ps -ef|grep lreg
sqlplus / as sysdba
telnet host 1521
netstats -anp | grep 1521
ps -ef|grep smon
startup
sqlplus user/password
sqlplus user/password@"(DESCRIPTION ...)
select instance_name from v$instance;
show user;
sqlplus user/password@alias_name;
Issues
- Firewall Issues.
- Listener may be wrong.
- Port may be wrong.
- Listener may be down.
Questions
- Can we setup a secured listener ? This can be done at the Protocol parameter.
- what is the difference between SID or service name ?
- TNS_ADMIN --> location of the network configuration files.
- What are the network configuration files ?
listener.ora
tnsnames.ora
sqlnet.ora
- Client software's like Oracle Client download , netca , netmgr , OEM , JDBC , ODBC , toad app , sql developer , linux , windows etc
- Backup & Recovery software's --> rubrik , Tivoli Storage Manager database - IBM.
Reference
https://www.oracle.com/in/database/technologies/instant-client/downloads.html
Top comments (0)