SP2-0642: SQL*Plus internal error state 2130, context 0:0:0
<article id="entry-2077" class="entry post-2077 post type-post status-publish format-standard hentry category-experience category-working-case tag-12c tag-bug" itemscope="itemscope" itemtype="http://schema.org/BlogPosting" itemprop="blogPost">
<div class="entry-meta entry-meta-top">
<p class="entry-categories">
<a href="https://oracleblog.org/category/working-case/experience/" rel="category tag">..experience</a>, <a href="https://oracleblog.org/category/working-case/" rel="category tag">Working case</a> </p>
</div>
<h2 class="entry-title" itemprop="headline">
SP2-0642: SQL*Plus internal error state 2130, context 0:0:0 </h2>
<div class="entry-meta entry-meta-bottom">
<time class="entry-date" itemprop="datePublished" datetime="2016-10-09T17:26:55+08:00">2016-10-09</time>
<a href="https://oracleblog.org/working-case/sp2-0642-sqlplus-internal-error-state-2130-context-000/#respond" class="entry-comments-no ">没有评论</a>
</div>
<div class="entry-content" itemprop="text">
<p>今天一个10g的客户端,连接12c的数据库,报错:</p>
<div id="crayon-5d265e2d26de5679887344" class="crayon-syntax crayon-theme-solarized-light crayon-font-verdana crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouseover" style="margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important; height: auto;">
<div class="crayon-toolbar" data-settings=" show" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;"><span class="crayon-title"></span>
<div class="crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;"><div class="crayon-button crayon-nums-button crayon-pressed" title="Toggle Line Numbers"><div class="crayon-button-icon"></div></div><div class="crayon-button crayon-plain-button" title="Toggle Plain Code"><div class="crayon-button-icon"></div></div><div class="crayon-button crayon-wrap-button" title="Toggle Line Wrap"><div class="crayon-button-icon"></div></div><div class="crayon-button crayon-expand-button" title="Expand Code" style="display: none;"><div class="crayon-button-icon"></div></div><div class="crayon-button crayon-copy-button" title="Copy"><div class="crayon-button-icon"></div></div><div class="crayon-button crayon-popup-button" title="Open Code In New Window"><div class="crayon-button-icon"></div></div></div></div>
<div class="crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;"></div>
<div class="crayon-plain-wrap"><textarea wrap="soft" class="crayon-plain print-no" data-settings="dblclick" readonly="" style="tab-size: 4; font-size: 12px !important; line-height: 15px !important; z-index: 0; opacity: 0; overflow: hidden;">sqlplus user/passwd@10.11.22.33:1525/mysrv
SQL*Plus: Release 11.1.0.6.0 - Production on Thu Jun 11 10:05:29 2009
Copyright (c) 1982, 2007, Oracle. All rights reserved.
SP2-0642: SQLPlus internal error state 2130, context 0:0:0
Unsafe to proceed
而这个客户端连接其他12c的数据库是没有问题的。
这是因为建立的service已经是非标准的service,包含了failover type等参数。见下面的Test Case:
<div id="crayon-5d265e2d26df0365553268" class="crayon-syntax crayon-theme-solarized-light crayon-font-verdana crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouseover" style="margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important; height: auto;">
<div class="crayon-toolbar" data-settings=" show" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;"><span class="crayon-title"></span>
<div class="crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;"><div class="crayon-button crayon-nums-button crayon-pressed" title="Toggle Line Numbers"><div class="crayon-button-icon"></div></div><div class="crayon-button crayon-plain-button" title="Toggle Plain Code"><div class="crayon-button-icon"></div></div><div class="crayon-button crayon-wrap-button" title="Toggle Line Wrap"><div class="crayon-button-icon"></div></div><div class="crayon-button crayon-expand-button" title="Expand Code"><div class="crayon-button-icon"></div></div><div class="crayon-button crayon-copy-button" title="Copy"><div class="crayon-button-icon"></div></div><div class="crayon-button crayon-popup-button" title="Open Code In New Window"><div class="crayon-button-icon"></div></div></div></div>
<div class="crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;"></div>
<div class="crayon-plain-wrap"><textarea wrap="soft" class="crayon-plain print-no" data-settings="dblclick" readonly="" style="tab-size: 4; font-size: 12px !important; line-height: 15px !important; z-index: 0; opacity: 0; overflow: hidden;">Test Case:
1.Create a service
srvctl add service -d <database-name> -s <service-name> -r "instance-name,instance-name" -P BASIC
- Start the service
srvctl start service -d rac -s <service-name>
Below was service called test_srv
3.Make a connection using ezconnnect >>
sqlplus scott/tiger@jcrac1-vip:1521/test_srv
This will work.
4.Now modify the service
SQL> select name,service_id from dba_services where name = 'test_srv';
NAME SERVICE_ID
server_taf 12
SQL> execute dbms_service.modify_service (service_name => 'test_srv' -
, aq_ha_notifications => true -
, failover_method => dbms_service.failover_method_basic -
, failover_type => dbms_service.failover_type_select -
, failover_retries => 180 -
, failover_delay => 5 -
, clb_goal => dbms_service.clb_goal_long);
SQL>select name, failover_method, failover_type, failover_retries,goal,
clb_goal,aq_ha_notifications from dba_services where service_id = 12
NAME METHOD TYPE RETRIES GOAL CLB_GOAL AQNOT
test_srv BASIC SELECT 180 NONE LONG YES
5.Connection now fails
sqlplus scott/tiger@jcrac1-vip:1521/test_srv
SQL*Plus: Release 11.1.0.6.0 - Production on Thu Jun 11 10:05:29 2009
Copyright (c) 1982, 2007, Oracle. All rights reserved.
SP2-0642: SQLPlus internal error state 2130, context 0:0:0
Unsafe to proceed
Enter user-name:
该问题是Bug 8599395 : EZCONNECT ERRORS WITH SP2-0642: SQL*PLUS INTERNAL ERROR STATE 2130, CONTEXT 0:0:
解决方法:
建议升级客户端到11.2以上,或者按照bug文档中的workaround也可以:
<div id="crayon-5d265e2d26df8104635491" class="crayon-syntax crayon-theme-solarized-light crayon-font-verdana crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouseover" style="margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important; height: auto;">
<div class="crayon-toolbar" data-settings=" show" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;"><span class="crayon-title"></span>
<div class="crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;"><div class="crayon-button crayon-nums-button crayon-pressed" title="Toggle Line Numbers"><div class="crayon-button-icon"></div></div><div class="crayon-button crayon-plain-button" title="Toggle Plain Code"><div class="crayon-button-icon"></div></div><div class="crayon-button crayon-wrap-button" title="Toggle Line Wrap"><div class="crayon-button-icon"></div></div><div class="crayon-button crayon-expand-button" title="Expand Code" style="display: none;"><div class="crayon-button-icon"></div></div><div class="crayon-button crayon-copy-button" title="Copy"><div class="crayon-button-icon"></div></div><div class="crayon-button crayon-popup-button" title="Open Code In New Window"><div class="crayon-button-icon"></div></div></div></div>
<div class="crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;"></div>
<div class="crayon-plain-wrap"><textarea wrap="soft" class="crayon-plain print-no" data-settings="dblclick" readonly="" style="tab-size: 4; font-size: 12px !important; line-height: 15px !important; z-index: 0; opacity: 0; overflow: hidden;">Workaround:
LOCAL naming resolution works -- 使用tnsnames.ora文件连接
Use standard service works -- 使用标准的service,去掉failover type的参数设置
Do not put port number in the command -- 使用1521默认端口,ezconnect的时候,不写端口号
<div class="entry-tags">
<a href="https://oracleblog.org/tag/12c/" rel="tag">12c</a><a href="https://oracleblog.org/tag/bug/" rel="tag">bug</a> </div>
<div class="entry-utils group">
<ul class="socials">
<li><a href="https://www.facebook.com/sharer.php?u=https://oracleblog.org/working-case/sp2-0642-sqlplus-internal-error-state-2130-context-000/" target="_blank" class="social-icon"><i class="fa fa-facebook"></i></a></li>
<li><a href="https://twitter.com/share?url=https://oracleblog.org/working-case/sp2-0642-sqlplus-internal-error-state-2130-context-000/" target="_blank" class="social-icon"><i class="fa fa-twitter"></i></a></li>
<li><a href="https://plus.google.com/share?url=https://oracleblog.org/working-case/sp2-0642-sqlplus-internal-error-state-2130-context-000/" target="_blank" class="social-icon"><i class="fa fa-google-plus"></i></a></li>
</ul>
</div>
<div id="paging" class="group">
<a href="https://oracleblog.org/working-case/ora-600-kfnslavegroupuse-kfgn_max/" class="paging-standard paging-older">Previous Post</a>
<a href="https://oracleblog.org/working-case/support-full-width-comma-after-10g/" class="paging-standard paging-newer">Next Post</a>
</div>
<div class="entry-related">
<h4>相关文章</h4>
<div class="row">
<div class="col-sm-4">
<article class="entry post-1658 post type-post status-publish format-standard hentry category-experience category-working-case">
<div class="entry-meta">
<time class="entry-date" datetime="2014-12-05T11:43:23+08:00">2014-12-05</time>
</div>
<div class="entry-featured">
<a href="https://oracleblog.org/working-case/11gr2-single-instance-database-shutdown-cause-pre-11gr2-crsd-restart/">
</a>
</div>
<h2 class="entry-title"><a href="https://oracleblog.org/working-case/11gr2-single-instance-database-shutdown-cause-pre-11gr2-crsd-restart/">11g库shutdown导致10g库的crsd进程重启</a></h2>
<div id="comments">
<section id="respond">
<div id="form-wrapper" class="group">
<div id="respond" class="comment-respond">
<h3 id="reply-title" class="comment-reply-title">发表评论 <small><a rel="nofollow" id="cancel-comment-reply-link" href="/working-case/sp2-0642-sqlplus-internal-error-state-2130-context-000/#respond" style="display:none;">取消回复</a></small></h3> <form action="https://oracleblog.org/wp-comments-post.php" method="post" id="commentform" class="comment-form" novalidate="">
<p class="comment-notes"><span id="email-notes">电子邮件地址不会被公开。</span> 必填项已用<span class="required">*</span>标注</p><p class="comment-form-comment"><label for="comment">评论</label> <textarea id="comment" name="comment" cols="45" rows="8" maxlength="65525" required="required"></textarea></p><p class="comment-form-author"><label for="author">姓名 <span class="required">*</span></label> <input id="author" name="author" type="text" value="" size="30" maxlength="245" required="required"></p>
</div><!-- #comments -->
</article>
原文地址:https://oracleblog.org/working-case/sp2-0642-sqlplus-internal-error-state-2130-context-000/