Six years ago I wrote a short instruction on how to restore OCR and Votedisk in RAC 12c after a diskgroup failure.
Yesterday I had a possibility of validating my procedure in 21c RAC environment and it has occurred that it is a bit more complicated. Who would have thought? 21 is just 12 backwards!
Most of the procedure is the same, but after you finish, you might face the following error:
1
ohasd_orarootagent_root_1.trc:2022-05-12 11:41:30.336 :CLSDYNAM:139822700111616: [ora.storage]{0:5:3} [start] (null) category: 7, operation: kgfoAl06, loc: kgfokge, OS error: 1017, other: ORA-01017: invalid username/password; logon denied
WTF?
The procedure for this kind of situation is described in MOS How to Recreate Shared ASM Password File in 19c Grid Infrastructure (GI) (Doc ID 2717306.1)
But when tried this fix, I got the following error:
2
credfix: Connected successfully using credentials
for
CRSUSER__ASM_001
3
op
=credstoxml wrap=/tmp/new_creds.xml
4
credfix: OLR
for
rac1 has been fixed
if
credentials were created incorrectly.
5
credfix: Starting SSH session on node rac2.
6
credfix: OLR
for
rac2 has been fixed
if
credentials were created incorrectly. Exiting SSH session.
7
ASMCMD-8043:
more
than one credential
in
OCR
8
credfix: Attempted credverify to check
if
credentials were fixed; credentials remain incorrect.
credentials remain incorrect
Thank you, dear Oracle Support 🙂 You almost helped!
How to recover from this? Well, my solution was to brake it even more! Let’s find a username that CRS is using:
2
[root@rac1 ~]# grep "ASM.CREDENTIALS" OCRDUMPFILE | grep CRSUSER
3
[SYSTEM.ASM.CREDENTIALS.USERS.CRSUSER__ASM_001]
4
[SYSTEM.ASM.CREDENTIALS.USERS.CRSUSER__ASM_001.CRSUSER]
So apparently the user used for ASM connection is CRSUSER__ASM_001.
It should exist in a password file after recreating it manually:
2
Username sysdba sysoper sysasm
4
CRSUSER__ASM_001 TRUE FALSE TRUE
Great, so now let’s mess it even more:
1
SQL>
alter
user
CRSUSER__ASM_001 identified
by
oracle;
And now we will try to use our MOS note once again:
2
credfix: Failed to connect using credentials
for
CRSUSER__ASM_001.
3
credfix: Failed to connect using credentials
for
CRSUSER__ASM_001.
4
op
=addcrscreds wrap=/tmp/creds0.xml
5
credfix: Creating new credentials, no valid credentials
in
OCR.
6
credfix: New user CRSUSER__ASM_002 created.
7
op
=credimport wrap=/tmp/creds0.xml olr=
true
force=
true
8
credfix: OLR
for
rac1 has been fixed
if
credentials were created incorrectly.
9
credfix: Starting SSH session on node rac2.
10
credfix: OLR
for
rac2 has been fixed
if
credentials were created incorrectly. Exiting SSH session.
11
op
=delcrscreds crs_user=CRSUSER__ASM_001
12
credfix: Deleted CRSUSER__ASM_001 from OCR.
13
op
=delcrscreds crs_user=CRSUSER__ASM_001
14
credfix: Deleted CRSUSER__ASM_001 from OCR.
15
credverify: Credentials created correctly on rac1.
16
credverify: Starting SSH session on node rac2
17
credverify: Credentials created correctly on rac2. Exiting SSH session.
18
credfix: Credentials have been fixed
if
they were created incorrectly.
Now we are talking!
So the procedure is the same, but you have to remember about those ASM credentials. Oh, and OCR backup of FS is in a different place:
3
drwxr-xr-x 2 oracle oinstall 42 May 11 15:51 .
4
drwxrwxr-x 27 oracle oinstall 4096 May 11 10:56 ..
5
-rw------- 1 root root 3346432 May 11 15:51 backup00.ocr
6
-rw------- 1 root root 3346432 May 11 15:51 day_.ocr
Cheers!