今天做實驗為了好識別機器隨手用 hostname source 命令更改了linux主機名稱然後啟動資料庫報如下錯誤:
[oracle@source dbs]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.2.0 Production on Sat Aug 24 20:11:43 2013
Copyright (c) 1982, 2010, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup
ORA-00119: invalid specification for system parameter LOCAL_LISTENER
ORA-00130: invalid listener address '(ADDRESS=(PROTOCOL=TCP)(HOST=source)(PORT=1521))'
看到此錯誤果斷產生pfile檔案,準備剔除LOCAL_LISTENER參數,然後啟動資料庫。待開啟pfile檔案發現裡面根本就沒有LOCAL_LISTERER參數的定義。這就奇怪了。
參數檔案如下所示:
[oracle@source dbs]$ vi initCRM.ora
CRM.__pga_aggregate_target=503316480
CRM.__db_cache_size=268435456
CRM.__java_pool_size=16777216
CRM.__large_pool_size=16777216
CRM.__oracle_base='/oracle/app'#ORACLE_BASE set from environment
CRM.__pga_aggregate_target=503316480
CRM.__sga_target=754974720
CRM.__shared_io_pool_size=0
CRM.__shared_pool_size=402653184
CRM.__streams_pool_size=33554432
*.audit_file_dest='/oracle/app/admin/CRM/adump'
*.audit_trail='db'
*.compatible='11.2.0.0.0'
*.control_files='/oracle/CRM2/control01.ctl','/oracle/CRM2/control02.ctl'#Restore Controlfile
*.db_block_size=8192
*.db_cache_size=218103808
*.db_domain=''
*.db_name='CRM'
*.diagnostic_dest='/oracle/app'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=CRMXDB)'
*.log_archive_dest_1='LOCATION=/oracle/archive'
*.log_archive_dest_2=''
*.log_archive_format='%t_%s_%r.dbf'
*.memory_target=1258291200
*.open_cursors=300
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.undo_retention=1200
*.undo_tablespace='UNDOTBS3'
然後不死心又用pfile參數嘗試啟動一樣報錯
SQL> startup nomount pfile='/oracle/app/db1/dbs/initCRM.ora';
ORA-00119: invalid specification for system parameter LOCAL_LISTENER
ORA-00130: invalid listener address '(ADDRESS=(PROTOCOL=TCP)(HOST=source)(PORT=1521))'
於是仔細想了想,既然更改了主機名稱導致這個錯誤,查看下/etc/hosts/是否有問題,一檢查果然發現是hosts檔案問題
[oracle@source dbs]$ cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 oracle localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6
更改後的hosts檔案如下:
root@oracle ~]# cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 source localhost.localdomain localhost
更改後啟動資料庫正常,如下所示:
[root@oracle ~]# su - oracle
[oracle@source ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.2.0 Production on Sat Aug 24 20:17:45 2013
Copyright (c) 1982, 2010, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup
ORACLE instance started.
Total System Global Area 1252663296 bytes
Fixed Size 2226072 bytes
Variable Size 973080680 bytes
Database Buffers 268435456 bytes
Redo Buffers 8921088 bytes
Database mounted.
Database opened.
本文出自 “myblog” 部落格,請務必保留此出處http://jiujian.blog.51cto.com/444665/1282048