<?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; 共享密码文件</title>
	<atom:link href="https://www.xifenfei.com/tag/%e5%85%b1%e4%ba%ab%e5%af%86%e7%a0%81%e6%96%87%e4%bb%b6/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>Sun, 22 Nov 2026 15:21:14 +0000</lastBuildDate>
	<language>zh-CN</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>ORACLE 12C ASM 新特性：共享密码文件</title>
		<link>https://www.xifenfei.com/2013/06/oracle-12c-asm-%e6%96%b0%e7%89%b9%e6%80%a7%ef%bc%9a%e5%85%b1%e4%ba%ab%e5%af%86%e7%a0%81%e6%96%87%e4%bb%b6.html</link>
		<comments>https://www.xifenfei.com/2013/06/oracle-12c-asm-%e6%96%b0%e7%89%b9%e6%80%a7%ef%bc%9a%e5%85%b1%e4%ba%ab%e5%af%86%e7%a0%81%e6%96%87%e4%bb%b6.html#comments</comments>
		<pubDate>Mon, 10 Jun 2013 14:26:34 +0000</pubDate>
		<dc:creator><![CDATA[惜分飞]]></dc:creator>
				<category><![CDATA[ORACLE 12C]]></category>
		<category><![CDATA[Oracle ASM]]></category>
		<category><![CDATA[共享密码文件]]></category>

		<guid isPermaLink="false">https://www.xifenfei.com/?p=4474</guid>
		<description><![CDATA[联系：手机/微信(+86 17813235971) QQ(107644445)  &#8230; <a href="https://www.xifenfei.com/2013/06/oracle-12c-asm-%e6%96%b0%e7%89%b9%e6%80%a7%ef%bc%9a%e5%85%b1%e4%ba%ab%e5%af%86%e7%a0%81%e6%96%87%e4%bb%b6.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/2013/06/oracle-12c-asm-%e6%96%b0%e7%89%b9%e6%80%a7%ef%bc%9a%e5%85%b1%e4%ba%ab%e5%af%86%e7%a0%81%e6%96%87%e4%bb%b6.html" target="_blank">ORACLE 12C ASM 新特性：共享密码文件</a></p>
<p>作者：<a href="https://www.xifenfei.com" target="_blank">惜分飞</a>©版权所有[未经本人同意,不得以任何形式转载,否则有进一步追究法律责任的权利.]</p>
</div>
<p>在ORACLE 12C之前大家都知道密码文件是存放在?/dbs或者?/database中,如果要修改修改sysdba权限的用户密码时候,会去修改密码文件,而在rac数据库的sys密码文件是存在各个节点中,这个时候修改sysdba权限的密码就需要在两个节点都要做同样的操作,而对于数据库来说本身是只要在一个节点上修改即可,因为密码是记录在user$中,就是因为密码文件非共享且在各个节点中都有,因此需要在各个节点均要执行修改密码命令,确保密码文件被正常修改。因为rac 密码文件非共享的机制存在,导致修改sysdba权限密码繁琐,有些时候甚至有节点忘记修改,导致需要使用密码文件操作数据库的时候不能正常进行,DG传输日志异常等故障。在ORACLE 12C中为了解决这个问题,引入了密码文件可以存入ASM新特性,从而使得密码文件存储在ASM中实现所有节点共享,从而解决该问题.<br />
<em>ASM存储密码文件前提条件 COMPATIBLE.ASM>= 12.1</em><br />
<strong>查询ASM信息</strong></p>
<pre class="brush: sql; title: ; notranslate">
SQL&gt;  select * from v$version;

BANNER                                                                               CON_ID
-------------------------------------------------------------------------------- ----------
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production              0
PL/SQL Release 12.1.0.1.0 - Production                                                    0
CORE    12.1.0.1.0      Production                                                        0
TNS for Linux: Version 12.1.0.1.0 - Production                                            0
NLSRTL Version 12.1.0.1.0 - Production                                                    0

SQL&gt; select NAME,COMPATIBILITY from v$asm_diskgroup;

NAME                           COMPATIBILITY
------------------------------ ------------------------------------------------------------
DATA                           12.1.0.0.0
</pre>
<p><strong>查询crs中关于db配置</strong></p>
<pre class="brush: bash; title: ; notranslate">
[grid@xifenfei ~]$  srvctl config database -d cdb
Database unique name: cdb
Database name: cdb
Oracle home: /u01/app/oracle/product/12.1/db_1
Oracle user: oracle
Spfile: +DATA/cdb/spfilecdb.ora
Password file: 
Domain: 
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: MANUAL
Database instance: cdb
Disk Groups: DATA
Services: 
</pre>
<p>这里db的password file为空,即表示使用默认值,也就是为$ORACLE_HOME/dbs/orapwxifenfei<br />
<br />
<strong>创建密码文件存储在ASM中</strong></p>
<pre class="brush: bash; title: ; notranslate">
--创建db新密码文件
[oracle@xifenfei ~]$ orapwd file='+data/CDB/orapwdxifenfei' dbuniquename='cdb'

Enter password for SYS: 
----输入sys用户密码

--创建asm新密码文件
orapwd file='+data/ASM/orapwasm' asm=y
----asm=y 表示创建的密码文件为asm的


--使用老密码文件创建db/asm新密码文件
orapwd input_file='/oraclegrid/dbs/orapwasm' file='+data/ASM/orapwasm' [asm=y]
----input_file 表示使用老的密码文件创建新的存储在ASM中的密码文件
</pre>
<p><strong>查看ASM中密码文件</strong></p>
<pre class="brush: bash; title: ; notranslate">
ASMCMD&gt; showversion
ASM version         : 12.1.0.1.0
ASMCMD&gt; pwd
+data/cdb
ASMCMD&gt;  ls -l orapwdxifenfei
Type      Redund  Striped  Time             Sys  Name
PASSWORD  UNPROT  COARSE   MAY 31 19:00:00  N    orapwdxifenfei =&gt; +DATA/CDB/PASSWORD/pwdcdb.290.816897265
</pre>
<p><strong>配置crs中password file项</strong></p>
<pre class="brush: bash; title: ; notranslate">
[grid@xifenfei ~]$ srvctl modify database -db cdb -pwfile  +data/CDB/orapwdxifenfei
</pre>
<p><strong>查询crs中关于db配置</strong></p>
<pre class="brush: bash; title: ; notranslate">
[grid@xifenfei ~]$  srvctl config database -d cdb
Database unique name: cdb
Database name: cdb
Oracle home: /u01/app/oracle/product/12.1/db_1
Oracle user: oracle
Spfile: +DATA/cdb/spfilecdb.ora
Password file: +data/CDB/orapwdxifenfei
Domain: 
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: MANUAL
Database instance: cdb
Disk Groups: DATA
Services: 
</pre>
<p>至此数据库启动使用密码ASM中的密码文件完成,补充说明,该方式配置在ASM中的密码文件,只能是通过crs方式启动db才会生效,如果手工使用sqlplus启动数据库不会使用该密码文件,还是使用默认密码文件。这里也就提醒大家操作规范:<em><strong>在RAC环境(包含单节点的GI环境)中,对数据库的启动关闭操作强烈建议使用crs相关命令来完成,而不推荐使用sqlplus命令</strong><br />
</em></p>
<div id="crp_related"><ul><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2011/10/rac%e4%b8%ad%e7%9a%84spfile%e6%8e%a2%e8%ae%a8.html" rel="bookmark" class="crp_title">rac中的spfile探讨</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2024/09/service-priority-node.html" rel="bookmark" class="crp_title">RAC默认服务配置优先节点</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2016/03/%e4%bf%ae%e6%94%b911-2-rac-%e7%9a%84-scan-ip.html" rel="bookmark" class="crp_title">修改11.2 RAC 的 SCAN IP</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/2017/11/asm-datafile-lost-recovery.html" rel="bookmark" class="crp_title">asm磁盘组操作不当导致数据文件丢失恢复</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2011/12/vpwfile_users%e5%92%8c%e5%af%86%e7%a0%81%e6%96%87%e4%bb%b6%e5%85%b3%e7%b3%bb.html" rel="bookmark" class="crp_title">V$PWFILE_USERS和密码文件关系</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2012/12/oracle-12c-%e4%be%9d%e7%84%b6%e6%94%af%e6%8c%81-bbed.html" rel="bookmark" class="crp_title">ORACLE 12C 依然支持 bbed</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2012/04/ora-01075-you-are-currently-logged-on.html" rel="bookmark" class="crp_title">ORA-01075: you are currently logged on</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2019/02/ora-07217.html" rel="bookmark" class="crp_title">ORA-07217: sltln: environment variable cannot be evaluated.</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2013/08/oracle-12c-windows-linux-%e9%83%a8%e7%bd%b2datagurad.html" rel="bookmark" class="crp_title">ORACLE 12C Windows-Linux 部署DATAGURAD</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2011/11/sqlnet-authentication_services%e5%8f%82%e6%95%b0%e8%af%b4%e6%98%8e.html" rel="bookmark" class="crp_title">SQLNET.AUTHENTICATION_SERVICES参数说明</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2012/10/tts%e5%ae%9e%e7%8e%b0%e8%b7%a8%e7%89%88%e6%9c%ac%e8%bf%81%e7%a7%bb%e6%95%b0%e6%8d%ae.html" rel="bookmark" class="crp_title">TTS实现跨版本迁移数据</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>https://www.xifenfei.com/2013/06/oracle-12c-asm-%e6%96%b0%e7%89%b9%e6%80%a7%ef%bc%9a%e5%85%b1%e4%ba%ab%e5%af%86%e7%a0%81%e6%96%87%e4%bb%b6.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
