ORACLE启用非默认监听端口
阅读原文时间:2023年07月09日阅读:2

1、修改listener.ora文件

LISTENER_TEST =

        (DESCRIPTION =

                (ADDRESS = (PROTOCOL = TCP)(HOST = yang.oracle.com)(PORT = 5000))

        )

2、修改tnsnames.ora文件

PROD1_TEST =

      (DESCRIPTION =

            (ADDRESS = (PROTOCOL = TCP)(HOST = yang.oracle.com)(PORT = 5000))

                (CONNECT_DATA =

                  (SERVICE_NAME = prod1.oracle.com)

                )

     )

3、启动监听

lsnrctl start listener_test

4、修改local_listener参数指定监听

alter system set local_listener='(ADDRESS = (PROTOCOL = TCP)(HOST = yang.oracle.com)(PORT = 5000))' ;

或者

-- 或直接指定 tnsnames.ora 中的服务入口名:

alter system set local_listener='PROD1_TEST' scope=both;

5、重新注册监听信息

alter system register;