In RAC of 12c, because it is a flex cluster, the instance runs randomly. For example, instance 3 runs on Node 2 and instance 2 runs on Node 3. This is also true after restart.
We can handle this in this way, so that the original running instance is changed back:
1. Check the information of the instance and node mappings recorded in crs:
[Oracle @ 12102-rac2 ~] $ Crsctl stat res ora. cdbrac. db-p | grep SERVERNAME
GEN_USR_ORA_INST_NAME @ SERVERNAME (12102-rac1) = cdbrac_1
GEN_USR_ORA_INST_NAME @ SERVERNAME (12102-rac2) = cdbrac_3
GEN_USR_ORA_INST_NAME @ SERVERNAME (12102-rac3) = cdbrac_2
[Oracle @ 12102-rac2 ~] $
2. Modify the parameters by using the unsupported parameter. For the reason that the unsupported parameter needs to be added, refer to here.
Crsctl modify res ora. cdbrac. db-attr "GEN_USR_ORA_INST_NAME @ SERVERNAME (12102-rac2) = cdbrac_2"-unsupported
Crsctl modify res ora. cdbrac. db-attr "GEN_USR_ORA_INST_NAME @ SERVERNAME (12102-rac3) = cdbrac_3"-unsupported
3. Check whether the changes have been made to each node:
[Oracle @ 12102-rac2 ~] $ Crsctl stat res ora. cdbrac. db-p | grep SERVERNAME
GEN_USR_ORA_INST_NAME @ SERVERNAME (12102-rac1) = cdbrac_1
GEN_USR_ORA_INST_NAME @ SERVERNAME (12102-rac2) = cdbrac_2
GEN_USR_ORA_INST_NAME @ SERVERNAME (12102-rac3) = cdbrac_3
[Oracle @ 12102-rac2 ~] $
4. Restart crs (including DB)