martes, 5 de noviembre de 2013

CAMBIAR PASSWORD ASM

1. How to create asmsnmp user
——————————————-

First Check which all users are present for ASM >>

SQL> select * from v$pwfile_users;
no rows selected

OR

ASMCMD> lspwusr
Username sysdba sysoper sysasm 
This shows no user are present

A) Create a password file if not already present
$orapwd file=/u01/app/11.2.0/grid/dbs/orapw+ASM password=


++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember below important point about password file in ASM
If there are two nodes with +ASM1 running on node 1 and +ASM2 running on node2.
– Pre 11gR2 –
Password file on Node1: orapw+ASM1
Password file on Node2: orapw+ASM2
– 11gR2 –
Password file on Node1: orapw+ASM
Password file on Node2: orapw+ASM
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


B) Copy the password file to other nodes
$ scp orapw+ASM :/u01/app/11.2.0/grid/dbs/

copy the password files to other nodes if you have more than 2 nodes in the RAC.

C) create user and give sysdba privileges

SQL>create user asmsnmp identified by ;
SQL> grant sysdba to asmsnmp;


Check again for users in ASM  >>

SQL> select * from v$pwfile_users;
 
USERNAME              SYSDB                SYSOP             SYSAS
——————————————————————————————————————— —– —– —————————————————————————————————————–
SYS                    TRUE                TRUE                 TRUE
ASMSNMP                TRUE                FALSE                FALSE

SQL> show parameter pass
NAME                                   TYPE                            VALUE
———————————— —————————————————————————————– ——————————————————————————————————
remote_login_passwordfile             string                          EXCLUSIVE

The ASM instance parameter “REMOTE_LOGIN_PASSWORDFILE” has to be set to EXCLUSIVE or you will get an ORA-01999 error.

Also you can check  user detials from asmcmd

ASMCMD> lspwusr
Username        sysdba         sysoper       sysasm
SYS             TRUE           TRUE          FALSE
ASMSNMP         TRUE           FALSE         FALSE



How to Change password for ASMSNMP
——————————————————–
ASMCMD> lspwusr
Username  sysdba sysoper sysasm
SYS       TRUE   TRUE     TRUE
ASMSNMP   TRUE   FALSE    FALSE

ASMCMD> orapwusr --modify --password ASMSNMP
Enter password: *******
(give new password and press enter)
orapwusr attempts to update passwords on all nodes in a cluster. The command requires the SYSASM privilege to run. A user logged in as SYSDBA cannot change its password using this command.

Test new asmsnmp password >>
————————–
$ sqlplus asmsnmp/asmsnmp as sysdba
SQL*Plus: Release 11.2.0.3.0 Production on Wed Feb 6 12:57:30 2013
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 – 64bit Production
With the Real Application Clusters and Automatic Storage Management options
SQL>