能够管理ASM instance的角色有三种,他们的分工如下:
组描述 OS指定的组 具有的权限 能做的事情
OSASM asmadmin SYSASM ASM所有管理工作
OSDBA asmdba SYSDBA 访问diskgroup上的文件,database instance所在用户必须是此组成员,因为要对数据文件进行操作,注意只有基于数据库层面的操作权限,没有底层diskgroup层面
的操作权限,且不能启停asm instance
OSOPER asmoper SYSOPER startup, shutdown, mount, dismount, and check disk group
通常oracle用户和grid用户必须是asmdba组成员,grid用户还要是asmadmin、asmoper组的成员
The SYSDBA privilege is intended to be used by the database to access disk groups.
安装ASM是默认创建ASMSNMP用户,ASMSNMP是oracle安装时推荐的用户,该用户只能以sysdba权限登录ASM库(其效果等同于sqlplus sys as sysdba),不能做一些管理的工作例如create Diskgroup:
grid@ora12c1:/home/grid>sqlplus asmsnmp as sysdba
SQL*Plus: Release 12.1.0.1.0 Production on Tue Oct 22 16:16:37 2013
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Enter password:
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Real Application Clusters and Automatic Storage Management options
SQL> select path from v$asm_disk;
PATH
--------------------------------------------------------------------------------
/dev/asm-diskk
/dev/asm-diskl
/dev/asm-diskf
/dev/asm-diskd
/dev/asm-diskh
/dev/asm-diskg
/dev/asm-diskc
/dev/asm-diske
8 rows selected.
SQL> create diskgroup testdg normal redundancy disk '/dev/asm-diskk','/dev/asm-diskl';
create diskgroup testdg normal redundancy disk '/dev/asm-diskk','/dev/asm-diskl'
*
ERROR at line 1:
ORA-15260: permission denied on ASM disk group
create diskgroup testdg normal redundancy disk '/dev/asm-diskk','/dev/asm-diskl';
只有通过sqlplus sys as sysasm连接才能实现:
SQL*Plus: Release 12.1.0.1.0 Production on Tue Oct 22 16:17:28 2013
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Enter password:
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Real Application Clusters and Automatic Storage Management options
SQL> create diskgroup testdg normal redundancy disk '/dev/asm-diskk','/dev/asm-diskl';
Diskgroup created.
SQL> drop diskgroup testdg;
Diskgroup dropped.
组描述 OS指定的组 具有的权限 能做的事情
OSASM asmadmin SYSASM ASM所有管理工作
OSDBA asmdba SYSDBA 访问diskgroup上的文件,database instance所在用户必须是此组成员,因为要对数据文件进行操作,注意只有基于数据库层面的操作权限,没有底层diskgroup层面
的操作权限,且不能启停asm instance
OSOPER asmoper SYSOPER startup, shutdown, mount, dismount, and check disk group
通常oracle用户和grid用户必须是asmdba组成员,grid用户还要是asmadmin、asmoper组的成员
The SYSDBA privilege is intended to be used by the database to access disk groups.
安装ASM是默认创建ASMSNMP用户,ASMSNMP是oracle安装时推荐的用户,该用户只能以sysdba权限登录ASM库(其效果等同于sqlplus sys as sysdba),不能做一些管理的工作例如create Diskgroup:
grid@ora12c1:/home/grid>sqlplus asmsnmp as sysdba
SQL*Plus: Release 12.1.0.1.0 Production on Tue Oct 22 16:16:37 2013
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Enter password:
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Real Application Clusters and Automatic Storage Management options
SQL> select path from v$asm_disk;
PATH
--------------------------------------------------------------------------------
/dev/asm-diskk
/dev/asm-diskl
/dev/asm-diskf
/dev/asm-diskd
/dev/asm-diskh
/dev/asm-diskg
/dev/asm-diskc
/dev/asm-diske
8 rows selected.
SQL> create diskgroup testdg normal redundancy disk '/dev/asm-diskk','/dev/asm-diskl';
create diskgroup testdg normal redundancy disk '/dev/asm-diskk','/dev/asm-diskl'
*
ERROR at line 1:
ORA-15260: permission denied on ASM disk group
create diskgroup testdg normal redundancy disk '/dev/asm-diskk','/dev/asm-diskl';
只有通过sqlplus sys as sysasm连接才能实现:
SQL*Plus: Release 12.1.0.1.0 Production on Tue Oct 22 16:17:28 2013
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Enter password:
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Real Application Clusters and Automatic Storage Management options
SQL> create diskgroup testdg normal redundancy disk '/dev/asm-diskk','/dev/asm-diskl';
Diskgroup created.
SQL> drop diskgroup testdg;
Diskgroup dropped.