一、静态监听
创建端口为1521的监听,静态注册,本机ip:192.168.10.2
[oracle@localhost ~]$ vi /u01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora
LISTENER = (ADDRESS_LIST= (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.10.2)(PORT=1521)) ) SID_LIST_LISTENER= (SID_LIST= (SID_DESC= (GLOBAL_DBNAME=lgr) (SID_NAME=LGR) (ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1) ) )
名词解释:
PROTOCOL= 协议名称
HOST= 主机名称或者主机IP
PORT= 监听端口
GLOBAL_DBNAME:和SERVICE 相同,SQL> show parameter service;可查看
SID_NAME: cd /home/oracle,cat .bash_profile --查看SID_NAME,方式1 ,ps –ef|prep ora --查看SID_NAME,方式2
ORACLE_HOME:cat .bash_profile --查看
二、动态监听
创建端口为1526的监听,动态注册,本机ip:192.168.10.2
[oracle@localhost ~]$ vi /u01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora
LISTENER = (ADDRESS_LIST= (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.10.2)(PORT=1526)) )