oracle查看使用者、許可權和資料表空間等操作方法

來源:互聯網
上載者:User

oracle 查看 使用者,使用者權限,使用者資料表空間,使用者預設資料表空間   1.查看使用者和預設資料表空間的關係。     select   username,default_tablespace   from   dba_users; 2.查看目前使用者的表: select  table_name from  user_tables;   3.查看所有使用者的表名: select table_name  from all_tables;   4.查看所有表名(其中包括系統資料表) select table_name  from all_tables;    5.查看所有的表:  select  *  from  tab/dba_tables/dba_objects/cat;  下面介紹Oracle查詢使用者資料表空間 ◆Oracle查詢使用者資料表空間:select * from user_all_tables ◆Oracle查詢所有函數和儲存過程:select * from user_source ◆Oracle查詢所有使用者:select * from all_users.select * from dba_users ◆Oracle查看目前使用者串連:select * from v$Session ◆Oracle查看目前使用者許可權:select * from session_privs ◆Oracle查看使用者資料表空間使用方式: 1.select a.file_id "FileNo",a.tablespace_name  "Tablespace_name",  a.bytes "Bytes",a.bytes- sum(nvl(b.bytes,0)) "Used",  sum(nvl(b.bytes,0)) "Free",  sum(nvl(b.bytes,0))/a.bytes*100 "%free"   from dba_data_files a, dba_free_space b  where a.file_id=b.file_id(+)  group by a.tablespace_name ,   a.file_id,a.bytes order by a.tablespace_name;    1.查看所有使用者:   select * from dba_user;   select * from all_users;   select * from user_users; 2.查看使用者系統許可權:   select * from dba_sys_privs;   select * from all_sys_privs;   select * from user_sys_privs; 3.查看使用者物件許可權:   select * from dba_tab_privs;   select * from all_tab_privs;   select * from user_tab_privs; 4.查看所有角色:   select * from dba_roles; 5.查看使用者所擁有的角色:   select * from dba_role_privs;   select * from user_role_privs;  6.查看角色所擁有的許可權:    select * from role_sys_privs;    select * from role_tab_privs;  7.查看所有系統許可權    select * from system_privilege_map;   8.查看所有對象許可權    select * from table_privilege_map;  以上是在Oracle中查看使用者權限 , 在DB2中為:   select * from syscat.dbauth   或者   get authorizations  查看sid   select * from v$instance
擷取表: select table_name from user_tables; // 目前使用者的表       select table_name from all_tables; // 所有使用者的表   select table_name from dba_tables; // 包括系統資料表 select table_name from dba_tables where owner=' 使用者名稱 ' user_tables : table_name,tablespace_name,last_analyzed 等 dba_tables : ower,table_name,tablespace_name,last_analyzed 等 all_tables : ower,table_name,tablespace_name,last_analyzed 等 all_objects : ower,object_name,subobject_name,object_id,created,last_ddl_time,timestamp,status 等 擷取表欄位: select * from user_tab_columns where Table_Name=' 使用者表 '; select * from all_tab_columns where Table_Name=' 使用者表 '; select * from dba_tab_columns where Table_Name=' 使用者表 '; user_tab_columns : table_name,column_name,data_type,data_length,data_precision,data_scale,nullable,column_id 等 all_tab_columns : ower,table_name,column_name,data_type,data_length,data_precision,data_scale,nullable,column_id 等 dba_tab_columns : ower,table_name,column_name,data_type,data_length,data_precision,data_scale,nullable,column_id 等 擷取表注釋: select * from user_tab_comments user_tab_comments : table_name,table_type,comments -- 相應的還有 dba_tab_comments , all_tab_comments ,這兩個比 user_tab_comments 多了 ower 列。 擷取欄位注釋: select * from user_col_comments user_col_comments : table_name,column_name,comments

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.