Query to find users with passwords same as their username in Oracle I'm writing an Oracle audit script where I need to find users in a database who have set their passwords to be the same as their username, e.g. dbaadmin/dbaadmin. The query would need to get the list of users in the database &amp; then check if their passwords is same as their respective usernames.

Can anyone help me out with this query?

PS: I'm a Database newbie.
I don't think this is possible for current versions of Oracle. What I understand happens is that Oracle generates an instance-specific salt and adds this to the passwords being hashed using the SHA1 algorithm, the result of which is stored as the hashed password. See for example http://marcel.vandewaters.nl/oracle/security/password-hashes for information about this algorithm.

This means that password hashes are installation specific, and I don't think it's possible to generate the expected hash value for a given username/password combination.

What you need to do is as @elfcheg suggests to add a password_verify_function on all profiles, or to a single profile, and assign this profile to all users.