Oracle之Listener添加
给远程添加
alter system set remote_listener='(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.137.9)(PORT=1521))))' sid='orcl' scope=both;
alter system set remote_listener='(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.137.9)(PORT=1521))))' sid='orcl';
正确步骤:
修改scan_listener
grid:srvctl modify scan_listener -p 1521
oracle:alter system set remote_listener='scan-ip:11522' scope=both;
srvctl stop scan_listener
srvctl start scan_listener
修改local_listener
grid:srvctl modify listener -l LISTENER -p “TCP:1521”
oracle:
alter system set local_listener='(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.137.6)(PORT=1521))))' sid='orcl' scope=both;
oracle:
alter system set local_listener='(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.137.8)(PORT=1521))))' sid='orcl2' scope=both;
grid:srvctl stop listener
grid:srvctl start listener
添加新的监听
srvctl config network
srvctl add listener -l LISTENER1 -o $ORACLE_HOME -p 11522 -k 1
--srvctl remove listener -l LISTENER1 -o $ORACLE_HOME -p 11522 -k 1
srvctl start listener -l LISTENER1
srvctl stop listener -l LISTENER1
SID_LIST_LISTENER4 =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = orcl)
(ORACLE_HOME = /u01/app/12.1.0/grid)
(SID_NAME = orcl1)
)
)
设置set local_listener
srvctl config listener -a
srvctl status listener
--------grid--------
alter system set local_listener='(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.137.6)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.137.6)(PORT=11522))))' sid='+ASM1' scope=both;
alter system set local_listener='(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.137.8)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.137.8)(PORT=11522))))' sid='+ASM2' scope=both;
-----oracle------
alter system set local_listener='(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.137.6)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.137.6)(PORT=11522))))' sid='orcl1' scope=both;
alter system set local_listener='(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.137.8)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.137.8)(PORT=11522))))' sid='orcl2' scope=both;