Linux下主機名的修改對oracle監(jiān)聽及EM的影響及恢復.doc_第1頁
Linux下主機名的修改對oracle監(jiān)聽及EM的影響及恢復.doc_第2頁
Linux下主機名的修改對oracle監(jiān)聽及EM的影響及恢復.doc_第3頁
Linux下主機名的修改對oracle監(jiān)聽及EM的影響及恢復.doc_第4頁
Linux下主機名的修改對oracle監(jiān)聽及EM的影響及恢復.doc_第5頁
已閱讀5頁,還剩14頁未讀 繼續(xù)免費閱讀

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領

文檔簡介

Linux下主機名的修改對oracle監(jiān)聽及EM的影響及恢復一 修改主機名及恢復監(jiān)聽修改主機名分為動態(tài)和靜態(tài),動態(tài)是指不需要重啟就能更改,但是重啟無法保存,靜態(tài)的意思需要修改配置文件,重啟會被保存1. 動態(tài)修改對監(jiān)聽的影響查看當前的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 先去啟動一下監(jiān)聽看一下有什么變化 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監(jiān)聽狀態(tài)host= 變成了ip,hostname沒有改變前啟動監(jiān)聽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看看啟動監(jiān)聽和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命令改變主機名,監(jiān)聽是可以啟動的,EM無法啟動,重啟就恢復了。2. 靜態(tài)改變主機名我們要對比一下改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 $那么我們啟動監(jiān)聽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.總結:監(jiān)聽可以啟動,EM無法啟動,那么我們這里監(jiān)聽的狀態(tài)又使用的是,而不是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重啟監(jiān)聽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 主機名 別名那么主機名和別名有什么區(qū)別?我們做個試驗將主機名改成123 別名改成456 看看有什么效果?包括監(jiān)聽及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.監(jiān)聽啟動失敗了,那么我們改一下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監(jiān)聽啟動失敗,那么改成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文件也是不行的,監(jiān)聽起不來,那么我們把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還是無法啟動監(jiān)聽把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監(jiān)聽啟動成功,EM無法啟動提示找不到對應的文件,那么我們就知道hosts里的別名就需要用localhost。先我們把hosts和network的hostname都改成nag_oracle,listener.ora也改成nag_oracle看一下狀態(tài)準備解決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. 未經權益所有人同意不得將文件中的內容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網僅提供信息存儲空間,僅對用戶上傳內容的表現方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
  • 6. 下載文件中如有侵權或不適當內容,請與我們聯系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論