DBA Hub

📋Steps in this guide1/1

RAC LISTENERS -learnomate

The listener.ora file configures RAC listeners, specifying the protocol addresses for connection requests and optimizing network communications effectively.

oracle configurationintermediate
by OracleDba
15 views
1

Overview

RAC LISTENERS -learnomate The listener.ora file is the configuration file for a listener. It can include the protocol addresses it is accepting connection requests on, a list of the database and other services it is listening for, and control parameters used by the listener. You can modify the configuration of the listeners used by Oracle Clusterware and Oracle RAC with Server Control Utility (SRVCTL) commands, or by using NETCA. Manual editing of the listener.ora file is not required. Each listener is configured with one or more protocol addresses that specify its listening endpoints. The listener agent dynamically updates endpoints with the listener. Starting with Oracle Database 11 g Release 2, the listener.ora file now only contains an IPC key and the following information: (ADDRESS = (PROTOCOL=TCP)(HOST=)(PORT=1521)) The listener.ora file is the same on every node for an Oracle RAC database. Listening endpoints, such as the port numbers, are dynamically registered with the listener. Before you install Oracle RAC, during the Oracle Grid Infrastructure installation, NETCA creates and starts a default listener in the Grid home called LISTENER. The listener is configured with default protocol listening addresses. The listener is configured to respond to connection requests that are directed to one protocol address specified during installation. During the Oracle RAC installation, the Oracle RAC database uses the listener in the Grid home, and configures service information about the Oracle RAC database. The database services automatically register their information with the listener, such as the service name, instance names, and load information. Dynamic service registration eliminates the need for static configuration of database services. How to verify the ASM Listener and SCAN listener? ================================= Grid $ cd $ORACLE_HOME/network/admin/ Cat listener.ora Lsnrctl status LISTENER lsnrctl status LISTENER_SCAN1 Lsnrctl status >>>Default it will be pointing to GI Listener (LISTENER) crsctl stat res -t >>>>verify ora.LISTENER.lsnr and ora.LISTENER_SCAN1.lsnr services Service Creation at cluster level ========================= Srvctl add service -d prim -s Myservice -r prim1 -a prim2 -P BASIC srvctl status service -d prim -s Myservice srvctl start service -d prim -s Myservice srvctl status service -d prim -s Myservice Srvctl config service -d prim -s Myservice Srvctl modify service -d prim -s Myservice -P NONE Srvctl remove service -d prim -s Myservice srvctl add service -d prim -service SRV_RMAN -preferred prim1,prim2 srvctl add service -db prim prim -service Myservice -oldinst prim1 -newinst prim2 Adding local LISTENER LISTENER_prim to the cluster . oraenv prim1 Srvctl add listener -l LISTENER_prim -p 1522 -o /u01/app/oracle/product/19C/dbhome . oraenv prim2 Srvctl add listener -l LISTENER_prim -p 1522 -o /u01/app/oracle/product/19C/dbhome Verifying srvctl config listener -l LISTENER_prim Ps -ef|grep tns [/php] <strong>Creating new local listener on both nodes</strong> <strong>login as oracle</strong> <strong>change default port from 1521 to 1522 on both nodes</strong> ================================ alter system set local_listener ='(DESCRIPTION= (ADDRESS_LIST= (ADDRESS=(PROTOCOL=TCP)(HOST=192.168.56.81)(PORT=1522))))’ scope=BOTH SID=’prim1′; alter system set local_listener ='(DESCRIPTION= (ADDRESS_LIST= (ADDRESS=(PROTOCOL=TCP)(HOST=192.168.56.82)(PORT=1522))))’ scope=BOTH SID=’prim2′; sqlplus / as sysdba SQL&gt;show parameter local_listener NAME TYPE VALUE Local_listener string (ADDRESS=(PROTOCOL=TCP)(HOST=192.168.56.81) (PORT=1522)) lsnrctl status LISTENER_prim lsnrctl stop LISTENER_prim <strong>How to find the SCAN information?</strong> <strong>How to find the Listener information?</strong> <strong>How to find the network information?</strong> Connect to pdb using services [oracle@node1 ~]$ srvctl add service -d prim -s pdbsvc -pdb PDBPRIM -preferred prim1 -available prim2 -P BASIC

Code/Command (click line numbers to comment):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
srvctl config listener
To change default LISTENER port,user,home
srvctl modify listener -1 LISTENER -p TCP:1545
srvctl modify listener -l LISTENER -u root
srvctl modify listener -1 LISTENER -o /u01/app/oracle/product/19.0.0.0/dbhome_1

oracle$
cd $ORACLE_HOME/network/admin
Cat listener.ora
lsnrctl status LINTENER_prim
lsnrctl start LISTENER_prim
alter system set local_listener ='(DESCRIPTION= (ADDRESS_LIST= (ADDRESS=(PROTOCOL=TCP)(HOST=192.168.56.81)(PORT=1522))))' scope=BOTH SID='prim1';
alter system set local_listener ='(DESCRIPTION= (ADDRESS_LIST= (ADDRESS=(PROTOCOL=TCP)(HOST=192.168.56.82)(PORT=1522))))' scope=BOTH 
SID='prim2';
alter system register;
Show parameter local
Show parameter listener
root$
crsctl stat res -t
>>>>verify that LISTENER_prim not registered with the cluster

1.crsctl stop crs -f
2.ps -ef|grep smon or tns(All services will stop but LISTENER_prim will not stop.we need to manually stop database listener
3.crsctl start crs

lsnrctl status LISTENER_prim
lsnrctl stop LISTENER_prim
lsnrctl status LISTENER_prim
Fail Attemp:(default it will add to GI Home)
oracle$
srvctl add listener -l LISTENER_prim -p 1522
srvctl start listener -l LISTENER_prim

Grid Owner
grid$
srvctl add listener -l LISTENER_prim -p 1522
srvctl start listener -l LISTENER_prim
srvctl status listener -l LISTENER_prim
lsnrctl status LISTENER_prim
crsctl stat res -t
oracle$
ps -ef|grep tns
grid $
cd /u01/app/oracle/product/19C/dbhome/network/admin
>>>>>>>>>>Verify LISTENER_prim added now

srvctl add listener -l LISTENER_prim -p 1522
srvctl start listener -l LISTENER_prim
srvctl status listener -l LISTENER_prim
lsnrctl status LISTENER_prim
lsnrctl stop LISTENER_prim
lsnrctl status LISTENER_prim

Oracle $
lsnrctl status LISTENER_prim
lsnrctl stop LISTENER_prim
srvctl config listener -l LISTENER_prim

Grid $
lsnrctl stop LISTENER_prim
Lsnrctl stop LISTENER_prim
srvctl remove listener -l LISTENER_prim
cd
cat listener.ora
>>>>>remove manually LISTENER_prim entry

grid $
Srvctl add listener -l LISTENER_prim -p 1522 -o grid home
Srvctl config listener -l LISTENER_prim
Srvctl status listener -l LISTENER_prim
srvctl start listener -l LISTENER_prim

grid $
srvctl remove listener -l LISTENER_prim

oracle $
Srvctl add listener -l LISTENER_prim -p 1522 -o u01/app/oracle/product/19C/dbhome
srvctl config listener -l LISTENER_prim
Srvctl status listener -l LISTENER_prim
Srvctl start listener -l LISTENER_prim
srvctl status LISTENER_prim
Lsnrctl stop LISTENER_prim
Lsnrctl status LISTENER_prim
Lsnrctl start LISTENER_prim

crsctl stop crs -f
>>>>>will bring down local listener also along with the cluster listener
Crsctl start crs
>>>>> will bring up your local listener also along with the cluster listener
Verify:
oracle $
Cd $ORACLE_HOME/network/admin
Cat tnsnames.ora
sqlplus sys/pw@prim_SCAN as sysdba
Sqlplus sys/pw@prim_VIP as sysdba

The SCAN bundle
Grid $
Srvctl add scan -h
Adds SCAN VIP to the oracle Cluster
Usage:srvctl add scan -n

-n
-S //[if1[if2…]]
NET address spec for network
-h print usage

srvctl modify scan -scanname nodescan
Note:SCAN cal only operate on one network/in one subnet.

. oraenv<br />prim1</p><p>env |grep ORA<br />ORACLE_SID=prim1<br />ORACLE_BASE=/u01/app/oracle<br />ORACLE_HOME=/u01/app/oracle/product/19C/dbhome</p><p>cd $ORACLE_HOME/network/admin</p><p>vi listener.ora</p><p>LISTENER_prim =<br />(DESCRIPTION =<br />(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.56.81)(PORT = 1522))<br />(CONNECT_DATA =<br />(SERVER = DEDICATED)<br />(SERVICE_NAME = prim)<br />)<br />)<br />ADR_BASE_LISTENER_prim = /u01/app/oracle</p><p>. oraenv<br />prim2</p><p>env |grep ORA<br />ORACLE_SID=prim2<br />ORACLE_BASE=/u01/app/oracle<br />ORACLE_HOME=/u01/app/oracle/product/19C/dbhome</p><p>LISTENER_prim =<br />(DESCRIPTION =<br />(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.56.82)(PORT = 1522))<br />(CONNECT_DATA =<br />(SERVER = DEDICATED)<br />(SERVICE_NAME = prim)<br />)<br />)<br />ADR_BASE_LISTENER_prim = /u01/app/oracle</p><p>

Srvctl config SCAN

srvctl config listener

Srvctl config network

Comments (0)

Please to add comments

No comments yet. Be the first to comment!