線上擴大資料庫UNDO資料表空間

來源:互聯網
上載者:User

線上擴大資料庫UNDO資料表空間

線上擴大資料庫UNDO資料表空間,用Oracle帳號登陸Oracle資料庫伺服器

方法一:

查看錶空間的名字及檔案所在位置:

select tablespace_name, file_id, file_name,round(bytes/(1024*1024),0) total_space

from dba_data_files order by tablespace_name;

修改資料庫datafile檔案到新的大小

alter database datafile '\oracle\oradata\undotab1.dbf' resize 4000m;

方法二:

啟動SQL*Plus session並執行下面命令:

oracle% sqlplus /nolog
sql> connect / as sysdba;
sql> spool $ORACLE_BASE/admin/oss/scripts/recreate_undo.log;
sql> CREATE SMALLFILE UNDO TABLESPACE "UNDOTBS2" DATAFILE '/db/data/undotbs02.dbf' SIZE 30M REUSE AUTOEXTEND ON NEXT 5120K MAXSIZE 32767M;
sql> ALTER SYSTEM SET UNDO_TABLESPACE="UNDOTBS2";
sql> DROP TABLESPACE UNDOTBS1 INCLUDING CONTENTS AND DATAFILES;
sql> CREATE BIGFILE UNDO TABLESPACE "UNDOTBS1" DATAFILE '/db/data/undotbs01.dbf' SIZE 35M REUSE AUTOEXTEND ON NEXT 5120K MAXSIZE 128G;
sql> ALTER SYSTEM SET UNDO_TABLESPACE="UNDOTBS1";
sql> DROP TABLESPACE UNDOTBS2 INCLUDING CONTENTS AND DATAFILES;
sql> exit
oracle%

NOTE!

如果看到這個錯誤:“ORA-30013: undo tablespace 'undotas1' is currently in use”需等待10-30秒,有時會更長些,再重新執行上面命令。也可以執行“UNDOTBS1 / UNDOTBS2”來檢查DROP命令是否可以執行    sql>SELECT SEGMENT_NAME, XACTS, V.STATUS FROM V$ROLLSTAT V, DBA_ROLLBACK_SEGS WHERE TABLESPACE_NAME = 'UNDOTBS1' AND SEGMENT_ID = USN;    返回結果:

“no rows selected”

如果返回的結果是UNDOTBS1還在用的話,那麼可能要重啟ORACLE服務再執行上面的步驟。

--------------------------------------------------------------------------------

RMAN備份與恢複之undo資料表空間丟失

關於Oracle 釋放過度使用的undo資料表空間

Oracle undo的一些理解

Oracle undo 鏡像資料探究

Oracle 復原(ROLLBACK)和撤銷(undo)

Linux-6-64下安裝Oracle 12C筆記

在CentOS 6.4下安裝Oracle 11gR2(x64)

Oracle 11gR2 在VMWare虛擬機器中安裝步驟

Debian 下 安裝 Oracle 11g XE R2

--------------------------------------------------------------------------------

相關文章

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.