Oracle資料庫啟動之最噁心的報錯檢查--ORA-00119、ORA-00130

流浪的野狼發表於2015-05-15
今天一同事告知,新clone的資料庫無法正常啟動,登陸啟動之後報錯如下:

[oracle@PlanDB01Dev ~]$ sqlplus / as sysdba


SQL*Plus: Release 11.2.0.3.0 Production on Fri May 15 15:17:38 2015


Copyright (c) 1982, 2011, Oracle.  All rights reserved.


Connected.
SQL> startup
ORA-00119: invalid specification for system parameter LOCAL_LISTENER
ORA-00130: invalid listener address '(ADDRESS=(PROTOCOL=TCP)(HOST=PlanDB01Dev)(PORT=1521))'
SQL> alter system reset local_listener;
alter system reset local_listener
*
ERROR at line 1:
ORA-01034: ORACLE not available
Process ID: 0
Session ID: 0 Serial number: 0




SQL> conn / as sysdba
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=PlanDB01Dev)(PORT=1521))'
SQL> exit
Disconnected
首先想到可能是引數檔案設定問題,或者監聽器:
檢視引數檔案:
*.audit_trail='db'
*.compatible='11.2.0.0.0'
*.control_files='/u01/app/oracle/oradata/orcl/control01.ctl','/u01/app/oracle/fast_recovery_area/orcl/control02.ctl'
*.db_block_size=8192
*.db_domain=''
*.db_name='orcl'
*.db_recovery_file_dest='/u01/app/oracle/fast_recovery_area'
*.db_recovery_file_dest_size=8589934592
*.diagnostic_dest='/u01/app/oracle'
*.log_archive_dest_1='LOCATION=/home/oracle/archivelog'
*.log_archive_format='%t_%s_%r.dbf'
*.open_cursors=300
*.pga_aggregate_target=1681915904
*.processes=1000
*.remote_login_passwordfile='EXCLUSIVE'
*.sga_target=5047844864
*.undo_tablespace='UNDOTBS1'
可以看到一切正常。
再次嘗試用引數檔案啟動:
oracle@PlanDB01Dev dbs]$ sqlplus / as sysdba


SQL*Plus: Release 11.2.0.3.0 Production on Fri May 15 14:57:45 2015


Copyright (c) 1982, 2011, Oracle.  All rights reserved.


Connected.
SQL> startup pfile='/u01/app/oracle/product/11.2.0/dbhome_1/dbs/initorcl.ora' nomount;
ORA-00119: invalid specification for system parameter LOCAL_LISTENER
ORA-00130: invalid listener address '(ADDRESS=(PROTOCOL=TCP)(HOST=PlanDB01Dev)(PORT=1521))'
SQL> exit
Disconnected
錯誤依舊存在。
檢查監聽器:

[oracle@PlanDB01Dev dbs]$ lsnrctl status


LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 15-MAY-2015 14:56:24


Copyright (c) 1991, 2011, Oracle.  All rights reserved.


Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=PlanDB01UAT)(PORT=1521)))
TNS-12541: TNS:no listener
 TNS-12560: TNS:protocol adapter error
  TNS-00511: No listener
   Linux Error: 111: Connection refused
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
TNS-12541: TNS:no listener
 TNS-12560: TNS:protocol adapter error
  TNS-00511: No listener
   Linux Error: 111: Connection refused

[oracle@PlanDB01Dev dbs]$ lsnrctl start


LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 15-MAY-2015 15:09:20


Copyright (c) 1991, 2011, Oracle.  All rights reserved.


Starting /u01/app/oracle/product/11.2.0/dbhome_1/bin/tnslsnr: please wait...


TNSLSNR for Linux: Version 11.2.0.3.0 - Production
System parameter file is /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Log messages written to /u01/app/oracle/diag/tnslsnr/PlanDB01Dev/listener/alert/log.xml
TNS-12533: TNS:illegal ADDRESS parameters
 TNS-12560: TNS:protocol adapter error
  TNS-00503: Illegal ADDRESS parameters

上述結論中提示地址問題,
檢視監聽檔案:
[oracle@PlanDB01Dev admin]$ cat listener.ora 
# listener.ora Network Configuration File: /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
# Generated by Oracle configuration tools.
LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)主機資訊不存在(PORT = 1521))
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
  )


ADR_BASE_LISTENER = /u01/app/oracle

發現這裡缺少了主機資訊,懷疑與主機名和主機ip有關:檢查主機地址配置相關的檔案
[root@PlanDB01Dev etc]# hostname
PlanDB01Dev
[root@PlanDB01Dev etc]# cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 PlanDB01UAT localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6
10.72.1.188 PlanDB01UAT
[root@PlanDB01Dev etc]# cat /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=yes
HOSTNAME=PlanDB01Dev
GATEWAY=10.71.1.1

終於找到問題原因了,127.0.0.1 PlanDB01UAT localhost.localdomain localhost  中的主機名設定與實際主機名不符,實際主機名為:
HOSTNAME=PlanDB01Dev 修改好後再次啟動資料庫:

[root@PlanDB01Dev etc]# vi /etc/hosts
[root@PlanDB01Dev etc]# su - oracle
[oracle@PlanDB01Dev ~]$ sqlplus / as sysdba


SQL*Plus: Release 11.2.0.3.0 Production on Fri May 15 15:21:21 2015


Copyright (c) 1982, 2011, Oracle.  All rights reserved.


Connected to an idle instance.


SQL> startup
ORACLE instance started.


Total System Global Area 5027385344 bytes
Fixed Size    2237008 bytes
Variable Size 2701135280 bytes
Database Buffers 2315255808 bytes
Redo Buffers    8757248 bytes
Database mounted.
Database opened.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options


資料庫正常啟動,啟動後需要重建監聽器,或者進行修改。否則service無法註冊監聽,至此問題全部解決。

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

相關文章