Oracle檢視命令

2021-08-22 04:40:13 字數 2116 閱讀 8424

檢視所有使用者:

select*fromdba_users;

select*fromall_users;

select*fromuser_users;

檢視使用者或角色系統許可權(直接賦值給使用者或角色的系統許可權):

select*fromdba_sys_privs;

select*fromuser_sys_privs; (檢視當前使用者所擁有的許可權)

檢視角色(只能檢視登陸使用者擁有的角色)所包含的許可權

sql>select*fromrole_sys_privs;

oracle刪除指定使用者所有表的方法

select'drop table '||table_name||';'fromall_tableswhereowner='要刪除的使用者名稱(注意要大寫)';

檢視所有角色select*fromdba_roles;

獲取當前使用者下所有的表:

selecttable_namefromuser_tables;

刪除某使用者下所有的表資料:

select'truncate table '|| table_namefromuser_tables;

檢視所有約束

select

table_name,

constraint_name

from user_cons_columns

where table_name='tb_students';

檢視當前使用者下所有同義詞

select * from user_synonyms;

檢視當前使用者下的所有索引

select index_name from user_indexes;

檢視當前使用者下所有檢視

select view_name from user_views;

檢視當前使用者下所有序列

select * from user_sequences;

檢視當前使用者下所有表

select table_name from user_tables

檢視當前使用者下所有觸發器

select trigger_name from all_triggers where table_name='';

儲存函式和過程

select object_name,status from user_objects where object_type='function';

select object_name,status from user_objects where object_type='procedure';

Oracle檢視表結構命令

select table name from user tables 當前使用者的表 select table name from all tables 所有使用者的表 select table name from dba tables 包括系統表 select table name from db...

Oracle常用檢視表結構命令

獲取表 select table name from user tables 當前使用者的表 select table name from all tables 所有使用者的表 select table name from dba tables 包括系統表 select table name fro...

Oracle常用檢視表結構命令

獲取表 select table name from user tables 當前使用者的表 select table name from all tables 所有使用者的表 select table name from dba tables 包括系統表 select table name fro...