如何處理undo tablespace 資料表空間太大的問題

來源:互聯網
上載者:User

如何處理undo tablespace 資料表空間太大的問題
  (1)-- 建立一個新的小空間的undo tablespace
  create undo tablespace undotBS4 datafile 'C:\Oracle\oradata\dzq\eoffice\UNDOTBS4.DBF' size 500m;
  (2)-- 設定新的資料表空間為系統undo_tablespace
  alter system set undo_tablespace=undotBS4;
  (3)-- Drop 舊的資料表空間
  drop tablespace undotbs3 including contents;
 ==================================================================
 
-查看錶空間明稱
 
select name from v$tablespace;
 
- 檢查資料庫UNDO資料表空間佔用空間情況以及資料檔案存放位置
 
select file_name,bytes/1024/1024 from dba_data_files  where tablespace_name like 'UNDOTBS2';
 
-查看復原段的使用方式,哪個使用者正在使用復原段的資源,如果有使用者最好更換時間(特別是生產環境)
 
select s.username, u.name from v$transaction t,v$rollstat r, v$rollname u,v$session s where s.taddr=t.addr and t.xidusn=r.usn and r.usn=u.usn order by s.username;
 
-建立新的UNDO資料表空間,並設定自動擴充參數
 
create undo tablespace undotbs1 datafile '/oradata/oradata/ddptest/UNDOTBS1.dbf' size 1000m reuse autoextend on next 800m maxsize unlimited;
 
-查看每十分鐘記錄一次這段時間內使用的undo block數量
 select begin_time,end_time, undoblks from v$undosta

  • 1
  • 2
  • 3
  • 下一頁

聯繫我們

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