• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

Create Password file for database in ASM Diskgroup – Oracle 12c RAC only

by admin

There are two ways to authenticate users to the database. One way is to use OS authentication and put the responsibility on the operating system to make sure that users logging in are the correct users and that they have the appropriate privileges. The other way is to use a password file.

Oracle provides a password utility (called orapwd) that helps the DBA to create a password file. This file holds the connection information relevant to users who have been granted the SYSOPER or SYSDBA role. Users logging in as SYSDBA will connect to the SYS schema, not their own. This post discusses 2 methods to create a password file for database in ASM diskgroup. Please note that the steps outlined below are only to be used in a RAC setup.

Method 1

1. Verify Password file exists or not:

$ crsctl stat res ora.HCMPRD.db -f | grep PWFILE
PWFILE=

2. Create password file in asm:

$ orapwd file='+DATA/HCMPRD/orapwHCMPRD' dbuniquename='HCMPRD'

3. Now verify password file created or not:

$ crsctl stat res ora.HCMPRD.db -f | grep PWFILE
PWFILE=+DATA/HCMPRD/orapwHCMPRD

4. you can see also in ASM_CLIENT:

ASMCMD [+DATA/HCMPRD/PASSWORD] > ls
pwdHCMPRD.4594.1016696757
pwdHCMPRD.493.1016696613

5. you can find from asm diskgroup:

$ asmcmd
ASMCMD> pwget --dbuniquename HCMPRD
+DATA/HCMPRD/orapwHCMPRD
ASMCMD>

Method 2 (Valid for 12c Onwards)

An alternative method to create password file 12c asm (This method is valid only for oracle 12c onwards)

Syntax:

ASMCMD> pwcreate –dbuniquename {db_unique_name} {file_path} {sys_password}

Example

1. Here we will create a password file with dbuniquename HCMPRD.

ASMCMD> pwcreate --dbuniquename HCMPRD +DATA/PWDFILE/pwdHCMPRD oracle

2. You can check using srvctl also:

$ srvctl config database -d HCMPRD
Database unique name: HCMPRD
Database name:
Oracle home: /u01/app/oracle/product/12.1.0.2/dbhome_1
Oracle user: oracle
Spfile: +DATA/HCMPRD/PARAMETERFILE/spfile.2557.2026287697
Password file: +DATA/HCMPRD/orapwHCMPRD
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools:
Disk Groups: DATA
Mount point paths:
Services:
Type: RAC
Start concurrency:
Stop concurrency:
OSDBA group: dba
OSOPER group: dba
Database instances: HCMPRD1,HCMPRD2
Configured nodes: example1a,example1b
Database is administrator managed
$

Filed Under: oracle

Some more articles you might also be interested in …

  1. Beginners Guide to Oracle Database Vault
  2. How To Cancel A SQL Query In Oracle Database 18c
  3. How to rename a Pluggable Database, along with the respective directories, in Oracle 12c
  4. Oracle Database : Shutdown Basics (How to Shutdown Oracle Database)
  5. How to Identify the Last and Next Refresh Dates for a Materialized View
  6. Unable to export realm protected table using data pump
  7. Oracle Database Basics – User Accounts
  8. ORA-12547: TNS:lost Contact (Oracle 12c2)
  9. Oracle RMAN Backup Shell Script Example
  10. RMAN ‘Duplicate From Active Database’ Feature in Oracle 11g

You May Also Like

Primary Sidebar

Recent Posts

  • powertop Command Examples in Linux
  • powertop: command not found
  • powerstat: command not found
  • powerstat Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright