【故障處理】修改主機名導致oracle例項無法啟動暨如何修改hostname

secooler發表於2009-01-12
作業系統是32位的Linux 5.1:
# cat /etc/redhat-release
# Red Hat Enterprise Linux Server release 5.1 (Tikanga)

資料庫版本是10.2.0.3.0:

SQL> select * from v$version;

BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Prod
PL/SQL Release 10.2.0.3.0 - Production
CORE    10.2.0.3.0      Production
TNS for Linux: Version 10.2.0.3.0 - Production
NLSRTL Version 10.2.0.3.0 - Production

network檔案內容如下:
$ cat /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=localhost.localdomain

hosts檔案內容如下:
$ cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1               localhost.localdomain localhost
::1             localhost6.localdomain6 localhost6

在沒有修改主機名的情況下一切正常,因為想要規範linux伺服器的名字,欲修改Linux的hostname,但是修改後資料庫無法啟動,有此經驗的朋友請指點,感謝ing
修改主機名我嘗試了兩種:
第一種.直接修改名字,不重啟機器
# hostname oratest
第二種.修改network檔案,重新啟動機器
$ cat /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=oratest

修改主機名之後問題現象如下:
[oracle@oratest ~]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.3.0 - Production on Mon Jan 12 05:05:45 2009

Copyright (c) 1982, 2006, Oracle.  All Rights Reserved.

Connected to an idle instance.

SQL> startup;
ORA-00600: internal error code, arguments: [keltnfy-ldmInit], [46], [1], [], [], [], [], []


[oracle@oratest ~]$ emctl start dbconsole
TZ set to PRC
Exception in getting local host
java.net.UnknownHostException: oratest: oratest
        at java.net.InetAddress.getLocalHost(InetAddress.java:1191)
        at oracle.sysman.emSDK.conf.TargetInstaller.getLocalHost(TargetInstaller.java:5488)
        at oracle.sysman.emSDK.conf.TargetInstaller.main(TargetInstaller.java:4102)
Exception in getting local host
java.net.UnknownHostException: oratest: oratest
        at java.net.InetAddress.getLocalHost(InetAddress.java:1191)
        at oracle.sysman.emSDK.conf.TargetInstaller.getLocalHost(TargetInstaller.java:5488)
        at oracle.sysman.emSDK.conf.TargetInstaller.main(TargetInstaller.java:4102)
OC4J Configuration issue. /oracle/u01/app/oracle/product/10.2.0/db_1/oc4j/j2ee/OC4J_DBConsole_null_ora10g not found.

請問,如果在建立資料庫之後需要修改主機名字,該如何操作,感覺這是一個比較常見的問題,但是苦於迷陷其中,不得其法。

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/519536/viewspace-555646/,如需轉載,請註明出處,否則將追究法律責任。

相關文章