In this article we are showing how to backup and restore password file of Oracle ASM with pwget command.

pwget

Purpose

Returns the location of the password file for the Oracle ASM or database instance.

pwcopy

Purpose

Copies an Oracle ASM or database instance password file to the specified location.

pwset

Purpose

Sets the location of the password file for an Oracle ASM or database instance.

1. Locate the password file using the ASMCMD pwget command.

For example:

ASMCMD [+] > pwget --asm
+DATA/orapwasm

2. Back up the password file to another disk group with the pwcopy command.
For example:

ASMCMD [+] > pwcopy +DATA/orapwasm +FRA/my_pwfile_backup

Using pwcopy without the —asm or —dbuniquename option does not change the current location of the password file. If necessary after the copy is made, you can set the current password file location with the pwset command.

3. Verify which password file is in the current location after making a backup with the pwcopy command.
For example:

ASMCMD [+] > pwget --asm
+DATA/orapwasm

4. Verify the backup password file was created.
For example:

ASMCMD [+] > ls +fra/my_pwfile_backup
my_pwfile_backup

5. To restore the Oracle ASM password file, you can use pwset or pwcopy.
To restore the Oracle ASM password file from the backup and use the existing location, use the pwset command with the —asm option.

For example:

ASMCMD [+] > pwset --asm +FRA/my_pwfile_backup

To restore the Oracle ASM password file from the backup to another disk group, use the pwcopy command with the —asm option.

For example:

ASMCMD [+] > pwcopy --asm +FRA/my_pwfile_backup +DATA2/my_orapwasm

The —asm option with the pwset and pwcopy command sets the password location for the Oracle ASM instance.

6. Verify the location of the current password file with the pwget command if you have changed the location.
For example:

ASMCMD [+] > pwget --asm
+DATA2/my_orapwasm

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.