oracle 11g 修改默认监听端口1521

一、oracle 11g 修改默认监听端口1521

Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

 

 

1、查看监听状态: 

 

SQL> !lsnrctl status

 

LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 12-NOV-2013 01:36:29

 

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

 

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=b28-122.jd.com)(PORT=1521)))

STATUS of the LISTENER

------------------------

Alias LISTENER

Version TNSLSNR for Linux: Version 11.2.0.3.0 - Production

Start Date 22-OCT-2013 04:02:12

Uptime 20 days 22 hr. 34 min. 16 sec

Trace Level off

Security ON: Local OS Authentication

SNMP OFF

Listener Parameter File /u01/oracle/product/11.2.0/db_1/network/admin/listener.ora

Listener Log File /u01/oracle/diag/tnslsnr/b28-122/listener/alert/log.xml

Listening Endpoints Summary...

(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=b28-122.jd.com)(PORT=1521)))

(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))

Services Summary...

Service "yoon" has 1 instance(s).

Instance "yoon", status READY, has 1 handler(s) for this service...

Service "yoonXDB" has 1 instance(s).

Instance "yoon", status READY, has 1 handler(s) for this service...

The command completed successfully

 

 

2、停止监听 

 

SQL> !lsnrctl stop

 

LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 12-NOV-2013 02:37:43

 

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

 

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=b28-122.jd.com)(PORT=1521)))

The command completed successfully

 

 

3、修改tnsnames.oralistener.ora文件中端口号 

 

将1521修改为1515

 

 

4、在数据库中初始化参数local_listener

 

SQL> show parameter local_listener;

 

NAME TYPE VALUE

------------------------------------ --------------------------------- ------------------------------

local_listener string

 

 

SQL> alter system set local_listener='(ADDRESS = (PROTOCOL = TCP)(HOST = b28-122.jd.com)(PORT = 1515))';

 

System altered.

 

 

SQL> show parameter local_listener;

 

NAME TYPE VALUE

------------------------------------ --------------------------------- ------------------------------

local_listener string (ADDRESS = (PROTOCOL = TCP)(HO

ST = b28-122.jd.com)(PORT = 15

15))

 

 

5、启动监听 

 

SQL> !lsnrctl start

 

 

6、查看监听 

 

SQL> !lsnrctl status

 

LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 12-NOV-2013 02:43:08

 

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

 

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=b28-122.jd.com)(PORT=1515)))

STATUS of the LISTENER

------------------------

Alias LISTENER

Version TNSLSNR for Linux: Version 11.2.0.3.0 - Production

Start Date 12-NOV-2013 02:42:15

Uptime 0 days 0 hr. 0 min. 53 sec

Trace Level off

Security ON: Local OS Authentication

SNMP OFF

Listener Parameter File /u01/oracle/product/11.2.0/db_1/network/admin/listener.ora

Listener Log File /u01/oracle/diag/tnslsnr/b28-122/listener/alert/log.xml

Listening Endpoints Summary...

(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=b28-122.jd.com)(PORT=1515)))

(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1515)))

Services Summary...

Service "yoon" has 1 instance(s).

Instance "yoon", status READY, has 1 handler(s) for this service...

Service "yoonXDB" has 1 instance(s).

Instance "yoon", status READY, has 1 handler(s) for this service...

The command completed successfully

 

 

 

二、换IP后的oracle 11g修改方法

这是手动修改方式 若有问题以后再修正,当然还有最经典的修改方式:emca -reconfig dbconctrol db -repos recreate


=================================================================================================经典修改方法

OracleDBConsoleorcl 服务因下列错误而停止
系统找不到指定的路径 


原因主要还是更改了主机名或换了IP导致的问题,更改了相应的文件名: 


D:/oracle/product/10.2.0/db_1/oc4j/j2ee/OC4J_DBConsole_192.168.0.136_dgtest(更换新IP或机器名) //dgtestoracle_sid 

D:/oracle/product/10.2.0/db_1/asdfjkl_dgtest(更换新IP或机器名)//dgtestoracle_sid 

在目錄d:/oracle/product/10.2.0/db_1/install/portlist.ini裡找到EM是使用哪個port 


Microsoft Windows XP [版本 5.1.2600] 
(C) 版权所有 1985-2001 Microsoft Corp. 
C:/Documents and Settings/youandy>set oracle_sid=dgtest 
C:/Documents and Settings/youandy>emca -repos recreate 

EMCA 开始于 2008-3-25 8:17:19 
EM Configuration Assistant 10.2.0.1.0 正式版 
版权所有 (c) 2003, 2005, Oracle。保留所有权利。 

输入以下信息
数据库 SID: dgtest 
监听程序端口号: 1521 
SYS 用户的口令
SYSMAN 用户的口令
SYSMAN 用户的口令
是否继续? [yes(Y)/no(N)]: y 
2008-3-25 8:17:48 oracle.sysman.emcp.EMConfig perform 
信息: 正在将此操作记录到 D:/oracle/product/10.2.0/db_1/cfgtoollogs/emca/dgtest/e 
mca_2008-03-25_08-17-19-上午.log 
2008-3-25 8:17:49 oracle.sysman.emcp.EMReposConfig dropRepository 
信息: 正在删除 EM 资料档案库 (此操作可能需要一段时间)... 
2008-3-25 8:19:37 oracle.sysman.emcp.EMReposConfig invoke 
信息: 已成功删除资料档案库 
2008-3-25 8:19:37 oracle.sysman.emcp.EMReposConfig createRepository 
信息: 正在创建 EM 资料档案库 (此操作可能需要一段时间)... 
2008-3-25 8:23:04 oracle.sysman.emcp.EMReposConfig invoke 
信息: 已成功创建资料档案库 
已成功完成 Enterprise Manager 的配置 
EMCA 结束于 2008-3-25 8:23:04 

C:/Documents and Settings/youandy>emctl start dbconsole 
Environment variable ORACLE_SID not defined. Please define it. 

C:/Documents and Settings/youandy>set oracle_sid=dgtest 

C:/Documents and Settings/youandy>emctl start dbconsole 
Oracle Enterprise Manager 10g Database Control Release 10.2.0.1.0 
Copyright (c) 1996, 2005 Oracle Corporation. 
All rights reserved. 
http://192.168.0.136:1158/em/console/aboutApplication 
Starting Oracle Enterprise Manager 10g Database Control ...OracleDBConsoledgtest 

服务正在启动 . 
OracleDBConsoledgtest 服务无法启动。 

系统出错。 

发生系统错误 3 

系统找不到指定的路径。 


C:/Documents and Settings/youandy> 
C:/Documents and Settings/youandy>emca -config dbcontrol db 

EMCA 开始于 2008-3-25 8:37:02 
EM Configuration Assistant 10.2.0.1.0 正式版 
版权所有 (c) 2003, 2005, Oracle。保留所有权利。 

输入以下信息
数据库 SID: dgtest 
已为数据库 dgtest 配置了 Database Control 
您已选择配置 Database Control, 以便管理数据库 dgtest 
此操作将移去现有配置和默认设置, 并重新执行配置 
是否继续? [yes(Y)/no(N)]: y 
监听程序端口号: 1521 
SYS 用户的口令
DBSNMP 用户的口令
SYSMAN 用户的口令
用户名/口令无效。 
SYSMAN 用户的口令
SYSMAN 用户的口令: 通知的电子邮件地址 (可选): 
通知的发件 (SMTP) 服务器 (可选): 
----------------------------------------------------------------- 

已指定以下设置 

数据库 ORACLE_HOME ................ D:/oracle/product/10.2.0/db_1 

数据库主机名 ................ asdfjkl 
监听程序端口号 ................ 1521 
数据库 SID ................ dgtest 
通知的电子邮件地址 ............... 
通知的发件 (SMTP) 服务器 ............... 

----------------------------------------------------------------- 
是否继续? [yes(Y)/no(N)]:
2008-3-25 8:38:11 oracle.sysman.emcp.EMConfig perform 
信息: 正在将此操作记录到 D:/oracle/product/10.2.0/db_1/cfgtoollogs/emca/dgtest/e 
mca_2008-03-25_08-37-02-上午.log 
2008-3-25 8:38:14 oracle.sysman.emcp.util.PortManager isPortInUse 
警告: 指定的端口 5540 已在使用。 
2008-3-25 8:38:14 oracle.sysman.emcp.util.PortManager isPortInUse 
警告: 指定的端口 5520 已在使用。 
2008-3-25 8:38:14 oracle.sysman.emcp.util.PortManager isPortInUse 
警告: 指定的端口 1158 已在使用。 
2008-3-25 8:38:14 oracle.sysman.emcp.util.DBControlUtil stopOMS 
信息: 正在停止 Database Control (此操作可能需要一段时间)... 
2008-3-25 8:38:26 oracle.sysman.emcp.util.DBControlUtil startOMS 
信息: 正在启动 Database Control (此操作可能需要一段时间)... 
2008-3-25 8:39:06 oracle.sysman.emcp.EMDBPostConfig performConfiguration 
信息: 已成功启动 Database Control 
2008-3-25 8:39:10 oracle.sysman.emcp.EMDBPostConfig performConfiguration 
警告: 无法创建 Database Control 快捷方式 
2008-3-25 8:39:10 oracle.sysman.emcp.EMDBPostConfig performConfiguration 
信息: >>>>>>>>>>> Database Control URL  http://asdfjkl:1158/em <<<<<<<<<<< 
已成功完成 Enterprise Manager 的配置 
EMCA 结束于 2008-3-25 8:39:10

 

 

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值