Oracle刪除記錄檔

來源:互聯網
上載者:User

Oracle刪除記錄檔

刪除記錄檔的文法如下:
alter database drop logfile member logfile_name;
刪除記錄檔需要注意如下幾點:
1.該記錄檔所在的的記錄檔組不能處於current狀態,需要執行一次手動日誌切換,將該記錄檔組的狀態修改為inactive
2.該記錄檔所在的記錄檔組中必須包含有其他的日誌成員。
3如果資料庫運行在歸檔模式下,則應該在刪除記錄檔之前,確定它所在的記錄檔組已經被歸檔,否則會導致資料丟失。
記錄檔組的狀態值:
active current inactive unused


Oracle記錄檔的狀態值:
valid invalid stale
 
刪除記錄檔組
文法如下:
later database drop logfile group group_number;
刪除記錄檔組需要注意如下的幾點
1.一個資料庫至少需要兩個記錄檔組。
2.記錄檔組不能處於current狀態。‘
3.如果資料庫運行在歸檔模式下,應該確定該記錄檔已經被歸檔。


SQL> alter database drop logfile member
  2  'f:\oracledata\redo4.log';
以上的sql語句只是將該資料記錄檔在控制檔案和資料字典中刪除,作業系統下並沒有被刪除
資料庫已更改。
如下查詢系統中的資料庫記錄檔組
SQL> select group#,member from v$logfile;
GROUP#                          MEMBER
-------------------------------------------------------------------------------
3                              D:\ORACLE\ORADATA\ORACLE12C\REDO03.LOG
2                              D:\ORACLE\ORADATA\ORACLE12C\REDO02.LOG
1                        D:\ORACLE\ORADATA\ORACLE12C\REDO01.LOG
4                              F:\ORACLEDATA\LOGFILE\REDO1.LOG

4                              F:\ORACLEDATA\LOGFILE\REDO2.LOG

以上內容來自學習的記錄。

相關文章

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.