Failed to unlock all EM related accounts

This problem can occur if the default Profile settings have been modified and are no longer the “default” settings..

The following query will reveal the profile:

        SQL> select profile, resource_name, limit

        from dba_profiles

        where resource_type='PASSWORD' order by 1,2;
 

The default 10.2.0.1.0 profile for SYSMAN has the following parameters:

PROFILE………..RESOURCE_NAME…………….                LIMIT
———————————————————————————–
DEFAULT………..FAILED_LOGIN_ATTEMPTS……..    10
DEFAULT………..PASSWORD_GRACE_TIME……….    UNLIMITED
DEFAULT………..PASSWORD_LIFE_TIME………..         UNLIMITED
DEFAULT………..PASSWORD_LOCK_TIME………..      UNLIMITED
DEFAULT………..PASSWORD_REUSE_MAX………. .    UNLIMITED
DEFAULT………..PASSWORD_REUSE_TIME………       UNLIMITED
DEFAULT………..PASSWORD_VERIFY_FUNCTION…..NULL

DBSNMP uses the MONITORING_PROFILE, which is defined the same except for the FAILED_LOGIN_ATTEMPTS, which is set to UNLIMITED.
The failing instance, in one case, showed the following for the DEFAULT profile:

PROFILE………..RESOURCE_NAME……..LIMIT
—————————— ——————————————-
DEFAULT………..FAILED_LOGIN_ATTEMPTS………         4
DEFAULT………..PASSWORD_GRACE_TIME………..         1
DEFAULT………..PASSWORD_LIFE_TIME…………             60
DEFAULT………..PASSWORD_LOCK_TIME……….. .         0138
DEFAULT………..PASSWORD_REUSE_MAX…………        100
DEFAULT………..PASSWORD_REUSE_TIME………..         UNLIMITED
DEFAULT………..PASSWORD_VERIFY_FUNCTION……  NULL

Solution :

1.  In SQL*Plus, logon as SYS and change DBSNMP’s MONITORING_PROFILE, for example:

ALTER PROFILE MONITORING_PROFILE 

LIMIT FAILED_LOGIN_ATTEMPTS UNLIMITED

PASSWORD_GRACE_TIME UNLIMITED

PASSWORD_LIFE_TIME UNLIMITED

PASSWORD_LOCK_TIME UNLIMITED

PASSWORD_REUSE_MAX UNLIMITED

PASSWORD_REUSE_TIME UNLIMITED

PASSWORD_VERIFY_FUNCTION NULL;

2.  Then modify SYSMAN’s DEFAULT:

ALTER PROFILE DEFAULT 

LIMIT FAILED_LOGIN_ATTEMPTS 10

PASSWORD_GRACE_TIME UNLIMITED

PASSWORD_LIFE_TIME UNLIMITED

PASSWORD_LOCK_TIME UNLIMITED

PASSWORD_REUSE_MAX UNLIMITED

PASSWORD_REUSE_TIME UNLIMITED

PASSWORD_VERIFY_FUNCTION NULL;

After this Drop with following Steps : 

 SQL> drop role mgmt_user;
SQL> drop user sysman cascade;
SQL> drop user MGMT_VIEW cascade;
SQL> drop public synonym mgmt_target_blackouts;
SQL> drop public synonym setemviewusercontext;

 -Recreate EM 

 emca -dbcontrol db -repos create ;

Thank you
Osama mustafa