12c asmsnmp (this will surely be the most misspelled username oracle ever created) and the password file




While i've been merrily setting up ASM I've thus far not bothered to set anything up in cloud control. To do this i need to first set up the asmsnmp user to be used in the credentials in the OMS.

As ASM is not a 'real' database there is no user$ table in the dictionary and all the valid users are held in a password file instead.

Lets try and create this new user (i did all the ASM creation manually so the user does not exist)

SQL> create user asmsnmp identified by password;
create user asmsnmp identified by password
                                  *
ERROR at line 1:
ORA-01990: error opening password file '+DATA/orapwasm'
ORA-17503: ksfdopn:2 Failed to open file +DATA/orapwasm
ORA-15173: entry 'orapwasm' does not exist in directory '/'
ORA-06512: at line 4
ORA-17503: ksfdopn:2 Failed to open file +DATA/orapwasm
ORA-15173: entry 'orapwasm' does not exist in directory '/'
ORA-06512: at line 4

OK - that failed miserably. As this is 12c the default location for theis file is inside ASM itself in the path shown above.

Let's use the orapwd utility to create the file - lets see if we can guess the syntax

[ oracle@server ]:+ASM :[ /etc/init.d ]# orapwd file=+DATA password=password

OPW-00013: Specify either dbuniquename or asm to create password file in Automatic Storage Management disk groups
[ oracle@server ]:+ASM :[ /etc/init.d ]# orapwd file=+ASM password=password

OPW-00013: Specify either dbuniquename or asm to create password file in Automatic Storage Management disk groups
[ oracle@server ]:+ASM :[ /etc/init.d ]# orapwd file=+ASM password=password asm=true

OPW-00013: Specify either dbuniquename or asm to create password file in Automatic Storage Management disk groups

Well that went well.....

Lets see what the help output tells us

[ oracle@server ]:+ASM :[ /etc/init.d ]# orapwd help=y
Usage: orapwd file=<fname> entries=<users> force=<y/n> asm=<y/n>
       dbuniquename=<dbname> format=<legacy/12> sysbackup=<y/n> sysdg=<y/n>
       syskm=<y/n> delete=<y/n> input_file=<input-fname>

Usage: orapwd describe file=<fname>

  where
    file - name of password file (required),
    password - password for SYS will be prompted
               if not specified at command line.
               Ignored, if input_file is specified,
    entries - maximum number of distinct DBA (optional),
    force - whether to overwrite existing file (optional),
    asm - indicates that the password to be stored in
          Automatic Storage Management (ASM) disk group
          is an ASM password. (optional).
    dbuniquename - unique database name used to identify database
                   password files residing in ASM diskgroup only.
                   Ignored when asm option is specified (optional),
    format - use format=12 for new 12c features like SYSBACKUP, SYSDG and
             SYSKM support, longer identifiers, etc.
             If not specified, format=12 is default (optional),
    delete - drops a password file. Must specify 'asm',
             'dbuniquename' or 'file'. If 'file' is specified,
             the file must be located on an ASM diskgroup (optional),
    sysbackup - create SYSBACKUP entry (optional and requires the
                12 format). Ignored, if input_file is specified,
    sysdg - create SYSDG entry (optional and requires the 12 format),
            Ignored, if input_file is specified,
    syskm - create SYSKM entry (optional and requires the 12 format),
            Ignored, if input_file is specified,
    input_file - name of input password file, from where old user
                 entries will be migrated (optional),
    describe - describes the properties of specified password file
               (required).


  There must be no spaces around the equal-to (=) character.

OK lets try with asm =y

[ oracle@server ]:+ASM :[ /etc/init.d ]# orapwd file=+ASM password=password asm=y

OPW-00010: Could not create the password file.
ORA-15056: additional error message
ORA-15001: diskgroup "ASM" does not exist or is not mounted
ORA-06512: at line 4

Looking better - but not quite there

[ oracle@server ]:+ASM :[ /etc/init.d ]# orapwd file=+DATA password=password asm=y

OPW-00010: Could not create the password file.
ORA-15056: additional error message
ORA-15221: ASM operation requires compatible.asm of 12.1.0.0.0 or higher
ORA-06512: at line 4

OK - the compatible level isn't high enough - lets change that


SQL> alter diskgroup DATA set attribute 'compatible.asm'='12.1.0.0.0';

Diskgroup altered.

Right - now lets try again.....

[ oracle@server ]:+ASM :[ /etc/init.d ]# orapwd file=+DATA password=password asm=y


No error this time - so we assume all is OK? Lets check if a file got created.

[ oracle@server ]:+ASM :[ /etc/init.d ]# asmcmd
ASMCMD> ls
DATA/
FRA/
ASMCMD> cd DATA
ASMCMD> ls
ASM/
DEMO/
TEST/
asmtest.dmp
ASMCMD> cd ASM
ASMCMD> ls
PASSWORD/
ASMCMD> cd PASSWORD
ASMCMD> ls
pwdasm.272.841232943
ASMCMD>

Looking good - now we should be able to the new user

sqlplus / as sysasm

SQL*Plus: Release 12.1.0.1.0 Production on Mon Mar 3 11:50:54 2014

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


Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Automatic Storage Management option

SQL> create user asmsnmp identified by password;

User created.

SQL>
SQL> grant sysdba to asmsnmp;

Grant succeeded.

SQL>

And there we have it - created OK now - and we can now use this in cloud control.

3 comments:

  1. It helped me a lot. Thank you

    ReplyDelete
  2. Hello;
    You could tell me how do I delete a file of passwords?

    look:
    C:\> orapwd file=passwd.ora delete=y dbuniquename=edu
    OPW-00023: Specify whether asm dbuniquename or file with the delete.

    what is the correct syntax?
    Thank's

    ReplyDelete
    Replies
    1. try c:\>orapwd file=directry_name/filename delete=y
      e.g c:\> orapwd file=+DATA/passwd.ora delete=y

      Delete