<?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; kzsviver:2</title>
	<atom:link href="https://www.xifenfei.com/tag/kzsviver2/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>11g 使用 alter user  identified by values password 恢复历史密码</title>
		<link>https://www.xifenfei.com/2015/04/11g-%e4%bd%bf%e7%94%a8-alter-user-identified-by-values-password-%e6%81%a2%e5%a4%8d%e5%8e%86%e5%8f%b2%e5%af%86%e7%a0%81.html</link>
		<comments>https://www.xifenfei.com/2015/04/11g-%e4%bd%bf%e7%94%a8-alter-user-identified-by-values-password-%e6%81%a2%e5%a4%8d%e5%8e%86%e5%8f%b2%e5%af%86%e7%a0%81.html#comments</comments>
		<pubDate>Fri, 10 Apr 2015 08:41:49 +0000</pubDate>
		<dc:creator><![CDATA[惜分飞]]></dc:creator>
				<category><![CDATA[Oracle]]></category>
		<category><![CDATA[identified by values]]></category>
		<category><![CDATA[kzsviver:2]]></category>
		<category><![CDATA[ORA-600 kzsviver:2]]></category>
		<category><![CDATA[SPARE4]]></category>
		<category><![CDATA[user$]]></category>

		<guid isPermaLink="false">https://www.xifenfei.com/?p=5839</guid>
		<description><![CDATA[联系：手机/微信(+86 17813235971) QQ(107644445)  &#8230; <a href="https://www.xifenfei.com/2015/04/11g-%e4%bd%bf%e7%94%a8-alter-user-identified-by-values-password-%e6%81%a2%e5%a4%8d%e5%8e%86%e5%8f%b2%e5%af%86%e7%a0%81.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/04/11g-%e4%bd%bf%e7%94%a8-alter-user-identified-by-values-password-%e6%81%a2%e5%a4%8d%e5%8e%86%e5%8f%b2%e5%af%86%e7%a0%81.html" target="_blank">11g 使用 alter user  identified by values password 恢复历史密码</a></p>
<p>作者：<a href="https://www.xifenfei.com" target="_blank">惜分飞</a>©版权所有[未经本人同意,不得以任何形式转载,否则有进一步追究法律责任的权利.]</p>
</div>
<p>在11.1之前的版本,很多人可能都知道，可以通过alter user  identified by values password 来还原oracle 数据库历史密码,但是在11g中出现几个问题:<br />
1. dba_users中无password记录（值为空)，这个问题可以通过直接查询user$.password依然有记录</p>
<pre class="brush: sql; title: ; notranslate">
SQL&gt; select password from dba_users where username='SYS';

PASSWORD
------------------------------


SQL&gt; select password from user$ WHERE name='SYS';

PASSWORD
------------------------------
8A8F025737A9097A
</pre>
<p>2.在11.1开始user$中的SPARE4有值,从而使得数据库密码区分大小写，参考blog:<a href="//www.xifenfei.com/4396.html" title="关于ORACLE 11G密码大小写敏感猜想(USER$.SPARE4)" target="_blank">关于ORACLE 11G密码大小写敏感猜想(USER$.SPARE4)</a></p>
<pre class="brush: sql; title: ; notranslate">
SQL&gt;  select SPARE4  from user$ WHERE name='SYS';

SPARE4
--------------------------------------------------------------------------------
S:C7C81BBE7760B5BBB3973F0971AA36C737BF6DCC4A34FE925CE70B0739BD
</pre>
<p>现在就存在疑问,在11G版本中,如何来还原Oracle数据库用户历史密码呢？,这里通过试验的方式证明,alter user  identified by values后面值可以是user$.password 也可以是user$.SPARE4，只是两者在密码大小写上有区别,具体试验如下：<br />
<br />
<strong>创建测试用户xifenfei</strong></p>
<pre class="brush: sql; title: ; notranslate">
[oracle@localhost ~]$ ss

SQL*Plus: Release 11.2.0.4.0 Production on Fri Apr 10 16:00:03 2015

Copyright (c) 1982, 2013, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL&gt; select * from v$version;

BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
PL/SQL Release 11.2.0.4.0 - Production
CORE    11.2.0.4.0      Production
TNS for Linux: Version 11.2.0.4.0 - Production
NLSRTL Version 11.2.0.4.0 - Production

SQL&gt; select sysdate &quot;www.xifenfei.com&quot; from dual;

www.xifen
---------
10-APR-15

SQL&gt; create user xifenfei identified by oracle;

User created.

SQL&gt; grant create session to xifenfei;

Grant succeeded.

SQL&gt; conn xifenfei/oracle
Connected.
SQL&gt; conn xifenfei/ORACLE
ERROR:
ORA-01017: invalid username/password; logon denied


Warning: You are no longer connected to ORACLE.
SQL&gt; conn / as sysdba
Connected.
SQL&gt; show parameter sec_case_sensitive_logon ;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
sec_case_sensitive_logon             boolean     TRUE
</pre>
<p>这里由于sec_case_sensitive_logon参数默认为true,因此密码区分大小写<br />
<br />
<strong>修改数据库密码</strong></p>
<pre class="brush: sql; title: ; notranslate">
SQL&gt; select spare4,password from user$ where name='XIFENFEI';

SPARE4
--------------------------------------------------------------------------------
PASSWORD
------------------------------
S:6E34E993900317BBFD6289E4AE619D634AA6AD804C765A3DEE1CCABCC50D
1BA871FA3B1C3F45


SQL&gt; alter user xifenfei identified by xifenfei;

User altered.

SQL&gt; select spare4,password from user$ where name='XIFENFEI';

SPARE4
--------------------------------------------------------------------------------
PASSWORD
------------------------------
S:A75A184EA2767488E698C443E97CB2473B46A9C80C2C61833BA867CB8B17
1682CAA2339F770F


SQL&gt; conn xifenfei/xifenfei
Connected.
SQL&gt; conn xifenfei/XIFENFEI
ERROR:
ORA-01017: invalid username/password; logon denied


Warning: You are no longer connected to ORACLE.
SQL&gt; conn xifenfei/oracle
ERROR:
ORA-01017: invalid username/password; logon denied
</pre>
<p>这里把xifenfei用户的密码从oracle修改为xifenfei<br />
<br />
<strong>尝试values user$.password恢复以前密码</strong></p>
<pre class="brush: sql; title: ; notranslate">
SQL&gt; conn / as sysdba
Connected.
SQL&gt; alter user xifenfei identified by values '1BA871FA3B1C3F45';

User altered.

SQL&gt; select spare4,password from user$ where name='XIFENFEI';

SPARE4
--------------------------------------------------------------------------------
PASSWORD
------------------------------

1BA871FA3B1C3F45


SQL&gt; conn xifenfei/oracle
Connected.
SQL&gt; conn xifenfei/ORACLE
Connected.
SQL&gt; conn xifenfei/xifenfei
ERROR:
ORA-01017: invalid username/password; logon denied


Warning: You are no longer connected to ORACLE.
</pre>
<p>通过该方式还原上次密码后，发现user$.SPARE4为空,也就使得Oracle不再区分密码大小写.<br />
<br />
<strong>尝试values user$.spare4恢复以前密码</strong></p>
<pre class="brush: sql; title: ; notranslate">
SQL&gt; conn / as sysdba
Connected.
SQL&gt; alter user xifenfei identified by xifenfei;

User altered.

SQL&gt; select spare4,password from user$ where name='XIFENFEI';

SPARE4
--------------------------------------------------------------------------------
PASSWORD
------------------------------
S:48A11864AD633E904126C20E8C374A4AA45D87BB005D35AD2B10766E8E11
1682CAA2339F770F


SQL&gt; conn xifenfei/xifenfei
Connected.
SQL&gt; conn xifenfei/oracle
ERROR:
ORA-01017: invalid username/password; logon denied


Warning: You are no longer connected to ORACLE.
SQL&gt; conn xifenfei/XIFENFEI
ERROR:
ORA-01017: invalid username/password; logon denied


SQL&gt; alter user xifenfei identified by values '6E34E993900317BBFD6289E4AE619D634AA6AD804C765A3DEE1CCABCC50D';
SP2-0640: Not connected
SQL&gt; conn / as sysdba
Connected.
SQL&gt; alter user xifenfei identified by values '6E34E993900317BBFD6289E4AE619D634AA6AD804C765A3DEE1CCABCC50D';
alter user xifenfei identified by values '6E34E993900317BBFD6289E4AE619D634AA6AD804C765A3DEE1CCABCC50D'
*
ERROR at line 1:
ORA-00600: internal error code, arguments: [kzsviver:2], [], [], [], [], [],
[], [], [], [], [], []
--少写了S:,直接报ORA-600错误，怀疑S:是spare4列的某种标识

SQL&gt; 
SQL&gt; 
SQL&gt; 
SQL&gt; alter user xifenfei identified by values 'S:6E34E993900317BBFD6289E4AE619D634AA6AD804C765A3DEE1CCABCC50D';

User altered.

SQL&gt; select spare4,password from user$ where name='XIFENFEI';

SPARE4
--------------------------------------------------------------------------------
PASSWORD
------------------------------
S:6E34E993900317BBFD6289E4AE619D634AA6AD804C765A3DEE1CCABCC50D

SQL&gt; conn xifenfei/oracle
Connected.
SQL&gt; conn xifenfei/ORACLE
ERROR:
ORA-01017: invalid username/password; logon denied


Warning: You are no longer connected to ORACLE.
SQL&gt; conn xifenfei/xifenfei
ERROR:
ORA-01017: invalid username/password; logon denied
</pre>
<p>这里发现通过values user$.spare4恢复以前密码后,user$.password列为空,但是密码依旧区分大小写。这里可以看出来，user$.password项以后可能取消掉,为了兼容性,因此Oracle在后续版本中依旧保留.<br />
<br />
<strong>关于oracle 11G中恢复以前密码操作总结</strong><br />
1. 通过values user$.password恢复以前密码后,不区分大小写<br />
2. 通过values user$.spare4恢复以前密码后,区分大小写<br />
3. 目前两种方式都可以实现11g恢复以前密码，但是推荐使用user$.spare4值修改</p>
<div id="crp_related"><ul><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2011/12/oracle-10g%e7%bb%95%e8%bf%87%e5%af%86%e7%a0%81%e7%99%bb%e9%99%86%e6%95%b0%e6%8d%ae%e5%ba%93.html" rel="bookmark" class="crp_title">Oracle 10g绕过密码登陆数据库</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2013/05/%e5%85%b3%e4%ba%8eoracle-11g%e5%af%86%e7%a0%81%e5%a4%a7%e5%b0%8f%e5%86%99%e6%95%8f%e6%84%9f%e7%8c%9c%e6%83%b3user-spare4.html" rel="bookmark" class="crp_title">关于ORACLE 11G密码大小写敏感猜想(USER$.SPARE4)</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2019/09/standby-modify-password-delay.html" rel="bookmark" class="crp_title">oracle active dataguard修改密码备库延迟生效</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2011/10/%e8%ae%be%e7%bd%aeoracle-%e5%90%ab%e7%89%b9%e6%ae%8a%e5%ad%97%e7%ac%a6%e5%af%86%e7%a0%81.html" rel="bookmark" class="crp_title">设置oracle 含特殊字符密码</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2023/11/trigger-get-password-error-app.html" rel="bookmark" class="crp_title">触发器找出密码错误应用</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2024/05/password_rollover_time.html" rel="bookmark" class="crp_title">PASSWORD_ROLLOVER_TIME&#8212;实现新老密码短期共存</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2011/11/%e6%9a%b4%e5%8a%9b%e7%a0%b4%e8%a7%a3oracle%e6%95%b0%e6%8d%ae%e5%ba%93%e5%af%86%e7%a0%81.html" rel="bookmark" class="crp_title">暴力破解Oracle数据库密码</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2012/03/%e6%8e%88%e6%9d%83%e7%94%a8%e6%88%b7%e8%ae%bf%e9%97%ae%e6%95%b0%e6%8d%ae%e5%ad%97%e5%85%b8%e4%b8%89%e7%a7%8d%e6%96%b9%e5%bc%8f.html" rel="bookmark" class="crp_title">授权用户访问数据字典三种方式</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2023/04/update-user-ora-01031.html" rel="bookmark" class="crp_title">update user$报ORA-01031错误</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2025/01/oracle-user-read-only.html" rel="bookmark" class="crp_title">Oracle read only用户&#8212;23ai新特性:只读用户</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2024/07/grant-select-any-table-on-schema.html" rel="bookmark" class="crp_title">Oracle23ai新特性&#8212;SCHEMA级授权( grant select any table on schema)</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2011/11/oracle%e5%b8%b8%e7%94%a8%e7%94%a8%e6%88%b7%e6%9d%83%e9%99%90%e8%a7%86%e5%9b%be.html" rel="bookmark" class="crp_title">Oracle常用用户权限视图</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>https://www.xifenfei.com/2015/04/11g-%e4%bd%bf%e7%94%a8-alter-user-identified-by-values-password-%e6%81%a2%e5%a4%8d%e5%8e%86%e5%8f%b2%e5%af%86%e7%a0%81.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
