oracle 为不同pdb指定不同监听端口

业务方需要新建一个pdb,要求与原pdb通过不同监听端口连接增加一层安全保护,记录一下操作方法:

 

1. 新建pdb及用户(略)

 

2. 配置listener.ora

监听文件内容如下

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (GLOBAL_DBNAME = pdb_a)
      (ORACLE_HOME = /path/cdbname)
      (SID_NAME = cdbname)
    )
    (SID_DESC =
      (GLOBAL_DBNAME = pdb_a)
      (SID_NAME = cdbname)
    )
  )

LISTENER =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = ip)(PORT = 1521))
  )

SID_LIST_newpdb =
  (SID_LIST =
    (SID_DESC =
      (GLOBAL_DBNAME = newpdb)
      (SID_NAME = cdbname)
    )
  )

newpdb =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = ip)(PORT = 1525))
  )

 

3. 启动新监听

lsnrctl start newpdb
lsnrctl status newpdb

#输出类似
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ip)(PORT=1525)))
Services Summary...
Service "newpdb" has 1 instance(s).
  Instance "cdbname", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully

 

4. 配置tnsnames.ora

newpdb =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = ip)(PORT = 1525))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = newpdb)
    )
  )

 

5. 测试连接

sqlplus system@newpdb
#能连上即可
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Hehuyi_In

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值