set echo off
set feedback off
set linesize 512

prompt -------------------------------------
prompt - Liste des utilisateurs de la base -
prompt -------------------------------------

column count(b.object_id) heading 'Nbre d'objets'

SELECT 
   a.username UTILISATEUR,
   a.account_status STATUT,
   a.default_tablespace "TABLESPACE PAR DEFAUT",
   a.temporary_tablespace "TABLESPACE TEMPORAIRE",
   count(b.object_id)
FROM 
   dba_users a, 
   dba_objects b
WHERE 
   a.username = b.owner(+)
GROUP BY 
   a.username,
   a.account_status, 
   a.default_tablespace,
   a.temporary_tablespace
ORDER BY
   a.account_status DESC,
   a.username;
