您好,登錄后才能下訂單哦!
本文小編為大家詳細(xì)介紹“Oracle本地UNDO模式怎么實現(xiàn)”,內(nèi)容詳細(xì),步驟清晰,細(xì)節(jié)處理妥當(dāng),希望這篇“Oracle本地UNDO模式怎么實現(xiàn)”文章能幫助大家解決疑惑,下面跟著小編的思路慢慢深入,一起來學(xué)習(xí)新知識吧。
SQL>COLUMN property_name FORMAT A30 SQL>COLUMN property_value FORMAT A30 SQL>SELECT property_name, property_value FROM database_properties WHERE property_name = 'LOCAL_UNDO_ENABLED'; PROPERTY_NAME PROPERTY_VALUE ------------------------------ ------------------------------ LOCAL_UNDO_ENABLED TRUE
SELECT con_id, tablespace_name FROM cdb_tablespaces WHERE tablespace_name LIKE 'UNDO%' ORDER BY con_id; CON_ID TABLESPACE_NAME ---------- ------------------------------ 1 UNDOTBS1 3 UNDOTBS1
SQL> SHUTDOWN IMMEDIATE; SQL> STARTUP UPGRADE; SQL> ALTER DATABASE LOCAL UNDO OFF; SQL> SHUTDOWN IMMEDIATE; SQL> STARTUP;
SQL>COLUMN property_name FORMAT A30 SQL>COLUMN property_value FORMAT A30 SQL>SELECT property_name, property_value FROM database_properties WHERE property_name = 'LOCAL_UNDO_ENABLED'; PROPERTY_NAME PROPERTY_VALUE ----------------------------- ------------------------------ LOCAL_UNDO_ENABLED FALSE
雖然已經(jīng)不是本地undo模式了,但是之前存在的undo表空間不會自動刪除。如果礙事,要手動刪除。
SQL>SELECT con_id, tablespace_name FROM cdb_tablespaces WHERE tablespace_name LIKE 'UNDO%' ORDER BY con_id; CON_ID TABLESPACE_NAME ---------- ------------------------------ 1 UNDOTBS1 3 UNDOTBS1
–刪除多余的undo表空間
SQL>ALTER SESSION SET CONTAINER = pdb1; SQL>SELECT file_name FROM dba_data_files WHERE tablespace_name = 'UNDOTBS1'; ---------------------------------------------------------------------------------------------------- /u02/app/oracle/oradata/cdb1/pdb1/undotbs01.dbf SQL>DROP TABLESPACE undotbs1; Tablespace dropped.
隨著所有老的undo表空間被移除了,現(xiàn)在該實例就是運行在共享undo模式上了。
利用上面的環(huán)境,重新切換回去。
可以看到是運行在共享undo模式上,而且只有一個undo表空間。
SQL>SELECT property_name, property_value FROM database_properties WHERE property_name = 'LOCAL_UNDO_ENABLED'; PROPERTY_NAME PROPERTY_VALUE ------------------------------ ------------------------------ LOCAL_UNDO_ENABLED FALSE SQL>SELECT con_id, tablespace_name FROM cdb_tablespaces WHERE tablespace_name LIKE 'UNDO%' ORDER BY con_id; CON_ID TABLESPACE_NAME ---------- ------------------------------ 1 UNDOTBS1
和切換為共享undo模式步驟相同。
SQL> SHUTDOWN IMMEDIATE; SQL> STARTUP UPGRADE; SQL> ALTER DATABASE LOCAL UNDO ON; SQL> SHUTDOWN IMMEDIATE; SQL> STARTUP;
SQL>COLUMN property_name FORMAT A30 SQL>COLUMN property_value FORMAT A30 SQL>SELECT property_name, property_value FROM database_properties WHERE property_name = 'LOCAL_UNDO_ENABLED'; PROPERTY_NAME PROPERTY_VALUE ------------------------------ ------------------------------ LOCAL_UNDO_ENABLED TRUE
–可以看到Oracle自動為PDB創(chuàng)建了一個undo表空間
SQL>SELECT con_id, tablespace_name FROM cdb_tablespaces WHERE tablespace_name LIKE 'UNDO%' ORDER BY con_id; CON_ID TABLESPACE_NAME ---------- ------------------------------ 1 UNDOTBS1 3 UNDO_1
可以看到新創(chuàng)建的數(shù)據(jù)庫也是運行在本地undo模式上。
SQL>CREATE PLUGGABLE DATABASE pdb2 ADMIN USER pdb_adm IDENTIFIED BY Password1; SQL>ALTER PLUGGABLE DATABASE pdb2 SAVE STATE; SQL>SELECT con_id, tablespace_name FROM cdb_tablespaces WHERE tablespace_name LIKE 'UNDO%' ORDER BY con_id; CON_ID TABLESPACE_NAME ---------- ------------------------------ 1 UNDOTBS1 3 UNDO_1 4 UNDOTBS1
讀到這里,這篇“Oracle本地UNDO模式怎么實現(xiàn)”文章已經(jīng)介紹完畢,想要掌握這篇文章的知識點還需要大家自己動手實踐使用過才能領(lǐng)會,如果想了解更多相關(guān)內(nèi)容的文章,歡迎關(guān)注億速云行業(yè)資訊頻道。
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。