重命名与迁移联机数据文件

重命名与迁移联机数据文件
在12C中可以使用alter database move datafile语句来重命名或迁移联机数据文件。当数据库处于open状态,并且用户正在访问数据文件时仍然能够重命名与迁移联机数据文件。

当你重命名与迁移联机数据文件时,在控制文件中所记录指向数据文件的指针会被改变。数据文件会在操作系统层面被重命名与迁移。

当执行以下任务时因为需要允许用户访问数据文件所以需要对联机数据文件执行重命名与迁移:
.将数据文件从一种类型的存储迁移到另一种类型存储上。
.将不频繁访问的数据文件迁移到低成本存储上。
.将表空间置为只读并将它的数据文件写入存储设备上
.将数据库迁移到Oracle ASM中

当执行alter database move datafile语句时,如果在目标目录中存在相同的文件,可以指定reuse选项来覆盖现有文件。当没有指定reuse选项时,如果在目标目录中存在相同文件时,现有文件不会被覆盖并且语句会返回错误信息。

缺省情况下,当执行alter database move datafile语句并指定新目录时,语句会移动数据文件到新目录中。然而可以指定keep选项来保留旧目录中的数据文件。在这种情况下当语句完成后数据库只会使用新目录中的数据文件。

使用alter database move datafile语句来重命名或迁移数据文件时,Oracle数据库会创建一份数据文件副本。确保对于有足够的空间来执行此操作。

注意:如果指定的数据文件处于脱机状态那么执行alter database move datafile语句将会触发错误,如果配置了备库,那么对于主库和备库所执行的联机数据文件迁移操作是相互独立的。当对主库移动数据文件时备库不受影响,反之一样。闪回操作不会将被移动的数据文件重新迁移回之前的目录中。如果将一个联机数据文件从一个目录移动到另一个目录,之后执行闪回数据库操作将其闪回到数据文件迁移之前的时间点,那么数据文件仍然会存储在新目录中,但数据文件的内容将会回到闪回操作所指定的时间点。当在Windows平台上执行数据文件迁移时,就算没有指定keep选项,原始数据文件也会保留在旧目录中。在这种情况下,当迁移操作完成之后,数据库就只会使用新目录中的数据文件。如果需要这时可以使用手动删了旧数据文件。

重命名联机数据文件

SQL> select name from v$datafile;

NAME
----------------------------------------------------------------------------------------------------
+DATA/JY/4B2C6373AE2547CCE053AB828A0A7CA3/DATAFILE/system.274.939167015
+DATA/JY/4B2C6373AE2547CCE053AB828A0A7CA3/DATAFILE/sysaux.275.939167015
+DATA/JY/4B2C6373AE2547CCE053AB828A0A7CA3/DATAFILE/undotbs1.273.939167015
+DATA/JY/4B2C6373AE2547CCE053AB828A0A7CA3/DATAFILE/undo_2.277.939167063
+DATA/JY/4B2C6373AE2547CCE053AB828A0A7CA3/DATAFILE/users.278.939167083
+DATA/JY/4B2C6373AE2547CCE053AB828A0A7CA3/DATAFILE/testtb1.dbf

6 rows selected.

SQL> alter database move datafile '+DATA/JY/4B2C6373AE2547CCE053AB828A0A7CA3/DATAFILE/testtb1.dbf' to '+DATA/JY/4B2C6373AE2547CCE053AB828A0A7CA3/DATAFILE/testtb01.dbf';

Database altered.

SQL> select name from v$datafile;

NAME
----------------------------------------------------------------------------------------------------
+DATA/JY/4B2C6373AE2547CCE053AB828A0A7CA3/DATAFILE/system.274.939167015
+DATA/JY/4B2C6373AE2547CCE053AB828A0A7CA3/DATAFILE/sysaux.275.939167015
+DATA/JY/4B2C6373AE2547CCE053AB828A0A7CA3/DATAFILE/undotbs1.273.939167015
+DATA/JY/4B2C6373AE2547CCE053AB828A0A7CA3/DATAFILE/undo_2.277.939167063
+DATA/JY/4B2C6373AE2547CCE053AB828A0A7CA3/DATAFILE/users.278.939167083
+DATA/JY/4B2C6373AE2547CCE053AB828A0A7CA3/DATAFILE/testtb01.dbf

6 rows selected.

迁移联机数据文件

SQL>ALTER DATABASE MOVE DATAFILE '/u01/oracle/rbdb1/user1.dbf' TO '/u02/oracle/rbdb1/user1.dbf';

复制联机数据文件

SQL>ALTER DATABASE MOVE DATAFILE '/u01/oracle/rbdb1/user1.dbf' TO '/u02/oracle/rbdb1/user1.dbf' KEEP;

迁移联机数据文件并覆盖所存在的数据文件

SQL>ALTER DATABASE MOVE DATAFILE '/u01/oracle/rbdb1/user1.dbf' TO '/u02/oracle/rbdb1/user1.dbf' REUSE;

迁移联机数据文件到ASM磁盘组

SQL>ALTER DATABASE MOVE DATAFILE '/u01/oracle/rbdb1/user1.dbf' TO '+dgroup_01/data/orcl/datafile/user1.dbf';

将联机数据文件从一个ASM磁盘组迁移到另一个ASM磁盘组中

SQL>ALTER DATABASE MOVE DATAFILE '+dgroup_01/data/orcl/datafile/user1.dbf' TO '+dgroup_02/data/orcl/datafile/user1.dbf';

使用表空间组来管理多个临时表空间

使用表空间组来管理多个临时表空间

表空间组能让用户使用来自多个临时表空间中的临时空间。使用表空间组,而不是单个临时表空间,可以减少由于一个临时表空间没有足够的空间来处理排序而引发的问题。表空间组能让单个并行操作的并行执行服务器进程使用多个临时表空间。表空间组有以下特性:
.它包含至少一个临时表空间。对于一个表空间组可以包含的临时表空间数量没有限制。
.它共享命名空间,所以表空间组的名字不能与任何表空间名相同。
.当对数据库或用户指定缺省临时表空间时可以使用表空间组来代替。

我们不能显示创建一个表空间组,但可以在创建第一临时表空间时隐式来创建表空间组。当表空间组中的最后一个临时表空间被删除后,表空间组也会被删除。查询dba_tablespace_groups可以查看相关表空间组与相关的临时表空间。

创建表空间组
当执行create temporary tablespace或alter tablespace语句时通过指定tablespace group子句来隐式创建表空间组并且所指定的表空间组要在当前数据库中并不存在。例如,如果表空间组group1,group2不存在,那么下面的语句将会创建这两个表空间组,并且每个表空间组只有一个临时表空间存在。

SQL> create temporary tablespace temp2 tempfile '+DATA/JY/4B2C6373AE2547CCE053AB828A0A7CA3/TEMPFILE/temp2.dbf' size 50M tablespace group group1;

Tablespace created.

SQL> alter tablespace temp tablespace group group2;

Tablespace altered.


SQL> select * from dba_tablespace_groups;

GROUP_NAME                     TABLESPACE_NAME
------------------------------ ------------------------------
GROUP2                         TEMP
GROUP1                         TEMP2

更改表空间组成员
可以向现有表空间组增加临时表空间,这可以通过执行包含有tablespace group子句的create temporary tablespace或alter tablespace语句来完成。

下面的语句将向现有表空间组group1中增加一个临时表空间temp3,因些表空间组group1包含临时表空间temp2与temp3。

SQL> create temporary tablespace temp3 tempfile '+DATA/JY/4B2C6373AE2547CCE053AB828A0A7CA3/TEMPFILE/temp3.dbf' size 50M tablespace group group1;

Tablespace created.

SQL> select * from dba_tablespace_groups;

GROUP_NAME                     TABLESPACE_NAME
------------------------------ ------------------------------
GROUP2                         TEMP
GROUP1                         TEMP2
GROUP1                         TEMP3

下面的语句将向现有表空间组group2中增加一个临时表空间temp2,但因为临时表空间temp2已经存在,语句只是将临时表空间temp2从表空间组group1移到表空间组group2中。

SQL> select * from dba_tablespace_groups;

GROUP_NAME                     TABLESPACE_NAME
------------------------------ ------------------------------
GROUP2                         TEMP
GROUP2                         TEMP2
GROUP1                         TEMP3

现在表空间组group2包含临时表空间temp,temp2,表空间组group1只包含临时表空间temp3。

下面的语句将从表空间组group1中删除临时表空间temp3

SQL> alter tablespace temp3 tablespace group '';

Tablespace altered.

SQL> select * from dba_tablespace_groups;

GROUP_NAME                     TABLESPACE_NAME
------------------------------ ------------------------------
GROUP2                         TEMP
GROUP2                         TEMP2

临时表空间temp3不再属于任何表空间组。因此表空间组group1不包含任何临时表空间,因此隐式地删除了表空间组group1。

指定表空间组作为数据库的缺省临时表空间
通过执行alter database … default temporary tablespace语句来指定一个表空间组作为数据库的临时表空间。

SQL> SELECT PROPERTY_NAME, PROPERTY_VALUE FROM DATABASE_PROPERTIES WHERE PROPERTY_NAME='DEFAULT_TEMP_TABLESPACE';

PROPERTY_NAME                                       PROPERTY_VALUE
--------------------------------------------------  --------------------------------------------------
DEFAULT_TEMP_TABLESPACE                             TEMP



SQL> alter database default temporary tablespace group2;

Database altered.


SQL> SELECT PROPERTY_NAME, PROPERTY_VALUE FROM DATABASE_PROPERTIES WHERE PROPERTY_NAME='DEFAULT_TEMP_TABLESPACE';

PROPERTY_NAME                                       PROPERTY_VALUE
--------------------------------------------------  --------------------------------------------------
DEFAULT_TEMP_TABLESPACE                             GROUP2

任何没有显示指定临时表空间的用户,将可以使用临时表空间temp,temp2中的空间。当表空间组被指定作为数据库的临时表空间时,不能删除表空间组中的任何成员。要删除临时表空间必须首先要删除表空间组。同样不能删除作为数据库的缺省临时表空间。

Oracle 12CR2 Install the Sample Schemas

在Oracle 12CR2中在创建数据库时不能安装sample schemas,Oracle将sample schemas的安装脚本存储在GitHub上了,可以通过以下链接地址进行下载

https://github.com/oracle/db-sample-schemas/releases/latest

下载到的是一个zip文件,例如我下载的文件名为db-sample-schemas-12.2.0.1.zip,将其解压

[oracle@jytest1 schema]$ unzip db-sample-schemas-12.2.0.1.zip

[oracle@jytest1 schema]$ ls -lrt
total 36584
-rw-r--r--  1 oracle oinstall     2322 Apr  3  2009 drop_sch.sql
-rw-r--r--  1 oracle oinstall    16894 Jul  1  2014 sted_mkplug.sql.dbl
-rw-r--r--  1 oracle oinstall    27570 Jul  1  2014 mkplug.sql
-rw-r--r--  1 oracle oinstall     1685 Nov  6  2015 mk_dir.sql.sbs
drwxr-xr-x  2 oracle oinstall        6 Mar 20 19:50 log
-rw-r--r--  1 oracle oinstall     1824 Mar 20 19:51 mk_dir.sql
drwxr-xr-x  2 oracle oinstall     4096 May 18 17:12 human_resources
-rw-r--r--  1 oracle oinstall 37389564 May 18 17:48 db-sample-schemas-12.2.0.1.zip
drwxrwxrwx 10 oracle oinstall     4096 May 18 18:46 db-sample-schemas-12.2.0.1

创建sample schemas只需执行db-sample-schemas-12.2.0.1目录下的mksample.sql脚本,其语法如下:

mksample          EXAMPLE TEMP $ORACLE_HOME/demo/schema/log/ localhost:1521/pdb

其参数分别指system,sys,hr,oe,pm,ix,sh,bi用户的密码,与缺省表空间,临时表空间名,以及存储生成日志文件的目录和连接数据库的连接串

[oracle@jytest1 db-sample-schemas-12.2.0.1]$ sqlplus /nolog

SQL*Plus: Release 12.2.0.1.0 Production on Thu May 18 18:01:54 2017

Copyright (c) 1982, 2016, Oracle.  All rights reserved.

SQL> @mksample.sql xxzx7817600 xxzx7817600 hr oe pm id sh bi users temp /u01/app/oracle/product/12.2.0/db/demo/schema/db-sample-schemas-12.2.0.1/log/ jypdb

specify password for SYSTEM as parameter 1:

specify password for SYS as parameter 2:

specify password for HR as parameter 3:

specify password for OE as parameter 4:

specify password for PM as parameter 5:

specify password for IX as parameter 6:

specify password for  SH as parameter 7:

specify password for  BI as parameter 8:

specify default tablespace as parameter 9:

specify temporary tablespace as parameter 10:

specify log file directory (including trailing delimiter) as parameter 11:

specify connect string as parameter 12:

Sample Schemas are being created ...

mkdir: cannot create directory 鈥u01/app/oracle/product/12.2.0/db/demo/schema/db-sample-schemas-12.2.0.1鈥 File exists

Connected.
DROP USER hr CASCADE
          *
ERROR at line 1:
ORA-01918: user 'HR' does not exist


DROP USER oe CASCADE
          *
ERROR at line 1:
ORA-01918: user 'OE' does not exist


DROP USER pm CASCADE
          *
ERROR at line 1:
ORA-01918: user 'PM' does not exist


DROP USER ix CASCADE
          *
ERROR at line 1:
ORA-01918: user 'IX' does not exist


DROP USER sh CASCADE
          *
ERROR at line 1:
ORA-01918: user 'SH' does not exist


DROP USER bi CASCADE
          *
ERROR at line 1:
ORA-01918: user 'BI' does not exist


Connected.
SP2-0310: unable to open file "__SUB__CWD__/human_resources/hr_main.sql"
Connected.
SP2-0310: unable to open file "__SUB__CWD__/order_entry/oe_main.sql"
Connected.
SP2-0310: unable to open file "__SUB__CWD__/product_media/pm_main.sql"
Connected.
SP2-0310: unable to open file "__SUB__CWD__/info_exchange/ix_main.sql"
Connected.
SP2-0310: unable to open file "__SUB__CWD__/sales_history/sh_main.sql"
Connected.
SP2-0310: unable to open file "__SUB__CWD__/bus_intelligence/bi_main.sql"
Connected.
not spooling currently
SP2-0310: unable to open file "__SUB__CWD__/mkverify.sql"

上面的错误显示不能打开__SUB__CWD__/目录下的相关脚本文件,这里我们需要将__SUB__CWD__/目录使用相关脚本存储的目录的绝对路径来替,下面执行替换

[oracle@jytest1 db-sample-schemas-12.2.0.1]$ perl -p -i.bak -e 's#__SUB__CWD__#'$(pwd)'#g' *.sql */*.sql */*.dat

重新执行

[oracle@jytest1 ~]$ sqlplus /nolog

SQL*Plus: Release 12.2.0.1.0 Production on Thu May 18 19:05:33 2017

Copyright (c) 1982, 2016, Oracle.  All rights reserved.

SQL>@mksample.sql xxzx7817600 xxzx7817600 hr oe pm id sh bi users temp /u01/app/oracle/product/12.2.0/db/demo/schema/db-sample-schemas-12.2.0.1/log/ jypdb

specify password for SYSTEM as parameter 1:

specify password for SYS as parameter 2:

specify password for HR as parameter 3:

specify password for OE as parameter 4:

specify password for PM as parameter 5:

specify password for IX as parameter 6:

specify password for  SH as parameter 7:

specify password for  BI as parameter 8:

specify default tablespace as parameter 9:

specify temporary tablespace as parameter 10:

specify log file directory (including trailing delimiter) as parameter 11:

specify connect string as parameter 12:

Sample Schemas are being created ...
....省略....

Index cardinality (without  LOB indexes)

OWNER  INDEX_NAME                DISTINCT_KEYS   NUM_ROWS
------ ------------------------- ------------- ----------
HR     COUNTRY_C_ID_PK                      25         25
HR     DEPT_ID_PK                           27         27
HR     DEPT_LOCATION_IX                      7         27
HR     EMP_DEPARTMENT_IX                    11        106
HR     EMP_EMAIL_UK                        107        107
HR     EMP_EMP_ID_PK                       107        107
HR     EMP_JOB_IX                           19        107
HR     EMP_MANAGER_IX                       18        106
HR     EMP_NAME_IX                         107        107
HR     JHIST_DEPARTMENT_IX                   6         10
HR     JHIST_EMPLOYEE_IX                     7         10
HR     JHIST_EMP_ID_ST_DATE_PK              10         10
HR     JHIST_JOB_IX                          8         10
HR     JOB_ID_PK                            19         19
HR     LOC_CITY_IX                          23         23
HR     LOC_COUNTRY_IX                       14         23
HR     LOC_ID_PK                            23         23
HR     LOC_STATE_PROVINCE_IX                17         17
HR     REG_ID_PK                             4          4
IX     AQ$_STREAMS_QUEUE_TABLE_Y             0          0
OE     ACTION_TABLE_MEMBERS                132        132
OE     CUSTOMERS_PK                        319        319
OE     CUST_ACCOUNT_MANAGER_IX               4        319
OE     CUST_EMAIL_IX                       319        319
OE     CUST_LNAME_IX                       176        319
OE     CUST_UPPER_NAME_IX                  319        319
OE     INVENTORY_IX                       1112       1112
OE     INV_PRODUCT_IX                      208       1112
OE     ITEM_ORDER_IX                       105        665
OE     ITEM_PRODUCT_IX                     185        665
OE     LINEITEM_TABLE_MEMBERS              132        132
OE     ORDER_ITEMS_PK                      665        665
OE     ORDER_ITEMS_UK                      665        665
OE     ORDER_PK                            105        105
OE     ORD_CUSTOMER_IX                      47        105
OE     ORD_ORDER_DATE_IX                   105        105
OE     ORD_SALES_REP_IX                      9         70
OE     PRD_DESC_PK                        8640       8640
OE     PRODUCT_INFORMATION_PK              288        288
OE     PROD_NAME_IX                       3727       8640
OE     PROD_SUPPLIER_IX                     62        288
OE     PROMO_ID_PK                           2          2
OE     WAREHOUSES_PK                         9          9
OE     WHS_LOCATION_IX                       9          9
PM     ONLINEMEDIA_PK                        9          9
PM     PRINTMEDIA_PK                         4          4
SH     CHANNELS_PK                           5          5
SH     COSTS_PROD_BIX                        0          0
SH     COSTS_TIME_BIX                        0          0
SH     COUNTRIES_PK                         23         23
SH     CUSTOMERS_GENDER_BIX                  2          5
SH     CUSTOMERS_MARITAL_BIX                11         18
SH     CUSTOMERS_PK                      55500      55500
SH     CUSTOMERS_YOB_BIX                    75         75
SH     DR$SUP_TEXT_IDX$RC
SH     DR$SUP_TEXT_IDX$X                     0          0
SH     FW_PSC_S_MV_CHAN_BIX                  4          4
SH     FW_PSC_S_MV_PROMO_BIX                 4          4
SH     FW_PSC_S_MV_SUBCAT_BIX               21         21
SH     FW_PSC_S_MV_WD_BIX                  210        210
SH     PRODUCTS_PK                          72         72
SH     PRODUCTS_PROD_CAT_IX                  5         72
SH     PRODUCTS_PROD_STATUS_BIX              1          1
SH     PRODUCTS_PROD_SUBCAT_IX              21         72
SH     PROMO_PK                            503        503
SH     SALES_CHANNEL_BIX                     4         92
SH     SALES_CUST_BIX                     7059      35808
SH     SALES_PROD_BIX                       72       1074
SH     SALES_PROMO_BIX                       4         54
SH     SALES_TIME_BIX                     1460       1460
SH     SUP_TEXT_IDX
SH     TIMES_PK                           1826       1826

72 rows selected.

SQL> select username from dba_users;

USERNAME
------------------------------------------------------------------------------------------
SYS
SYSTEM
XS$NULL
LBACSYS
OUTLN
DBSNMP
APPQOSSYS
DBSFWUSER
GGSYS
ANONYMOUS
CTXSYS
SI_INFORMTN_SCHEMA
DVSYS
DVF
GSMADMIN_INTERNAL
ORDPLUGINS
MDSYS
OLAPSYS
ORDDATA
XDB
WMSYS
ORDSYS
GSMCATUSER
MDDATA
SYSBACKUP
REMOTE_SCHEDULER_AGENT
PDBADMIN
GSMUSER
SYSRAC
HR
BI
OJVMSYS
AUDSYS
DIP
JY
OE
PM
SYSKM
ORACLE_OCM
SYS$UMF
QS_ADM
IX
SYSDG
SPATIAL_CSW_ADMIN_USR
SH

45 rows selected.

相关sample schemas创建成功。

Oracle 12CR2 Oracle Restart – ASM Startup fails with PRCR-1079

操作系统Oracle Linux 7.1,数据库版本为12.2.0.1 Oracle Restart在重启之后不能正常启动ASM实例

[grid@jytest3 ~]$ crsctl stat res -t
--------------------------------------------------------------------------------
Name           Target  State        Server                   State details       
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA.dg
               ONLINE  OFFLINE      jytest3                  STABLE
ora.LISTENER.lsnr
               ONLINE  ONLINE       jytest3                  STABLE
ora.asm
               ONLINE  OFFLINE      jytest3                  STABLE
ora.ons
               OFFLINE OFFLINE      jytest3                  STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.cssd
      1        ONLINE  ONLINE       jytest3                  STABLE
ora.diskmon
      1        OFFLINE OFFLINE                               STABLE
ora.driver.afd
      1        ONLINE  ONLINE       jytest3                  STABLE
ora.evmd
      1        ONLINE  ONLINE       jytest3                  STABLE
ora.jy.db
      1        ONLINE  OFFLINE                               Instance Shutdown,ST
                                                             ABLE
--------------------------------------------------------------------------------

尝试手动启动ASM实例,提示无效的用户与密码

[grid@jytest3 ~]$ srvctl start asm -startoption MOUNT -f
PRKO-2002 : Invalid command line option: -f
[grid@jytest3 ~]$ srvctl start asm -startoption MOUNT 
PRCR-1079 : Failed to start resource ora.asm
CRS-5017: The resource action "ora.asm start" encountered the following error: 
ORA-01017: invalid username/password; logon denied
. For details refer to "(:CLSN00107:)" in "/u01/app/grid/diag/crs/jytest3/crs/trace/ohasd_oraagent_grid.trc".

CRS-2674: Start of 'ora.asm' on 'jytest3' failed
ORA-01017: invalid username/password; logon denied

如果尝试使用SQL*PLUS来启动ASM实例,仍然提示无效的用户与密码

[grid@jytest3 ~]$ sqlplus / as sysasm

SQL*Plus: Release 12.2.0.1.0 Production on Tue May 2 20:30:15 2017

Copyright (c) 1982, 2016, Oracle.  All rights reserved.

ERROR:
ORA-01017: invalid username/password; logon denied

检查错误跟踪文件内容如下:

2017-05-02 21:47:39.181 :    AGFW:380081920: {0:0:169} Agent received the message: RESOURCE_START[ora.asm jytest3 1] ID 4098:1530
2017-05-02 21:47:39.181 :    AGFW:380081920: {0:0:169} Preparing START command for: ora.asm jytest3 1
2017-05-02 21:47:39.181 :    AGFW:380081920: {0:0:169} ora.asm jytest3 1 state changed from: OFFLINE to: STARTING
2017-05-02 21:47:39.181 :    AGFW:380081920: {0:0:169} RECYCLE_AGENT attribute not found
2017-05-02 21:47:39.182 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] (:CLSN00107:) clsn_agent::start {
2017-05-02 21:47:39.182 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] InstAgent::start 000 { 
2017-05-02 21:47:39.182 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] InstAgent::start stopConnection 020
2017-05-02 21:47:39.182 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] ConnectionPool::stopConnection
2017-05-02 21:47:39.182 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] ConnectionPool::broadcastEvent 000 entry { OHSid:/u01/app/grid/product/12.2.0/crs+ASM 

s_ohSidEventMapLock:0x139e930 action:2
2017-05-02 21:47:39.182 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] ConnectionPool::removeConnection connection count 0
2017-05-02 21:47:39.182 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] ConnectionPool::removeConnection freed 0
2017-05-02 21:47:39.182 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] ConnectionPool::stopConnection sid +ASM status  1
2017-05-02 21:47:39.182 : USRTHRD:388486912: {0:0:169} ConnectionPool::~ConnectionPool  destructor this:f4061e90 m_oracleHome:/u01/app/grid/product/12.2.0/crs, 

m_oracleSid:+ASM,  m_usrOraEnv:  m_pResState:0x7f10f4049000
2017-05-02 21:47:39.182 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] AsmAgent::refresh
2017-05-02 21:47:39.182 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] AsmAgent::refresh ORACLE_HOME = /u01/app/grid/product/12.2.0/crs
2017-05-02 21:47:39.182 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] clsnUtils::cmdIdIsStart CmdId:257
2017-05-02 21:47:39.182 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] clsnUtils::cmdIdIsStart CmdId:257
2017-05-02 21:47:39.183 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] AsmAgent:getOracleSidAttrib 2 getResAttrib USR_ORA_INST_NAME oracleSid:+ASM
2017-05-02 21:47:39.183 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] AsmAgent:getOracleSidAttrib oracleSid:+ASM
2017-05-02 21:47:39.183 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] AsmAgent::refresh ORACLE_SID = +ASM
2017-05-02 21:47:39.183 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] ConnectionPool::ConnectionPool 2 constructor this:406d700 

m_oracleHome:/u01/app/grid/product/12.2.0/crs, m_oracleSid:+ASM, m_usrOraEnv: m_instanceType:2 m_instanceVersion:12.2.0.1.0
2017-05-02 21:47:39.183 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] ConnectionPool::ConnectionPool 2 constructor m_pResState:0x7f1104033540
2017-05-02 21:47:39.183 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] AsmAgent::setOracleSidAttrib updating GEN_USR_ORA_INST_NAME to +ASM
2017-05-02 21:47:39.183 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] clsnUtils::setResAttrib nonPerX current value GEN_USR_ORA_INST_NAME value +ASM
2017-05-02 21:47:39.183 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] Utils::setResAttrib clsagfw_modify_attribute attr GEN_USR_ORA_INST_NAME value +ASM retCode 0
2017-05-02 21:47:39.183 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] sModifyConfig entry resversion:12.2.0.1.0 compId:+ASM comment:StartOption[1] {
2017-05-02 21:47:39.183 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] sInitFile entry pathname:/etc finename:oratab
2017-05-02 21:47:39.183 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] sclsnInstAgent::sInitFile pathname:/etc 

backupPath:/u01/app/grid/product/12.2.0/crs/srvm/admin/ filename:oratab pConfigF:0x7f11040752d8
2017-05-02 21:47:39.183 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] ConfigFile::ConfigFile constructor name:oratab
2017-05-02 21:47:39.183 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] CssLock::lock s_siha_mtex, got lock CLSN.oratab.jytest3
2017-05-02 21:47:39.184 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] ConfigFile::parse parseLine name: value: comment:
2017-05-02 21:47:39.184 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] ConfigFile::parse mmap name:+asm nameWithCase:+ASM value:/u01/app/grid/product/12.2.0/crs:N 

comment:
2017-05-02 21:47:39.184 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] ConfigFile::parse mmap name:jy nameWithCase:jy value:/u01/app/oracle/product/12.2.0/db:N 

comment:
2017-05-02 21:47:39.184 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] CssLock::unlock s_siha_mtex, released lock CLSN.oratab.jytest3
2017-05-02 21:47:39.184 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] ConfigFile::setAltName this:0x7f11040d80e0 altName:+ASM
2017-05-02 21:47:39.184 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] ConfigFile::setAltValue altValue:/u01/app/grid/product/12.2.0/crs:N
2017-05-02 21:47:39.184 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] sclsnInstAgent::sInitFile resType:ora.asm.type setAltName(compId):+ASM setAltValue

(oracleHome):/u01/app/grid/product/12.2.0/crs:N
2017-05-02 21:47:39.184 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] clsnUtils::cmdIdIsStart CmdId:257
2017-05-02 21:47:39.184 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] clsnUtils::cmdIdIsStart CmdId:257
2017-05-02 21:47:39.184 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] AsmAgent:getOracleSidAttrib 2 getResAttrib USR_ORA_INST_NAME oracleSid:+ASM
2017-05-02 21:47:39.184 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] AsmAgent:getOracleSidAttrib oracleSid:+ASM
2017-05-02 21:47:39.184 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] ConfigFile::getAltName this:0x7f11040d80e0
2017-05-02 21:47:39.184 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] ConfigFile:getAltName altName:+asm
2017-05-02 21:47:39.184 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] sclsnInstAgent::sInitFile dbname:+ASM altName:+asm
2017-05-02 21:47:39.184 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] ConfigFile::getComment name:+asm comment:
2017-05-02 21:47:39.184 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] ConfigFile::getAltName this:0x7f11040d80e0
2017-05-02 21:47:39.184 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] ConfigFile:getAltName altName:+asm
2017-05-02 21:47:39.184 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] ConfigFile::getAltName this:0x7f11040d80e0
2017-05-02 21:47:39.184 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] ConfigFile:getAltName altName:+asm
2017-05-02 21:47:39.184 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] ConfigFile::getComment name:+asm comment:
2017-05-02 21:47:39.184 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] sclsnInstAgent::sInitFile exit dbname:+ASM startup comment: startup altName:+asm comment:
2017-05-02 21:47:39.184 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] InstAgent::start pConfigF:40d80e0
2017-05-02 21:47:39.184 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] CssLock::lock s_siha_mtex, got lock CLSN.oratab.jytest3
2017-05-02 21:47:39.185 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] ConfigFile::parse parseLine name: value: comment:
2017-05-02 21:47:39.186 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] ConfigFile::parse mmap name:+asm nameWithCase:+ASM value:/u01/app/grid/product/12.2.0/crs:N 

comment:
2017-05-02 21:47:39.186 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] ConfigFile::parse mmap name:jy nameWithCase:jy value:/u01/app/oracle/product/12.2.0/db:N 

comment:
2017-05-02 21:47:39.186 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] sclsnInstAgent::sCleanEntry - delete alt(sid) entry
2017-05-02 21:47:39.186 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] clsnUtils::cmdIdIsStart CmdId:257
2017-05-02 21:47:39.186 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] clsnUtils::cmdIdIsStart CmdId:257
2017-05-02 21:47:39.186 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] AsmAgent:getOracleSidAttrib 2 getResAttrib USR_ORA_INST_NAME oracleSid:+ASM
2017-05-02 21:47:39.186 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] AsmAgent:getOracleSidAttrib oracleSid:+ASM
2017-05-02 21:47:39.186 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] sclsnInstAgent::sCleanEntry - key = +ASM
2017-05-02 21:47:39.186 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] ConfigFile::parse parseLine name: value: comment:
2017-05-02 21:47:39.186 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] ConfigFile::parse mmap name:+asm nameWithCase:+ASM value:/u01/app/grid/product/12.2.0/crs:N 

comment:
2017-05-02 21:47:39.186 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] ConfigFile::parse mmap name:jy nameWithCase:jy value:/u01/app/oracle/product/12.2.0/db:N 

comment:
2017-05-02 21:47:39.186 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] ConfigFile::updateInPlace file /etc/oratab is not modified
2017-05-02 21:47:39.186 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] CssLock::unlock s_siha_mtex, released lock CLSN.oratab.jytest3
2017-05-02 21:47:39.186 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] sclsnInstAgent::sCleanEntry - key[+ASM] is cleaned
2017-05-02 21:47:39.186 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] sModifyConfig exit for compId:+ASM }
2017-05-02 21:47:39.186 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] Utils::getResAttrib entry attribName:USR_ORA_OPI required:0 loglevel:1
2017-05-02 21:47:39.186 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] Utils::getResAttrib: attribname USR_ORA_OPI value false len 5
2017-05-02 21:47:39.186 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] Utils::getResAttrib attribname:USR_ORA_OPI value:false exit
2017-05-02 21:47:39.186 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] Agent::valueOfAttribIs attrib: REASON compare value: user attribute value: user
2017-05-02 21:47:39.186 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] Agent::valueOfAttribIs returns 1
2017-05-02 21:47:39.186 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] InstAgent::start 100 getGenRestart
2017-05-02 21:47:39.187 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] InstAgent::getGenRestart exit GEN_RESTART:StartOption[1] }
2017-05-02 21:47:39.187 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] InstAgent::start 120 comment:StartOption[1]
2017-05-02 21:47:39.187 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] Agent::valueOfAttribIs attrib: REASON compare value: failure attribute value: user
2017-05-02 21:47:39.187 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] Agent::valueOfAttribIs returns 0
2017-05-02 21:47:39.187 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] InstAgent::checkState 030 new gimh oracleSid:+ASM
2017-05-02 21:47:39.187 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] Gimh::constructor ohome:/u01/app/grid/product/12.2.0/crs sid:+ASM
2017-05-02 21:47:39.187 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] ConnectionPool::resetConnection  s_statusOfConnectionMap:0x139ea20
2017-05-02 21:47:39.187 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] ConnectionPool::resetConnection sid +ASM status  2
2017-05-02 21:47:39.187 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] Gimh::check condition changes to (GIMH_NEXT_NUM) 0(Abnormal Termination) exists
2017-05-02 21:47:39.187 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] CLS_DRUID_REF(CLSN00006) AsmAgent::gimhChecks 100 failed gimh state 0
2017-05-02 21:47:39.188 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] (:CLSN00006:)InstAgent::checkState 110 return unplanned offline
2017-05-02 21:47:39.188 : USRTHRD:388486912: {0:0:169} Gimh::destructor gimh_dest_query_ctx rc=0
2017-05-02 21:47:39.188 : USRTHRD:388486912: {0:0:169} Gimh::destructor gimh_dest_inst_ctx rc=0
2017-05-02 21:47:39.188 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] ConnectionPool::stopConnection
2017-05-02 21:47:39.188 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] ConnectionPool::broadcastEvent 000 entry { OHSid:/u01/app/grid/product/12.2.0/crs+ASM 

s_ohSidEventMapLock:0x139e930 action:2
2017-05-02 21:47:39.188 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] ConnectionPool::removeConnection connection count 0
2017-05-02 21:47:39.188 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] ConnectionPool::removeConnection freed 0
2017-05-02 21:47:39.188 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] ConnectionPool::stopConnection sid +ASM status  1
2017-05-02 21:47:39.188 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] InstAgent::checkState 200 prev clsagfw_res_status 3 current clsagfw_res_status 1
2017-05-02 21:47:39.188 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] InstAgent::start 180 startOption:StartOption[1]
2017-05-02 21:47:39.189 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] clsnUtils::setResAttrib nonPerX current value GEN_RESTART value StartOption[1]
2017-05-02 21:47:39.189 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] Utils::setResAttrib clsagfw_modify_attribute attr GEN_RESTART value StartOption[1] retCode 0
2017-05-02 21:47:39.189 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] InstAgent::setGenRestart updating GEN_RESTART to StartOption[1] retcode:0 ohasd resource:1
2017-05-02 21:47:39.189 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] InstAgent::start 200 StartInstance with startoption:1 pfile:null 
2017-05-02 21:47:39.189 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] InstAgent::start 400 startInstance
2017-05-02 21:47:39.189 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] InstAgent::startInstance 000 { startOption:1
2017-05-02 21:47:39.189 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] InstConnection:InstConnection: init:040d5ef0 oracleHome:/u01/app/grid/product/12.2.0/crs 

oracleSid:+ASM instanceType:2 instanceVersion:12.2.0.1.0 
2017-05-02 21:47:39.189 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] clsnInstConnection::makeConnectStr UsrOraEnv  m_oracleHome /u01/app/grid/product/12.2.0/crs 

Crshome /u01/app/grid/product/12.2.0/crs
2017-05-02 21:47:39.189 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] clsnInstConnection::makeConnectStr = (DESCRIPTION=(ADDRESS=(PROTOCOL=beq)

(PROGRAM=/u01/app/grid/product/12.2.0/crs/bin/oracle)(ARGV0=oracle+ASM)(ENVS='ORACLE_HOME=/u01/app/grid/product/12.2.0/crs,ORACLE_SID=+ASM')(ARGS='(DESCRIPTION=

(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))')(CONNECT_DATA=(SID=+ASM))))
2017-05-02 21:47:39.191 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] Container:start oracle home /u01/app/grid/product/12.2.0/crs
2017-05-02 21:47:39.191 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] InstAgent::startInstance 020 connect logmode:8008
2017-05-02 21:47:39.191 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] InstConnection::connectInt 020 server not attached
2017-05-02 21:47:39.694 :  CLSDMC:357324544: command 0 failed with status 1
2017-05-02 21:47:39.695 :CLSDYNAM:357324544: [ora.evmd]{0:0:2} [check] DaemonAgent::check returned 0
2017-05-02 21:47:39.695 :CLSDYNAM:357324544: [ora.evmd]{0:0:2} [check] Deep check returned 1
2017-05-02 21:47:40.210 :CLSDYNAM:388486912: [ ora.asm]{0:0:169} [start] ORA-01017: invalid username/password; logon denied

关于ASM启动报无效用户名与密码的问题在MOS上有一篇相关文档”ASM not Starting With: ORA-01017: invalid username/password; logon denied (Doc ID 1918617.1)”,说原因是因为修改了sqlnet.ora文件,正确设置应该如下:

SQLNET.AUTHENTICATION_SERVICES= (NTS)

NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)

但我这里并不是这种情况,从另一篇文档”Oracle Restart – ASM Startup fails with PRCR-1079 (Doc ID 1904942.1)”找到类似的错误信息,说原因是因为ASM资源的ACL(访问控制列表)的权限发生了改变。

检查asm资源的访问控制列表权限

[grid@jytest3 dbs]$  crsctl stat res ora.asm -p
NAME=ora.asm
TYPE=ora.asm.type
ACL=owner:grid:rwx,pgrp:asmdba:r-x,other::r--
ACTIONS=
ACTION_SCRIPT=
ACTION_TIMEOUT=60
AGENT_FILENAME=%CRS_HOME%/bin/oraagent%CRS_EXE_SUFFIX%
ASM_DISKSTRING=AFD:*
AUTO_START=restore
CHECK_INTERVAL=1
CHECK_TIMEOUT=30
CLEAN_TIMEOUT=60
CSS_CRITICAL=no
DEGREE=1
DELETE_TIMEOUT=60
DESCRIPTION=Oracle ASM resource
ENABLED=1
GEN_RESTART=StartOption[1]
GEN_USR_ORA_INST_NAME=+ASM
IGNORE_TARGET_ON_FAILURE=no
INSTANCE_FAILOVER=1
INTERMEDIATE_TIMEOUT=0
LOAD=1
LOGGING_LEVEL=1
MODIFY_TIMEOUT=60
NLS_LANG=
OFFLINE_CHECK_INTERVAL=0
OS_CRASH_THRESHOLD=0
OS_CRASH_UPTIME=0
PRESENCE=standard
PWFILE=+DATA/orapwasm
PWFILE_BACKUP=
REGISTERED_TYPE=srvctl
RESOURCE_GROUP=
RESTART_ATTEMPTS=5
RESTART_DELAY=0
SCRIPT_TIMEOUT=60
SERVER_CATEGORY=
SPFILE=+DATA/ASM/ASMPARAMETERFILE/registry.253.938201547
START_CONCURRENCY=0
START_DEPENDENCIES=hard(ora.cssd) weak(ora.LISTENER.lsnr)
START_DEPENDENCIES_RTE_INTERNAL=
START_TIMEOUT=900
STOP_CONCURRENCY=0
STOP_DEPENDENCIES=hard(ora.cssd)
STOP_DEPENDENCIES_RTE_INTERNAL=
STOP_TIMEOUT=600
TARGET_DEFAULT=default
TYPE_VERSION=1.2
UPTIME_THRESHOLD=1d
USER_WORKLOAD=no
USR_ORA_ENV=
USR_ORA_INST_NAME=+ASM
USR_ORA_OPEN_MODE=mount  
USR_ORA_OPI=false
USR_ORA_STOP_MODE=immediate
WORKLOAD_CPU=0
WORKLOAD_CPU_CAP=0
WORKLOAD_MEMORY_MAX=0
WORKLOAD_MEMORY_TARGET=0

从上面的信息ACL=owner:grid:rwx,pgrp:asmdba:r-x,other::r–,可知组名(pgrp)变为了asmdba组,正常来说应该是grid用户的oinstall组,如果尝试修改:

[grid@jytest3 dbs]$ crsctl setperm resource ora.asm -g oinstall
CRS-4995:  The command 'Setperm  resource' is invalid in crsctl. Use srvctl for this command.

修改时出错了,在12.2.0.1中crsctl setperm命令是一种无效的crsctl,建议使用srvctl命令,但srvctl没有setperm命令,如是加上-unsupported参数再次执行修改:

[grid@jytest3 dbs]$ crsctl setperm resource ora.asm -g oinstall -unsupported

重启Oracle Restart,ASM实例正常启动

[grid@jytest3 lib]$ crsctl stop has
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'jytest3'
CRS-2673: Attempting to stop 'ora.LISTENER.lsnr' on 'jytest3'
CRS-2673: Attempting to stop 'ora.evmd' on 'jytest3'
CRS-2677: Stop of 'ora.LISTENER.lsnr' on 'jytest3' succeeded
CRS-2677: Stop of 'ora.evmd' on 'jytest3' succeeded
CRS-2673: Attempting to stop 'ora.cssd' on 'jytest3'
CRS-2677: Stop of 'ora.cssd' on 'jytest3' succeeded
CRS-2673: Attempting to stop 'ora.driver.afd' on 'jytest3'
CRS-2677: Stop of 'ora.driver.afd' on 'jytest3' succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'jytest3' has completed
CRS-4133: Oracle High Availability Services has been stopped.
[grid@jytest3 ~]$ crsctl start has
CRS-4123: Oracle High Availability Services has been started.
[grid@jytest3 ~]$ crsctl stat res -t
--------------------------------------------------------------------------------
Name           Target  State        Server                   State details       
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA.dg
               ONLINE  ONLINE       jytest3                  STABLE
ora.LISTENER.lsnr
               ONLINE  ONLINE       jytest3                  STABLE
ora.asm
               ONLINE  ONLINE       jytest3                  Started,STABLE
ora.ons
               OFFLINE OFFLINE      jytest3                  STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.cssd
      1        ONLINE  ONLINE       jytest3                  STABLE
ora.diskmon
      1        OFFLINE OFFLINE                               STABLE
ora.driver.afd
      1        ONLINE  ONLINE       jytest3                  STABLE
ora.evmd
      1        ONLINE  ONLINE       jytest3                  STABLE
ora.jy.db
      1        ONLINE  ONLINE       jytest3                  Open,HOME=/u01/app/o
                                                             racle/product/12.2.0
                                                             /db,STABLE
--------------------------------------------------------------------------------