<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>惜分飞 &#187; hostname</title>
	<atom:link href="https://www.xifenfei.com/tag/hostname/feed" rel="self" type="application/rss+xml" />
	<link>https://www.xifenfei.com</link>
	<description>提供7*24专业数据库(Oracle,SQL Server,MySQL,PostgreSQL等)恢复和技术支持@Tel:17813235971</description>
	<lastBuildDate>Thu, 29 Oct 2026 15:31:46 +0000</lastBuildDate>
	<language>zh-CN</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>ORA-21561: OID generation failed故障解决</title>
		<link>https://www.xifenfei.com/2015/06/ora-21561-oid-generation-failed%e6%95%85%e9%9a%9c%e8%a7%a3%e5%86%b3.html</link>
		<comments>https://www.xifenfei.com/2015/06/ora-21561-oid-generation-failed%e6%95%85%e9%9a%9c%e8%a7%a3%e5%86%b3.html#comments</comments>
		<pubDate>Mon, 01 Jun 2015 09:15:29 +0000</pubDate>
		<dc:creator><![CDATA[惜分飞]]></dc:creator>
				<category><![CDATA[ORA-xxxxx]]></category>
		<category><![CDATA[hostname]]></category>
		<category><![CDATA[hosts]]></category>
		<category><![CDATA[OID generation failed]]></category>
		<category><![CDATA[ORA-21561]]></category>

		<guid isPermaLink="false">https://www.xifenfei.com/?p=5921</guid>
		<description><![CDATA[联系：手机/微信(+86 17813235971) QQ(107644445)  &#8230; <a href="https://www.xifenfei.com/2015/06/ora-21561-oid-generation-failed%e6%95%85%e9%9a%9c%e8%a7%a3%e5%86%b3.html">继续阅读 <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<div id="xifenfeicopyright">
<p>联系：<a href="https://www.xifenfei.com/about_xifenfei" target="_blank">手机/微信(+86 17813235971)   QQ(107644445)</a><a target="_blank" href="http://wpa.qq.com/msgrd?v=3&#038;uin=107644445&#038;site=qq&#038;menu=yes"><img src="https://www.xifenfei.com/wp-content/themes/img/site_qq.jpg" alt="QQ咨询惜分飞" title="QQ咨询惜分飞"/></a></p>
<p>标题：<a href="https://www.xifenfei.com/2015/06/ora-21561-oid-generation-failed%e6%95%85%e9%9a%9c%e8%a7%a3%e5%86%b3.html" target="_blank">ORA-21561: OID generation failed故障解决</a></p>
<p>作者：<a href="https://www.xifenfei.com" target="_blank">惜分飞</a>©版权所有[未经本人同意,不得以任何形式转载,否则有进一步追究法律责任的权利.]</p>
</div>
<p><strong>数据库无法登陆报ORA-21561: OID generation failed错误</strong></p>
<pre class="brush: sql; title: ; notranslate">
[oracle@essc ~]$ sqlplus XIFENFEI/&quot;www.xifenfei.com&quot;@172.16.50.200/orcl

SQL*Plus: Release 11.2.0.4.0 Production on Mon Jun 1 16:52:29 2015

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

ERROR:
ORA-21561: OID generation failed


Enter user-name: 
ERROR:
ORA-12545: Connect failed because target host or object does not exist


Enter user-name: 
ERROR:
ORA-12545: Connect failed because target host or object does not exist


SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus
</pre>
<p><strong>主机名无法ping通</strong></p>
<pre class="brush: bash; title: ; notranslate">
[root@essc ~]# ping essc
ping: unknown host essc
[root@essc ~]# hostname
essc

[root@essc ~]# more /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
172.16.10.11 app1

[oracle@essc ~]$ ifconfig
eth3      Link encap:Ethernet  HWaddr 00:50:56:BB:00:6B  
          inet addr:172.16.10.30  Bcast:172.16.10.255  Mask:255.255.255.0
          inet6 addr: fe80::250:56ff:febb:6b/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:9597 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4018 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:1549999 (1.4 MiB)  TX bytes:470158 (459.1 KiB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:164 errors:0 dropped:0 overruns:0 frame:0
          TX packets:164 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:11424 (11.1 KiB)  TX bytes:11424 (11.1 KiB)
</pre>
<p><strong>修改hosts文件</strong><br />
让hosts中含主机名,也就是为了主机名能够ping通</p>
<pre class="brush: bash; title: ; notranslate">
[oracle@essc ~]$ more /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
172.16.10.11 app1
172.16.10.30 essc
</pre>
<p><strong>数据库登录测试</strong></p>
<pre class="brush: sql; title: ; notranslate">
[oracle@essc ~]$ sqlplus XIFENFEI/&quot;www.xifenfei.com&quot;@172.16.50.200/orcl

SQL*Plus: Release 11.2.0.4.0 Production on Mon Jun 1 16:56:39 2015

Copyright (c) 1982, 2013, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL&gt; 
SQL&gt; exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
</pre>
<p><strong>具体见官方说明</strong><br />
Ora-21561: OID Generation Failed (Doc ID 1335327.1)</p>
<pre class="brush: bash; title: ; notranslate">
APPLIES TO:
Oracle Net Services - Version 9.2.0.8 to 11.2.0.3 [Release 9.2 to 11.2]
Information in this document applies to any platform.
***Checked for relevance on 14-Jan-2013*** 

SYMPTOMS
When attempting to connect to the database using SQL*Plus or DBCA, 
the following error occurs intermittently:

ERROR
-----------------------
ORA-21561: OID generation failed

CAUSE
This could be caused by not having the host name for the 
target database fully qualified in the hosts file.
To verify if you are hitting this issue, the following symptoms should be met:

- ORA-21561: OID generation failed.
- Hosts file has un-fully qualified entry for the target database host:

127.0.0.1 loopback localhost # loopback (lo0) name/address 
10.210.9.111 dbhost
In this sample, dbhost is the target db host.

This is reported in an unpublished Bug 12597261: 
&quot;ORA-21561 IF HOSTNAME ENVIRONMENT VARIABLE IS NOT FULLY QUALIFIED&quot;,
 which should be resolved as of 12G.

SOLUTION
Modify the hosts file to have the fully qualified host names, 
by adding the fully qualified domain name to the entry.

127.0.0.1 loopback localhost # loopback (lo0) name/address 
10.210.9.111 dbhost.sample.com

Verify that other environment and service handles are properly defined as well.

If this is a Windows environment, please check : 
Windows: Connections Fail with ORA-12640 or ORA-21561 (Doc ID 744125.1)
</pre>
<p>再次建议:修改主机名请修改完全,具体参考：<a href="//www.xifenfei.com/622.html" title="linux上安装oracle10g注意事项" target="_blank">linux上安装oracle10g注意事项</a>中修改主机名部分</p>
<div id="crp_related"><ul><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2011/12/hosts%e4%b8%ad%e7%bc%ba%e5%b0%91localhost-localdomain%e5%af%bc%e8%87%b4%e7%9b%91%e5%90%ac%e5%90%af%e5%8a%a8%e6%97%b6%e9%97%b4%e8%b6%85%e9%95%bf.html" rel="bookmark" class="crp_title">hosts中缺少localhost.localdomain导致监听启动时间超长</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2013/06/%e5%ae%89%e8%a3%85-oracle-12c-%e5%8d%95%e8%8a%82%e7%82%b9rac.html" rel="bookmark" class="crp_title">安装 ORACLE 12C 单节点RAC</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2012/03/ipfirst%e4%bd%9c%e7%94%a8%e8%af%b4%e6%98%8e.html" rel="bookmark" class="crp_title">IP=FIRST作用说明</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2024/09/linux-8-modify-network-name.html" rel="bookmark" class="crp_title">Linux 8 修改网卡名称</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2011/11/%e5%9b%a0%e5%9f%9f%e5%90%8d%e8%a7%a3%e6%9e%90%e5%af%bc%e8%87%b4%e6%95%b0%e6%8d%ae%e5%ba%93%e8%bf%9e%e6%8e%a5%e5%bb%b6%e8%bf%9f%e5%88%86%e6%9e%90.html" rel="bookmark" class="crp_title">因域名解析导致数据库连接延迟分析</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2011/07/%e5%8d%95%e7%bd%91%e5%8d%a1%e7%bb%91%e5%ae%9a%e5%a4%9aip%e5%af%bc%e8%87%b4tns-12542%e7%ad%89%e9%94%99%e8%af%af.html" rel="bookmark" class="crp_title">单网卡绑定多IP导致TNS-12542等错误</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2011/12/ora-07445kslgetl120ora-00108%e9%94%99%e8%af%af%e8%a7%a3%e5%86%b3.html" rel="bookmark" class="crp_title">ORA-07445[kslgetl()+120]/ORA-00108错误解决</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2015/10/dns%e8%a7%a3%e6%9e%90%e5%af%bc%e8%87%b4opiodr-aborting-process-unknown-ospid-7266-as-a-result-of-ora-609%e7%b1%bb%e4%bc%bc%e9%94%99%e8%af%af.html" rel="bookmark" class="crp_title">dns解析导致opiodr aborting process unknown ospid (7266) as a result of ORA-609类似错误</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2013/06/%e5%9c%a811gr2-gi%e4%b8%8a%e9%85%8d%e7%bd%ae%e7%ac%ac%e4%ba%8c%e7%9b%91%e5%90%ac.html" rel="bookmark" class="crp_title">在11GR2 GI上配置第二个监听</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2012/02/easy-connect-naming-method%e4%b8%8eezconnect%e5%85%b3%e7%b3%bb.html" rel="bookmark" class="crp_title">Easy Connect Naming Method与EZCONNECT关系</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2016/07/mount%e6%95%b0%e6%8d%ae%e5%ba%93%e4%b9%9f%e5%8f%af%e8%83%bd%e6%9c%89localno%e7%9a%84%e8%bf%9b%e7%a8%8b.html" rel="bookmark" class="crp_title">mount数据库也可能有LOCAL=NO的进程</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2016/01/%e5%85%b3%e4%ba%8ewallet%e5%8a%a0%e5%af%86%e7%9a%84%e5%87%a0%e4%b8%aa%e6%b5%8b%e8%af%95.html" rel="bookmark" class="crp_title">关于wallet加密的几个测试</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>https://www.xifenfei.com/2015/06/ora-21561-oid-generation-failed%e6%95%85%e9%9a%9c%e8%a7%a3%e5%86%b3.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
