cd ~
sqlplus -S /nolog <<ENDSQL
connect / as sysdba
SET LINESIZE 132
SET PAGESIZE 0
SET TERMOUT OFF 
SET NEWPAGE 0 
SET SPACE 0 
SET ECHO OFF 
SET FEEDBACK OFF 
SET HEADING OFF 
SPOOL x.sql
SELECT 'ALTER USER '||username||' IDENTIFIED BY '||username||' ACCOUNT UNLOCK;'
FROM   dba_users
WHERE  account_status LIKE '%LOCK%';
SPOOL OFF
@x.sql
!rm x.sql
exit
<<ENDSQL
exit
