Batch altering profiles of users I currently have a list of databases where the profiles of users are out of date. A lot are listed under default where we want them to be either USR_PROFILE or DBA_PROFILE.

I have a list of all the usernames of users we want under dba_profile. What would be the best way to run an alter user statement to batch change all usernames to USR_PROFILE other than the list of dba users (who may or may not be registered in the database). 

So to do it individually,it would be

alter user U273622 profile USR_PROFILE;


However, that would take forever as this database has over 350 users. Would this be a reasonable guess, to ignore the dba users listed?

alter user where username='U******' except where username='U238234,U3493234,U738467' profile USR_PROFILE;


Kind of scared to test it out as I don't want to break all the usernames. Any help would be great!
You could create a PL/SQL script of course, but I think that let a simple query to build the ALTER statements is a better choice:

SELECT 'ALTER USER ' || username || ' PROFILE USR_PROFILE;'
FROM dba_users WHERE username NOT IN (...);


Of course you must be sure of which users you have to include in the WHERE clause.