oracle學習小結6

來源:互聯網
上載者:User

  1 查看undo資料表空間的undo段
   select segment_name,tablespace_name from dba_rollback_segs;

2  查看線上undo segment資訊
       select * from v$rollname;

3 查看資料庫上所有角色
       select * from dba_roles;

4 查看某個使用者的角色
       select granted_role,admin_option from dba_role_privs where grantee='SCOTT';

5 查看某角色所擁有的許可權
      select role,privielege,admin_option from role_sys_privs where role='角色名稱';

6 同義字
      其實就是資料庫等的一個別名,如果很長的話可以用這個別名來代替,比如
        create public synonym book for xxx.xxxxx;

7 oracle建議資料表空間大小
         系統資料表:400M
        使用者表:120M
        暫存資料表:100M
        索引表:70

  工具表:12M
        復原表:250M

8 查看當前資料庫各個資料表空間使用方式:
       select df.tablespace_name "資料表空間名",totalspace "總空間M",freespace "剩餘空間M",round((1-freespace/totalspace)*100,2) "使用率%"
from
(select tablespace_name,round(sum(bytes)/1024/1024) totalspace
from dba_data_files
group by tablespace_name) df,
(select tablespace_name,round(sum(bytes)/1024/1024) freespace
from dba_free_space
group by tablespace_name) fs
where df.tablespace_name=fs.tablespace_name;

 

  9   片段空間
      合拼資料表空間的空閑空間: alter tablespace users coalesce;

        整理自由空間片段

         SMON進程會不斷掃描,合拼相鄰的自由空間,但要設定pctincrease非0,一般設定為1
     alter tablespace temp default storage(pctincrease 1);

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.