修改oracle数据库监听端口号
2016-05-10 16:23
597 查看
oracle默认端口号是1521.很容易就被黑客扫描到然后天天惦记你的数据库
所以修改默认端口号就很有必要了
1、首先查看监听状态
lsnrctl status
2、关闭监听
lsnrctl stop
3、修改监听文件1521====>10001
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(ORACLE_HOME = /u01/11g)
(SID_NAME = pu)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = target)(PORT = 10001))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)
ADR_BASE_LISTENER = /u01/oracle
4、登陆数据库修改local_listenner
SQL> show parameter local_listener
NAME TYPE
------------------------------------ ----------------------
VALUE
------------------------------
local_listener string
VALUES值为空
修改local_listener参数
SQL> show parameter local_liste
NAME TYPE
------------------------------------ ----------------------
VALUE
------------------------------
local_listener string
SQL> alter system set local_listener="(address = (protocol = tcp)(host = target)
2 (port = 10001))";
System altered.
SQL> show parameter local_lis
NAME TYPE
------------------------------------ ----------------------
VALUE
------------------------------
local_listener string
(address = (protocol = tcp)(ho
st = target)
(port = 10001))
5、启动监听
[oracle@target ~]$ lsnrctl start
LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 10-MAY-2016 16:48:35
Copyright (c) 1991, 2011, Oracle. All rights reserved.
Starting /u01/11g/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 11.2.0.3.0 - Production
System parameter file is /u01/11g/network/admin/listener.ora
Log messages written to /u01/oracle/diag/tnslsnr/target/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=target)(PORT=10001)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=target)(PORT=10001)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.3.0 - Production
Start Date 10-MAY-2016 16:48:36
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/11g/network/admin/listener.ora
Listener Log File /u01/oracle/diag/tnslsnr/target/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=target)(PORT=10001)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Services Summary...
Service "pu" has 1 instance(s).
Instance "pu", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
6、查看系统状态
[oracle@target ~]$ netstat -ano|grep 10001
tcp 0 0 192.168.6.152:26082 192.168.6.152:10001 ESTABLISHED off (0.00/0/0)
tcp 0 0 :::10001 :::* LISTEN off (0.00/0/0)
tcp 0 0 ::ffff:192.168.6.152:10001 ::ffff:192.168.6.152:26082 ESTABLISHED keepalive (7193.37/0/0)
已经开启10001端口号
7、验证登陆
[oracle@target ~]$ sqlplus / as sysdba@target:10001:pu
SQL*Plus: Release 11.2.0.3.0 Production on Tue May 10 16:50:50 2016
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Oracle Label Security, OLAP, Data Mining,
Oracle Database Vault and Real Application Testing options
SQL>
所以修改默认端口号就很有必要了
1、首先查看监听状态
lsnrctl status
2、关闭监听
lsnrctl stop
3、修改监听文件1521====>10001
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(ORACLE_HOME = /u01/11g)
(SID_NAME = pu)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = target)(PORT = 10001))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)
ADR_BASE_LISTENER = /u01/oracle
4、登陆数据库修改local_listenner
SQL> show parameter local_listener
NAME TYPE
------------------------------------ ----------------------
VALUE
------------------------------
local_listener string
VALUES值为空
修改local_listener参数
SQL> show parameter local_liste
NAME TYPE
------------------------------------ ----------------------
VALUE
------------------------------
local_listener string
SQL> alter system set local_listener="(address = (protocol = tcp)(host = target)
2 (port = 10001))";
System altered.
SQL> show parameter local_lis
NAME TYPE
------------------------------------ ----------------------
VALUE
------------------------------
local_listener string
(address = (protocol = tcp)(ho
st = target)
(port = 10001))
5、启动监听
[oracle@target ~]$ lsnrctl start
LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 10-MAY-2016 16:48:35
Copyright (c) 1991, 2011, Oracle. All rights reserved.
Starting /u01/11g/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 11.2.0.3.0 - Production
System parameter file is /u01/11g/network/admin/listener.ora
Log messages written to /u01/oracle/diag/tnslsnr/target/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=target)(PORT=10001)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=target)(PORT=10001)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.3.0 - Production
Start Date 10-MAY-2016 16:48:36
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/11g/network/admin/listener.ora
Listener Log File /u01/oracle/diag/tnslsnr/target/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=target)(PORT=10001)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Services Summary...
Service "pu" has 1 instance(s).
Instance "pu", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
6、查看系统状态
[oracle@target ~]$ netstat -ano|grep 10001
tcp 0 0 192.168.6.152:26082 192.168.6.152:10001 ESTABLISHED off (0.00/0/0)
tcp 0 0 :::10001 :::* LISTEN off (0.00/0/0)
tcp 0 0 ::ffff:192.168.6.152:10001 ::ffff:192.168.6.152:26082 ESTABLISHED keepalive (7193.37/0/0)
已经开启10001端口号
7、验证登陆
[oracle@target ~]$ sqlplus / as sysdba@target:10001:pu
SQL*Plus: Release 11.2.0.3.0 Production on Tue May 10 16:50:50 2016
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Oracle Label Security, OLAP, Data Mining,
Oracle Database Vault and Real Application Testing options
SQL>
相关文章推荐
- oracle connect by用法
- oracle笔记
- oracle 11g如何完全卸载_百度经验
- oracle connect by用法
- Oracle中分页查询
- 【Oracle】基于SCN的增量备份修复DataGuard GAP
- Oracle服务器上Swap的配置
- oracle创建表并添加主键,设置主键自增长
- oracle 11g导出表和索引的定义
- Oracle UNDO表空间的管理
- oracle 查询测试样题
- oracle11g下alert文件位置
- Linux下oracle异机定期数据泵逻辑导出
- oracle的索引有几种?各有何用途?
- oracle 11g 查看删除(DROP)的表以及恢复删除的表
- Oracle数据库中设置表字段为自动序列
- Oracle的dbms_output包的put()和put_line()的区别只是有没有回车换行吗?(转)
- Oracle中四种循环(GOTO、For、While、Loop)
- ORACLE常用数据库类型(转)
- Reporting Service中配置oracle 数据连接