Why do you allow the users to use such password in first place?
Oracle's default routine for password complexity varification checks that. You can implement this by running by running utlpwdmg.sql
It also adds several other features for password policy management. You can even modify the verification routine. Once implemented it will not allow the users to create password which is same as username.
Code:
SQL> create user sanjay_g identified by sanjay_g;
create user sanjay_g identified by sanjay_g
*
ERROR at line 1:
ORA-28003: password verification for the specified password failed
ORA-20001: Password same as user
SQL> alter user sanjay identified by sanjay;
alter user sanjay identified by sanjay
*
ERROR at line 1:
ORA-28003: password verification for the specified password failed
ORA-20001: Password same as user
HTH
Sanjay G.
Oracle Certified Professional 8i, 9i.
"The degree of normality in a database is inversely proportional to that of its DBA"