修改默认端口号

oracle 监听器如果使用动态注册的话,默认只能动态注册1521端口

如果要修改端口号:必须修改数据库中的参数

local_listener

如下:

  1. 监听文件

    db11@oracle  /u01/app/oracle11g/product/11.2.0/dbhome_1/network/admin$ vi listener.ora 
    LISTENER =
    (ADDRESS_LIST=
           (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.2.100)(PORT=1526))
           (ADDRESS=(PROTOCOL=ipc)(KEY=PNPKEY)))
  2. 修改参数
    ```
    SQL> show parameter listener

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
listener_networks string
local_listener string
remote_listener string

SQL> alter system set local_listener='(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.2.100)(PORT=1526))';

System altered.

SQL> show parameter listener

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
listener_networks string
local_listener string (ADDRESS=(PROTOCOL=tcp)(HOST=1
92.168.2.100)(PORT=1526))
remote_listener string
SQL>

3. 查看状态

/u01/app/oracle11g/product/11.2.0/dbhome_1/network/admin$ lsnrctl status

LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 21-JAN-2015 23:56:43

Copyright (c) 1991, 2013, Oracle. All rights reserved.

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.2.100)(PORT=1526))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date 21-JAN-2015 23:54:50
Uptime 0 days 0 hr. 1 min. 53 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle11g/product/11.2.0/dbhome_1/network/admin/listener.ora
Listener Log File /u01/app/oracle11g/diag/tnslsnr/oracle/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.2.100)(PORT=1526)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=PNPKEY)))
Services Summary...
Service "db11" has 1 instance(s).
Instance "db11", status READY, has 1 handler(s) for this service...
Service "db11XDB" has 1 instance(s).
Instance "db11", status READY, has 1 handler(s) for this service... -----已经注册进去
The command completed successfully

4. 测试连接

/u01/app/oracle11g/product/11.2.0/dbhome_1/network/admin$ sqlplus :1526/db11

SQL*Plus: Release 11.2.0.4.0 Production on Thu Jan 22 00:00:24 2015

Copyright (c) 1982, 2013, Oracle. All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL>
```

你可能感兴趣的:(端口)