Objets
Lister les tables d'un utilisateurSELECT * FROM user_tables;
Afficher tous les types d'objets appartenant à un utilisateur
SELECT DISTINCT object_type FROM user_objects;
Afficher les tables, vues, synonymes et séquences d'un utilisateur
SELECT * FROM user_catalog;
Afficher les contraintes (vue
user_constraints)
SELECT constraint_name, constraint_type, search_condition FROM user_constraints WHERE table_name = 'table_name';
Voir les contraintes associées aux colonnes
SELECT constraint_name, column_name FROM user_cons_columns WHERE table_name = 'table_name';
Voir les séquences
SELECT sequence_name, min_value, max_value, increment_by, last_number FROM user_sequences;
Voir les index (vues
USER_INDEXES
et USER_IND_COLUMNS
SELECT ic.index_name, ic.column_name, ic.column_position col_pos, ix.uniqueness FROM USER_INDEXES ix, USER_IND_COLUMNS ic WHERE ic.index_name = ix.index_name AND ic.table_name = 'table_name';
Privilèges
Metabase | Description |
---|---|
ROLE_SYS_PRIVS | Privilèges système accordés aux rôles |
ROLE_TAB_PRIVS | Table privileges granted to roles |
USER_ROLE_PRIVS | Roles accessible by the user |
USER_TAB_PRIVS_MADE | Object privileges granted on the user's objects |
USER_TAB_PRIVS_RECD | Object privileges granted to the user |
USER_COL_PRIVS_MADE | Object privileges granted on the columns of the user's objects |
USER_COL_PRIVS_RECD | Object privileges granted to the user on specific columns |
select * from USER_ROLE_PRIVS; select * from ROLE_TAB_PRIVS; select * from USER_ROLE_PRIVS; select * from USER_TAB_PRIVS_MADE; select * from USER_TAB_PRIVS_RECD; select * from USER_COL_PRIVS_MADE; select * from USER_COL_PRIVS_RECD;
Utilisateurs
Lister les utilisateurs visibles par l'utilisateur courant :SELECT * FROM all_users;
List all users in the Oracle Database (exécutable uniquement par le DBA) :
SELECT * FROM dba_users;