暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

ASM的用户管理

eygle 2019-09-19
3067

ASM不存在独立的数据字典,其用户管理是通过口令文件来完成的。


在Grid主目录下存在ASM用户的口令文件:


[grid@enmou1 dbs]$ pwd
/u01/app/grid/product/11.2.0/grid/dbs
[grid@enmou1 dbs]$ ls -l
total 16
-rw-rw---- 1 grid oinstall 1088 Mar 22 14:11 ab_+ASM.dat
-rw-rw---- 1 grid oinstall 1544 Mar 17 11:39 hc_+ASM.dat
-rw-r--r-- 1 grid oinstall 2851 May 15  2009 init.ora
-rw-r----- 1 grid oinstall 1536 Mar 17 11:39 orapw+ASM
复制


查看口令文件,可以看到其中包含的几个初始的用户名及加密口令串:


[grid@enmou1 dbs]$ strings orapw+ASM
]\[Z ORACLE Remote Password file
INTERNAL AB27B53EDC5FEF41
>}[J"%_D) 8A8F025737A9097A
ASMSNMP F14B9991452352C0
复制


ASM的身份认证通过口令文件完成,用户创建与管理也通过口令文件来实现。以sysasm身份登陆ASM实例可以执行用户创建和角色授予:


[grid@enmou1 dbs]$ sqlplus / as sysasm
 
SQL*Plus: Release 11.2.0.2.0 Production on Tue Mar 22 15:15:26 2011
Copyright (c) 1982, 2010, Oracle.  All rights reserved.
SQL> create user asmadm identified by admasm;
 
User created.
 
SQL> GRANT SYSASM TO asmadm;
Grant succeeded.
复制


检查口令文件,可以发现新创建的用户被添加进来:


[grid@enmou1 dbs]$ strings orapw+ASM
]\[Z ORACLE Remote Password file
INTERNAL AB27B53EDC5FEF41
>}[J" %_D) 8A8F025737A9097A
ASMSNMP    F14B9991452352C0
ASMADM     A90DDEB6F5FA2A3D
复制


而如果移除口令文件,就无法新增用户:


[grid@enmou1 dbs]$ sqlplus asmadm/admasm as sysasm
SQL*Plus: Release 11.2.0.2.0 Production on Tue Mar 22 15:16:37 2011
Copyright (c) 1982, 2010, Oracle.  All rights reserved.
SQL> ! mv orapw+ASM orapw+ASM.o
 
SQL> create user asmoper identified by asmoper;
create user asmoper identified by asmoper
                                  *
ERROR at line 1: ORA-01990: error opening password file
'/u01/app/grid/product/11.2.0/grid/dbs/orapw'
复制


而且基于操作系统的身份认证也将无法通过:


[grid@enmou1 dbs]$ sqlplus -L asmadm/admasm as sysasm
 
SQL*Plus: Release 11.2.0.2.0 Production on Tue Mar 22 15:26:02 2011
Copyright (c) 1982, 2010, Oracle.  All rights reserved.
 
ERROR:ORA-01031: insufficient privileges
SP2-0751: Unable to connect to Oracle.  Exiting SQL*Plus
复制
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论