本文共 2703 字,大约阅读时间需要 9 分钟。
今天做实验为了好识别机器随手用 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_LISTENERORA-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=503316480CRM.__db_cache_size=268435456CRM.__java_pool_size=16777216CRM.__large_pool_size=16777216CRM.__oracle_base='/oracle/app'#ORACLE_BASE set from environmentCRM.__pga_aggregate_target=503316480CRM.__sga_target=754974720CRM.__shared_io_pool_size=0CRM.__shared_pool_size=402653184CRM.__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_LISTENERORA-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文件如下:
~]# 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> startupORACLE instance started.
Total System Global Area 1252663296 bytesFixed Size 2226072 bytesVariable Size 973080680 bytesDatabase Buffers 268435456 bytesRedo Buffers 8921088 bytesDatabase mounted.Database opened.
转载地址:http://jkema.baihongyu.com/