




已阅读5页,还剩14页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
Linux下主机名的修改对oracle监听及EM的影响及恢复一 修改主机名及恢复监听修改主机名分为动态和静态,动态是指不需要重启就能更改,但是重启无法保存,静态的意思需要修改配置文件,重启会被保存1. 动态修改对监听的影响查看当前的hostnamerootlocalhost # hostnamelocalhost.localdomainrootlocalhost # hostname oraclerootlocalhost # su 查看network的hostnamerootoracle # vi /etc/sysconfig/networkNETWORKING=yesNETWORKING_IPV6=noHOSTNAME=localhost.localdomain查看hostsrootoracle # vi /etc/hosts# Do not remove the following line, or various programs# that require network functionality will fail. localhost.localdomain localhost:1 localhost6.localdomain6 localhost6 先去启动一下监听看一下有什么变化 rootoracle # su - oracleoracleoracle $oracleoracle$cd/u01/app/oracle/product/10.2.0/dbhome_1/network/admin/oracleoracle admin$ pwd/u01/app/oracle/product/10.2.0/dbhome_1/network/adminoracleoracle admin$ lslistener.ora samples shrept.lst sqlnet.ora tnsnames.oraoracleoracle admin$ vi listener.ora# listener.ora Network Configuration File: /u01/app/oracle/product/10.2.0/dbhome_1/network/admin/listener.ora# Generated by Oracle configuration tools.SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (SID_NAME = PLSExtProc) (ORACLE_HOME = /u01/app/oracle/product/10.2.0/dbhome_1) (PROGRAM = extproc) ) )LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1) (ADDRESS = (PROTOCOL = TCP)(HOST = localhost.localdomain)(PORT = 1521) ) ) listener.ora 20L, 525C oracleoracle $ lsnrctl startLSNRCTL for Linux: Version .0 - Production on 26-FEB-2011 01:23:16Copyright (c) 1991, 2005, Oracle. All rights reserved.Starting /u01/app/oracle/product/10.2.0/dbhome_1/bin/tnslsnr: please wait.TNSLSNR for Linux: Version .0 - ProductionSystem parameter file is /u01/app/oracle/product/10.2.0/dbhome_1/network/admin/listener.oraLog messages written to /u01/app/oracle/product/10.2.0/dbhome_1/network/log/listener.logListening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521)Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)STATUS of the LISTENER-Alias LISTENERVersion TNSLSNR for Linux: Version .0 - ProductionStart Date 26-FEB-2011 01:23:17Uptime 0 days 0 hr. 0 min. 0 secTrace Level offSecurity ON: Local OS AuthenticationSNMP OFFListener Parameter File /u01/app/oracle/product/10.2.0/dbhome_1/network/admin/listener.oraListener Log File /u01/app/oracle/product/10.2.0/dbhome_1/network/log/listener.logListening Endpoints Summary. (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1) (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521)Services Summary.Service PLSExtProc has 1 instance(s). Instance PLSExtProc, status UNKNOWN, has 1 handler(s) for this service.The command completed successfully监听状态host= 变成了ip,hostname没有改变前启动监听Host= localhost.localdomain现在启动一下EM,看看可以不可以启动oracleoracle admin$ emctl start dbconsoleTZ set to US/PacificException in getting local .UnknownHostException: oracle: oracleat .InetAddress.getLocalHost(InetAddress.java:1191)at oracle.sysman.emSDK.conf.TargetInstaller.getLocalHost(TargetInstaller.java:4977)at oracle.sysman.emSDK.conf.TargetInstaller.main(TargetInstaller.java:3758)Exception in getting local .UnknownHostException: oracle: oracleat .InetAddress.getLocalHost(InetAddress.java:1191)at oracle.sysman.emSDK.conf.TargetInstaller.getLocalHost(TargetInstaller.java:4977)at oracle.sysman.emSDK.conf.TargetInstaller.main(TargetInstaller.java:3758)OC4J Configuration issue. /u01/app/oracle/product/10.2.0/dbhome_1/oc4j/j2ee/OC4J_DBConsole_null_orcl not found.改了hostname EM已经无法启动 重启一下linux看看启动监听和EM看看是什么效果oraclenag_oracle $ su -Password: rootnag_oracle #init 6oraclelocalhost $ lsnrctl startLSNRCTL for Linux: Version .0 - Production on 26-FEB-2011 01:48:03Copyright (c) 1991, 2005, Oracle. All rights reserved.Starting /u01/app/oracle/product/10.2.0/dbhome_1/bin/tnslsnr: please wait.TNSLSNR for Linux: Version .0 - ProductionSystem parameter file is /u01/app/oracle/product/10.2.0/dbhome_1/network/admin/listener.oraLog messages written to /u01/app/oracle/product/10.2.0/dbhome_1/network/log/listener.logListening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost.localdomain)(PORT=1521)Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)STATUS of the LISTENER-Alias LISTENERVersion TNSLSNR for Linux: Version .0 - ProductionStart Date 26-FEB-2011 01:48:06Uptime 0 days 0 hr. 0 min. 0 secTrace Level offSecurity ON: Local OS AuthenticationSNMP OFFListener Parameter File /u01/app/oracle/product/10.2.0/dbhome_1/network/admin/listener.oraListener Log File /u01/app/oracle/product/10.2.0/dbhome_1/network/log/listener.logListening Endpoints Summary. (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1) (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost.localdomain)(PORT=1521)Services Summary.Service PLSExtProc has 1 instance(s). Instance PLSExtProc, status UNKNOWN, has 1 handler(s) for this service.The command completed successfullyoraclelocalhost $ emctl start dbconsoleTZ set to US/PacificOracle Enterprise Manager 10g Database Control Release .0 Copyright (c) 1996, 2005 Oracle Corporation. All rights reserved.http:/localhost.localdomain:1158/em/console/aboutApplicationStarting Oracle Enterprise Manager 10g Database Control . started. -Logs are generated in directory /u01/app/oracle/product/10.2.0/dbhome_1/localhost.localdomain_orcl/sysman/log总结:使用hostname命令改变主机名,监听是可以启动的,EM无法启动,重启就恢复了。2. 静态改变主机名我们要对比一下改network里的hostname和hosts里对应关系有什么影响A.我们先改一下network里的hostnameoraclelocalhost $ vi /etc/sysconfig/networkoraclelocalhost $ vi /etc/sysconfig/networkoraclelocalhost $ su -Password: rootlocalhost # vi /etc/sysconfig/network将hostname改成oracleNETWORKING=yesNETWORKING_IPV6=noHOSTNAME=oracle 需要重启才能改过来oracleoracle $那么我们启动监听oracleoracle $ lsnrctl startLSNRCTL for Linux: Version .0 - Production on 26-FEB-2011 02:05:47Copyright (c) 1991, 2005, Oracle. All rights reserved.Starting /u01/app/oracle/product/10.2.0/dbhome_1/bin/tnslsnr: please wait.TNSLSNR for Linux: Version .0 - ProductionSystem parameter file is /u01/app/oracle/product/10.2.0/dbhome_1/network/admin/listener.oraLog messages written to /u01/app/oracle/product/10.2.0/dbhome_1/network/log/listener.logListening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521)Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)STATUS of the LISTENER-Alias LISTENERVersion TNSLSNR for Linux: Version .0 - ProductionStart Date 26-FEB-2011 02:05:49Uptime 0 days 0 hr. 0 min. 0 secTrace Level offSecurity ON: Local OS AuthenticationSNMP OFFListener Parameter File /u01/app/oracle/product/10.2.0/dbhome_1/network/admin/listener.oraListener Log File /u01/app/oracle/product/10.2.0/dbhome_1/network/log/listener.logListening Endpoints Summary. (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1) (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521)Services Summary.Service PLSExtProc has 1 instance(s). Instance PLSExtProc, status UNKNOWN, has 1 handler(s) for this service.The command completed successfully启动EMoracleoracle $ emctl start dbconsoleTZ set to US/PacificException in getting local .UnknownHostException: oracle: oracleat .InetAddress.getLocalHost(InetAddress.java:1191)at oracle.sysman.emSDK.conf.TargetInstaller.getLocalHost(TargetInstaller.java:4977)at oracle.sysman.emSDK.conf.TargetInstaller.main(TargetInstaller.java:3758)Exception in getting local .UnknownHostException: oracle: oracleat .InetAddress.getLocalHost(InetAddress.java:1191)at oracle.sysman.emSDK.conf.TargetInstaller.getLocalHost(TargetInstaller.java:4977)at oracle.sysman.emSDK.conf.TargetInstaller.main(TargetInstaller.java:3758)OC4J Configuration issue. /u01/app/oracle/product/10.2.0/dbhome_1/oc4j/j2ee/OC4J_DBConsole_null_orcl not found.总结:监听可以启动,EM无法启动,那么我们这里监听的状态又使用的是,而不是orale那,我们先改一下listener.ora看看oracleoracle$vi/u01/app/oracle/product/10.2.0/dbhome_1/network/admin/listener.ora# listener.ora Network Configuration File: /u01/app/oracle/product/10.2.0/dbhome_1/network/admin/listener.ora# Generated by Oracle configuration tools.SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (SID_NAME = PLSExtProc) (ORACLE_HOME = /u01/app/oracle/product/10.2.0/dbhome_1) (PROGRAM = extproc) ) )LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1) (ADDRESS = (PROTOCOL = TCP)(HOST = localhost.localdomain)(PORT = 1521) ) ) cle/product/10.2.0/dbhome_1/network/admin/listener.ora 20L, 525C 1,1 All把HOST = localhost.localdomain 改成HOST = oracle重启监听oracleoracle $ lsnrctl stopLSNRCTL for Linux: Version .0 - Production on 26-FEB-2011 02:12:05Copyright (c) 1991, 2005, Oracle. All rights reserved.Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)The command completed successfullyoracleoracle $ lsnrctl startLSNRCTL for Linux: Version .0 - Production on 26-FEB-2011 02:12:29Copyright (c) 1991, 2005, Oracle. All rights reserved.Starting /u01/app/oracle/product/10.2.0/dbhome_1/bin/tnslsnr: please wait.TNSLSNR for Linux: Version .0 - ProductionSystem parameter file is /u01/app/oracle/product/10.2.0/dbhome_1/network/admin/listener.oraLog messages written to /u01/app/oracle/product/10.2.0/dbhome_1/network/log/listener.logListening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)Error listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=oracle)(PORT=1521)TNS-12545: Connect failed because target host or object does not exist TNS-12560: TNS:protocol adapter error TNS-00515: Connect failed because target host or object does not exist Linux Error: 11: Resource temporarily unavailableListener failed to start. See the error message(s) above.启动失败B.我们下面只更改hosts文件不更改network看看是什么情况 oraclelocalhost $ vi /etc/hosts# Do not remove the following line, or various programs# that require network functionality will fail. localhost.localdomain localhost:1 localhost6.localdomain6 localhost6 这里值得注意的是hosts文件配置是分三部分 ip 主机名 别名那么主机名和别名有什么区别?我们做个试验将主机名改成123 别名改成456 看看有什么效果?包括监听及EMoraclelocalhost $ su -Password: rootlocalhost # Do not remove the following line, or various programs# that require network functionality will fail. 123 456:1 localhost6.localdomain6 localhost6重启后oraclelocalhost $oraclelocalhost $ lsnrctl startLSNRCTL for Linux: Version .0 - Production on 26-FEB-2011 02:26:35Copyright (c) 1991, 2005, Oracle. All rights reserved.Starting /u01/app/oracle/product/10.2.0/dbhome_1/bin/tnslsnr: please wait.TNSLSNR for Linux: Version .0 - ProductionSystem parameter file is /u01/app/oracle/product/10.2.0/dbhome_1/network/admin/listener.oraLog messages written to /u01/app/oracle/product/10.2.0/dbhome_1/network/log/listener.logListening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)Error listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost.localdomain)(PORT=1521)TNS-12545: Connect failed because target host or object does not exist TNS-12560: TNS:protocol adapter error TNS-00515: Connect failed because target host or object does not exist Linux Error: 11: Resource temporarily unavailableListener failed to start. See the error message(s) above.监听启动失败了,那么我们改一下listener试试,先改成456试试# listener.ora Network Configuration File: /u01/app/oracle/product/10.2.0/dbhome_1/network/admin/listener.ora# Generated by Oracle configuration tools.SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (SID_NAME = PLSExtProc) (ORACLE_HOME = /u01/app/oracle/product/10.2.0/dbhome_1) (PROGRAM = extproc) ) )LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1) (ADDRESS = (PROTOCOL = TCP)(HOST = 456)(PORT = 1521) ) ) oraclelocalhost $ lsnrctl startLSNRCTL for Linux: Version .0 - Production on 26-FEB-2011 02:29:46Copyright (c) 1991, 2005, Oracle. All rights reserved.Starting /u01/app/oracle/product/10.2.0/dbhome_1/bin/tnslsnr: please wait.TNS-12537: TNS:connection closed TNS-12560: TNS:protocol adapter error TNS-00507: Connection closed Linux Error: 29: Illegal seek监听启动失败,那么改成123那oraclelocalhost $ lsnrctl startLSNRCTL for Linux: Version .0 - Production on 26-FEB-2011 02:30:58Copyright (c) 1991, 2005, Oracle. All rights reserved.Starting /u01/app/oracle/product/10.2.0/dbhome_1/bin/tnslsnr: please wait.TNS-12537: TNS:connection closed TNS-12560: TNS:protocol adapter error TNS-00507: Connection closed Linux Error: 29: Illegal seek 总结:说明只改hosts文件也是不行的,监听起不来,那么我们把network里的hostname也改一下,改成123试试oracle123 $ lsnrctl startLSNRCTL for Linux: Version .0 - Production on 26-FEB-2011 02:40:22Copyright (c) 1991, 2005, Oracle. All rights reserved.Starting /u01/app/oracle/product/10.2.0/dbhome_1/bin/tnslsnr: please wait.TNS-12537: TNS:connection closed TNS-12560: TNS:protocol adapter error TNS-00507: Connection closed Linux Error: 29: Illegal seek现在是listener和hosts和network都是123还是无法启动监听把hosts里的456改成localhost试试# Do not remove the following line, or various programs# that require network functionality will fail. 123 localhost:1 localhost6.localdomain6 localhost6oracle123 $ lsnrctl startLSNRCTL for Linux: Version .0 - Production on 26-FEB-2011 02:44:06Copyright (c) 1991, 2005, Oracle. All rights reserved.Starting /u01/app/oracle/product/10.2.0/dbhome_1/bin/tnslsnr: please wait.TNSLSNR for Linux: Version .0 - ProductionSystem parameter file is /u01/app/oracle/product/10.2.0/dbhome_1/network/admin/listener.oraLog messages written to /u01/app/oracle/product/10.2.0/dbhome_1/network/log/listener.logListening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=23)(PORT=1521)Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)STATUS of the LISTENER-Alias LISTENERVersion TNSLSNR for Linux: Version .0 - ProductionStart Date 26-FEB-2011 02:44:07Uptime 0 days 0 hr. 0 min. 0 secTrace Level offSecurity ON: Local OS AuthenticationSNMP OFFListener Parameter File /u01/app/oracle/product/10.2.0/dbhome_1/network/admin/listener.oraListener Log File /u01/app/oracle/product/10.2.0/dbhome_1/network/log/listener.logListening Endpoints Summary. (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1) (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=23)(PORT=1521)Services Summary.Service PLSExtProc has 1 instance(s). Instance PLSExtProc, status UNKNOWN, has 1 handler(s) for this service.The command completed successfully监听启动成功,EM无法启动提示找不到对应的文件,那么我们就知道hosts里的别名就需要用localhost。先我们把hosts和network的hostname都改成nag_oracle,listener.ora也改成nag_oracle看一下状态准备解决EM启动不了的问题oraclenag_oracle $ lsnrctl startLSNRCTL for Linux: Version .0 - Production on 26-FEB-2011 02:56:23Copyright (c) 1991, 2005, Oracle. All rights reserved.Starting /u01/app/oracle/product/10.2.0/dbhome_1/bin/tnslsnr: please wait.TNSLSNR for Linux: Version .0 - ProductionSystem parameter file is /u01/app/oracle/product/10.2.0/dbhome_1/network/admin/listener.oraLog messages written to /u01/app/oracle/product/10.2.0/dbhome_1/network/log/listener.logListening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=nag_oracle)(PORT=1521)Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)STATUS of the LISTENER-Alias LISTENERVersion TNSLSNR for Linux: Version 10.2.0
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 高效开发流程2025年考试试题及答案
- 现代社会中的编程语言选择与应用试题及答案
- 吉林省长春市第二实验学校2025年数学八下期末达标检测模拟试题含解析
- 社会实践活动在幼儿园的开展计划
- 教学资源共享与借用策略计划
- 湖北省黄冈市麻城市思源实验学校2025届八下数学期末综合测试模拟试题含解析
- 2024年宁夏开放大学辅导员考试真题
- 2025届福建省南安市柳城义务教育小片区八年级数学第二学期期末质量跟踪监视试题含解析
- 2024年黑龙江省体育局下属事业单位真题
- 黑龙江省七台河市名校2025届八下数学期末教学质量检测模拟试题含解析
- 病假医疗期申请单(新修订)
- 95598工单大数据分析及压降策略
- 《游园不值》-完整版课件
- 钻孔桩钻孔记录表(旋挖钻)
- 660MW机组金属监督项目
- 大连银行招聘考试最新笔试复习材料题目内容试卷真题复习
- 卷烟纸生产工艺
- JBK-698CX淬火机数控系统
- 肩关节镜下肩袖修补术的护理查房ppt
- 回旋镖运动轨迹的模拟
- 《康复医学》PPT课件(PPT 105页)
评论
0/150
提交评论