rem $DBA/copyusis.sql rem Make sure entered username exists in the database set term off echo off feedback off heading off pagesize 0 spool copyusis.tmp select username from dba_users, dba_sys_privs where username not in ('PUBLIC','_NEXT_USER') and username = grantee and privilege = 'CREATE SESSION' union select username from dba_users, dba_role_privs where username not in ('PUBLIC','_NEXT_USER') and username = grantee and granted_role in (select r.role from dba_roles r, dba_sys_privs s where r.role = s.grantee and s.privilege = 'CREATE SESSION'); spool off; exit