在12.2版本中,如果直接按照cluster那样来设置oracle、grid的附属组,那么使用srvctl命令启动、停止数据库实例时会报ORA-01017,即使像11g/12.1那样,grid的附属组中包含OSDBA组,也会报错 ORA-01017。具体原因为12.2版本中增加了OSRACDBA角色 ,那么 使用srvctl命令启动、停止数据库实例时会以sysrac的权限登录数据库,所以只需要将 OSRACDBA角色对应的组加入grid用户的附属组即可,这一点在oracle的文档上也有提到( https://docs.oracle.com/en/database/oracle/oracle-database/12.2/admin/configuring-automatic-restart-of-an-oracle-database.html#GUID-A42F0C32-6A15-4876-9DA9-E064A80219D9)
Note:
When you install a database or manually add a database to the Oracle Restart configuration, and you have a separate Oracle Grid Infrastructure installation owner user, then you must also add the grid user as a member of the
OSRACDBA group of that database to enable Oracle Grid Infrastructure components to connect to the database. This is because the Oracle Grid Infrastructure components must be able to connect to the database as
SYSRAC to start and stop the database.
For example, if the host user who installed the Oracle Grid Infrastructure home is named
grid and the
OSRACDBA group of the Oracle home is named
racdba, then user
grid must be a member of the
racdba group.
######################################################## # 按照cluster那样来设置oracle、grid的附属组的情况 [root@oel66-12201-notrac ~]# id grid uid=54322(grid) gid=54321(oinstall) groups=54321(oinstall),54331(asmadmin),54332(asmdba),54333(asmoper) [root@oel66-12201-notrac ~]# id oracle uid=54321(oracle) gid=54321(oinstall) groups=54321(oinstall),54322(dba),54323(oper),54324(backupdba),54325(dgdba),54326(kmdba),54330(racdba),54332(asmdba) [root@oel66-12201-notrac ~]# su - grid [grid@oel66-12201-notrac ~]$ srvctl start db -db orcl PRCR-1079 : Failed to start resource ora.orcl.db CRS-5017: 资源操作 "ora.orcl.db start" 遇到以下错误: ORA-01017: invalid username/password; logon denied 。有关详细信息, 请参阅 "(:CLSN00107:)" (位于 "/u01/app/12.2.0/diag/crs/oel66-12201-notrac/crs/trace/ohasd_oraagent_grid.trc" 中)。 CRS-2674: 未能启动 'ora.orcl.db' (在 'oel66-12201-notrac' 上) ORA-01017: invalid username/password; logon denied [grid@oel66-12201-notrac ~]$ srvctl stop db -db testdb PRCD-1334 : failed to stop database testdb PRCD-1124 : Failed to stop database testdb and its services PRCD-1131 : Failed to stop database testdb and its services on nodes PRCR-1133 : Failed to stop database testdb and its running services PRCR-1132 : Failed to stop resources using a filter ORA-01017: invalid username/password; logon denied CRS-2675: 未能停止 'ora.testdb.db' (在 'oel66-12201-notrac' 上) [grid@oel66-12201-notrac ~]$ exit logout ###################################################### # 将OSDBA、OSOPER加入grid的附属组的情况 [root@oel66-12201-notrac ~]# usermod -G oinstall,asmadmin,asmdba,asmoper,dba,oper grid [root@oel66-12201-notrac ~]# su - grid [grid@oel66-12201-notrac ~]$ srvctl start db -d orcl PRCR-1079 : Failed to start resource ora.orcl.db CRS-5017: 资源操作 "ora.orcl.db start" 遇到以下错误: ORA-01017: invalid username/password; logon denied 。有关详细信息, 请参阅 "(:CLSN00107:)" (位于 "/u01/app/12.2.0/diag/crs/oel66-12201-notrac/crs/trace/ohasd_oraagent_grid.trc" 中)。 CRS-2674: 未能启动 'ora.orcl.db' (在 'oel66-12201-notrac' 上) ORA-01017: invalid username/password; logon denied [grid@oel66-12201-notrac ~]$ srvctl stop db -db testdb PRCD-1334 : failed to stop database testdb PRCD-1124 : Failed to stop database testdb and its services PRCD-1131 : Failed to stop database testdb and its services on nodes PRCR-1133 : Failed to stop database testdb and its running services PRCR-1132 : Failed to stop resources using a filter ORA-01017: invalid username/password; logon denied CRS-2675: 未能停止 'ora.testdb.db' (在 'oel66-12201-notrac' 上) [grid@oel66-12201-notrac ~]$ exit logout ############################################################## # 将OSRACDBA加入grid的附属组的情况 [root@oel66-12201-notrac ~]# usermod -G oinstall,asmadmin,asmdba,asmoper,racdba grid [root@oel66-12201-notrac ~]# su - grid [grid@oel66-12201-notrac ~]$ srvctl stop db -db testdb [grid@oel66-12201-notrac ~]$ srvctl start db -db testdb [grid@oel66-12201-notrac ~]$ srvctl status db -db testdb Database is running. [grid@oel66-12201-notrac ~]$
12.1及以下版本中,没有OSRACDBA,所以需要将OSDBA角色对应的组添加到grid的附属组中
Note:
When you manually add a database to the Oracle Restart configuration, you must also add the Oracle grid infrastructure software owner as a member of the OSDBA group of that database. This is because the grid infrastructure components must be able to connect to the database as
SYSDBA
to start and stop the database.
For example, if the host user who installed the grid infrastructure home is named
grid and the OSDBA group of the new database is named
dba, then user
grid must be a member of the
dba group.
