ORA-00130: invalid listener address ‘(ADDRESS=(PROTOCOL=TCP)(HOST=bogon)(PORT=1521))‘

bogon是centos安装时自动配置的主机名hostname,配置文件中没有这个主机名:


[root@127 ~]# cat /etc/hosts
10.0.2.100 127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

oracle启动时却使用了bogon这个主机名,导致启动失败:

# su - oracle

$ sqlplus / as sysdba

...

> startup

ORA-00119: invalid specification for system parameter LOCAL_LISTENER
ORA-00130: invalid listener address '(ADDRESS=(PROTOCOL=TCP)(HOST=bogon)(PORT=1521))'

一般情况下,我们配置oracle监听的IP地址需要修改listener.ora和tnsnames.ora的(HOST=127.0.0.1)这项。当前这项配置是本机IP地址10.0.2.100,不是主机名bogon

ORA-00130: invalid listener address ‘(ADDRESS=(PROTOCOL=TCP)(HOST=bogon)(PORT=1521))‘_第1张图片

是因为listener.ora和tnsnames.ora没有生效吗?

export ORACLE_BASE=/data/oracle
export ORACLE_HOME=$ORACLE_BASE/product

# tnsnames.ora Network Configuration File: /data/oracle/product/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.

ORCL =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 10.0.2.100)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcl)
    )
  )




# listener.ora Network Configuration File: /data/oracle/product/network/admin/listener.ora
# Generated by Oracle configuration tools.

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 10.0.2.100)(PORT = 1521))
    )
  )
SID_LIST_LISTENER =
(SID_LIST =
  (SID_DESC =
  (GLOBAL_DBNAME = orcl)
  (SID_NAME = orcl)
  )
)

ADR_BASE_LISTENER = /data/oracle

反复阅读下文所述类似问题的处理过程:

ORA-00119 ORA-00130 bogon_ITPUB博客描述新安装的系统,在装完11.2.0.1.0数据库后。关机再重启,数据库进不去。报如下错误。ORA-00119: invalid specification for system parameter LOCAL_LISTENERORA-00130: invalid listener address '(...ITPUB博客每天千篇余篇博文新资讯,40多万活跃博主,为IT技术人提供全面的IT资讯和交流互动的IT博客平台-中国专业的IT技术ITPUB博客。icon-default.png?t=N7T8https://blog.itpub.net/11780477/viewspace-715318/终于发现了突破口:LOCAL_LISTENER的设置。

LOCAL_LISTENER 与 listener.ora中的LISTENER = (...)不同,是两个不相关参数。

下面这篇文章可以看出,LOCAL_LISTENER可以等于LISTENER,也可以单独设置:

https://www.cnblogs.com/princessd8251/p/3330934.htmlicon-default.png?t=N7T8https://www.cnblogs.com/princessd8251/p/3330934.html

想让pmon动态注册listener,需要设置local_listener参数

1、可以设置参数 local_listener=listener

SQL> alter system set local_listener=listener;

2.也可以把local_listener设置为address or address list

SQL> alter system set local_listener='(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = xys)(PORT = 1522)))';

而ITPUB博客文章“ORA-00119 ORA-00130 bogon”中解决类似问题的办法就是在spfile启动配置中单独配置LOCAL_LISTENER的值:

于是向数据库pfile参数文件中添加一行 LOCAL_LISTENER='(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))' 明确告诉数据库启动时 LOCAL_LISTENER参数使用 '(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))'此值。 数据库正常启动。


 [oracle@bogon ~]$ cat /u01/app/oracle/product/11.2.0/dbhome_1/dbs/initodi.ora
odi.__db_cache_size=150994944
odi.__java_pool_size=58720256
odi.__large_pool_size=4194304
odi.__oracle_base='/u01/app/oracle'
odi.__pga_aggregate_target=297795584
odi.__sga_target=553648128
odi.__shared_io_pool_size=0
odi.__shared_pool_size=331350016
odi.__streams_pool_size=0
*.audit_file_dest='/u01/app/oracle/admin/odi/adump'
*.audit_trail='db'
*.compatible='11.2.0.0.0'
*.control_files='/u01/app/oracle/oradata/odi/control01.ctl','/u01/app/oracle/oradata/odi/control02.ctl'
*.db_block_size=8192
*.db_domain=''
*.db_name='odi'
*.diagnostic_dest='/u01/app/oracle'
*.memory_target=848297984
*.open_cursors=800
*.processes=500
*.query_rewrite_enabled='TRUE'
*.query_rewrite_integrity='TRUSTED'
*.remote_login_passwordfile='EXCLUSIVE'
*.undo_tablespace='UNDOTBS1'

LOCAL_LISTENER='(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))'

总结,处理这个问题时,容易把 LOCAL_LISTENER 当作 LISTENER,导致错判方向,找不到问题原因而困惑。比如,我一直以为是listener.ora和tnsnames.ora没有生效。

---------------------------------------------------------------------------------------------------------------------

ITPUB博客文章还介绍了启动失败可以检查的日志,但是对处理这个问题没有帮助。

找到启动日志:/data/oracle/diag/rdbms/orcl/orcl/trace/alert_orcl.log

ORA-00130: invalid listener address ‘(ADDRESS=(PROTOCOL=TCP)(HOST=bogon)(PORT=1521))‘_第2张图片

Wed Dec 20 09:26:59 2023
Starting ORACLE instance (normal)
LICENSE_MAX_SESSION = 0
LICENSE_SESSIONS_WARNING = 0
Picked latch-free SCN scheme 3
Using LOG_ARCHIVE_DEST_1 parameter default value as USE_DB_RECOVERY_FILE_DEST
Autotune of undo retention is turned on. 
IMODE=BR
ILAT =27
LICENSE_MAX_USERS = 0
SYS auditing is disabled
Starting up:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options.
Using parameter settings in server-side spfile /data/oracle/product/dbs/spfileorcl.ora
System parameters with non-default values:
  processes                = 150
  memory_target            = 3168M
  control_files            = "/data/oracle/oradata/orcl/control01.ctl"
  control_files            = "/data/oracle/flash_recovery_area/orcl/control02.ctl"
  db_block_size            = 8192
  compatible               = "11.2.0.0.0"
  db_recovery_file_dest    = "/data/oracle/flash_recovery_area"
  db_recovery_file_dest_size= 3882M
  undo_tablespace          = "UNDOTBS1"
  remote_login_passwordfile= "EXCLUSIVE"
  db_domain                = ""
  dispatchers              = "(PROTOCOL=TCP) (SERVICE=orclXDB)"
  audit_file_dest          = "/data/oracle/admin/orcl/adump"
  audit_trail              = "DB"
  db_name                  = "orcl"
  open_cursors             = 300
  diagnostic_dest          = "/data/oracle"
USER (ospid: 23507): terminating the instance due to error 119
Instance terminated by USER, pid = 23507

启动加载的配置文件是Using parameter settings in server-side spfile /data/oracle/product/dbs/spfileorcl.ora

内容如下:

# /data/oracle/product/dbs/initorcl.ora

orcl.__db_cache_size=1426063360
orcl.__java_pool_size=33554432
orcl.__large_pool_size=16777216
orcl.__oracle_base='/data/oracle'#ORACLE_BASE set from environment
orcl.__pga_aggregate_target=1342177280
orcl.__sga_target=1979711488
orcl.__shared_io_pool_size=0
orcl.__shared_pool_size=436207616
orcl.__streams_pool_size=33554432
*.audit_file_dest='/data/oracle/admin/orcl/adump'
*.audit_trail='db'
*.compatible='11.2.0.0.0'
*.control_files='/data/oracle/oradata/orcl/control01.ctl','/data/oracle/flash_recovery_area/orcl/control02.ctl'
*.db_block_size=8192
*.db_domain=''
*.db_name='orcl'
*.db_recovery_file_dest='/data/oracle/flash_recovery_area'
*.db_recovery_file_dest_size=4070572032
*.diagnostic_dest='/data/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=orclXDB)'
*.memory_target=3311403008
*.open_cursors=300
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.undo_tablespace='UNDOTBS1'

为何乱码?

spfile是Oracle数据库的服务器参数文件,它是一个二进制文件,包含了数据库实例的所有参数设置。相比于文本格式的pfile,spfile更加安全,因为它不能被手动编辑,只能通过SQL命令进行修改

pfile是Oracle数据库的初始化参数文件,它是一个文本文件,包含了数据库实例的所有参数设置。在Oracle9i之前,pfile是存储初始化参数的唯一方式。从Oracle9i开始,Oracle引入了spfile,并逐渐取代了pfile的使用

如果需要修改数据库实例的参数设置,可以使用ALTER SYSTEM命令来修改spfile中的参数值。如果需要将spfile转换为pfile,可以使用CREATE PFILE FROM SPFILE命令。反之,如果需要将pfile转换为spfile,可以使用CREATE SPFILE FROM PFILE命令

要查看spfile的内容,可以使用以下命令:

SELECT value FROM v$parameter WHERE name = 'spfile';

这个命令将返回spfile的路径和文件名。如果需要查看spfile的内容,可以使用以下命令:

CREATE PFILE FROM SPFILE;

这个命令将会在数据库实例的$ORACLE_HOME/dbs目录下创建一个名为init.ora的文本文件,其中是数据库实例的名称。你可以使用任何文本编辑器打开这个文件来查看spfile的内容

 数据库是今天登录不上去的。查/data/oracle/diag/rdbms/orcl/orcl/alert/log.xml

ORA-00130: invalid listener address ‘(ADDRESS=(PROTOCOL=TCP)(HOST=bogon)(PORT=1521))‘_第3张图片

 之前能查到:host_id='bogon' host_addr='218.30.64.194'

出现报错后:host_id='bogon' host_addr='UNKNOWN'

这个外网地址不是我的,我猜是不是因为bogon的地址解析突然消失了,所以数据库启动失败了。

https://blog.itpub.net/11780477/viewspace-715318/描述新安装的系统,在装完11.2.0.1.0数据库后。关机再重启,数据库进不去。报如下错误。ORA-00119: invalid specification for system parameter LOCAL_LISTENERORA-00130: invalid listener address '(...ITPUB博客每天千篇余篇博文新资讯,40多万活跃博主,为IT技术人提供全面的IT资讯和交流互动的IT博客平台-中国专业的IT技术ITPUB博客。icon-default.png?t=N7T8https://blog.itpub.net/11780477/viewspace-715318/

oracle11g - ORA-00130: invalid listener address, configure failure - Stack Overflowicon-default.png?t=N7T8https://stackoverflow.com/questions/48100513/ora-00130-invalid-listener-address-configure-failure

https://www.cnblogs.com/princessd8251/p/3330934.htmlicon-default.png?t=N7T8https://www.cnblogs.com/princessd8251/p/3330934.html

你可能感兴趣的:(tcp/ip,网络协议,网络)