oracle logfile日誌檔案常規操作小記
日誌檔案維護相關資料見下:
----新增日誌檔案組,一個組可包含多個日誌檔案,且大小內容相同
SQL> alter database add logfile group 4 ('d:\oracle11g_64bit\oradata\orcl\redo04
.log') size 200m;
SQL> alter database add logfile group 4 ('d:\oracle11g_64bit\oradata\orcl\redo04
.log') size 200m;
Database altered.
SQL> alter database add logfile group 5 ('d:\oracle11g_64bit\oradata\orcl\redo05
.log') size 200m;
Database altered.
SQL> alter database add logfile group 6 ('d:\oracle11g_64bit\oradata\orcl\redo06
.log') size 200m;
Database altered.
--須先在os上重新命名檔案為目標檔名,爾後執行下述命令,否則掃如下錯誤
SQL> alter database rename file 'd:\oracle11g_64bit\oradata\orcl\redo06.log' to
'd:\oracle11g_64bit\oradata\orcl\redo06_1.log';
alter database rename file 'd:\oracle11g_64bit\oradata\orcl\redo06.log' to 'd:\o
racle11g_64bit\oradata\orcl\redo06_1.log'
*
ERROR at line 1:
ORA-01511: error in renaming log/data files
ORA-01512: error renaming log file D:\ORACLE11G_64BIT\ORADATA\ORCL\REDO06.LOG -
new file d:\oracle11g_64bit\oradata\orcl\redo06_1.log not found
ORA-27041: unable to open file
OSD-04002: ??????
O/S-Error: (OS 2) ????????????????
SQL> alter database rename file 'd:\oracle11g_64bit\oradata\orcl\redo06.log' to
'd:\oracle11g_64bit\oradata\orcl\redo06_1.log';
alter database rename file 'd:\oracle11g_64bit\oradata\orcl\redo06.log' to 'd:\o
racle11g_64bit\oradata\orcl\redo06_1.log'
*
ERROR at line 1:
ORA-01511: error in renaming log/data files
ORA-01512: error renaming log file D:\ORACLE11G_64BIT\ORADATA\ORCL\REDO06.LOG -
new file d:\oracle11g_64bit\oradata\orcl\redo06_1.log not found
ORA-27041: unable to open file
OSD-04002: ??????
O/S-Error: (OS 2) ????????????????
---日誌檔案未在os真正刪除
SQL> alter database drop logfile group 6;
SQL> alter database drop logfile group 6;
Database altered.
--再次佐證日誌檔案未物理刪除
SQL> alter database add logfile group 6 ('d:\oracle11g_64bit\oradata\orcl\redo06
.log') size 200m;
alter database add logfile group 6 ('d:\oracle11g_64bit\oradata\orcl\redo06.log'
) size 200m
*
ERROR at line 1:
ORA-00301: error in adding log file
'd:\oracle11g_64bit\oradata\orcl\redo06.log' - file cannot be created
ORA-27038: created file already exists
OSD-04010: ??? ??, ???????
SQL> alter database add logfile group 6 ('d:\oracle11g_64bit\oradata\orcl\redo06
.log') size 200m;
alter database add logfile group 6 ('d:\oracle11g_64bit\oradata\orcl\redo06.log'
) size 200m
*
ERROR at line 1:
ORA-00301: error in adding log file
'd:\oracle11g_64bit\oradata\orcl\redo06.log' - file cannot be created
ORA-27038: created file already exists
OSD-04010: ???
SQL> alter database add logfile group 6 ('d:\oracle11g_64bit\oradata\orcl\redo06
.log') size 200m;
.log') size 200m;
Database altered.
SQL> alter database rename file 'd:\oracle11g_64bit\oradata\orcl\redo06.log' to
'd:\oracle11g_64bit\oradata\orcl\redo06_1.log';
'd:\oracle11g_64bit\oradata\orcl\redo06_1.log';
Database altered.
---current狀態的檔案不能刪除
SQL> alter database drop logfile group 3;
alter database drop logfile group 3
*
ERROR at line 1:
ORA-01623: log 3 is current log for instance orcl (thread 1) - cannot drop
ORA-00312: online log 3 thread 1: 'D:\ORACLE11G_64BIT\ORADATA\ORCL\REDO03.LOG'
SQL> alter database drop logfile group 3;
alter database drop logfile group 3
*
ERROR at line 1:
ORA-01623: log 3 is current log for instance orcl (thread 1) - cannot drop
ORA-00312: online log 3 thread 1: 'D:\ORACLE11G_64BIT\ORADATA\ORCL\REDO03.LOG'
---因在alert頻見ckpt未完成及不能寫入新日誌,增加日誌組及日誌檔案大小
SQL> select group#,members,archived,bytes/1024/1024 mb,status from v$log;
GROUP# MEMBERS ARCHIV MB STATUS
---------- ---------- ------ ---------- --------------------------------
3 1 NO 50 CURRENT
4 1 YES 200 UNUSED
5 1 YES 200 UNUSED
6 1 YES 200 UNUSED
7 1 YES 200 UNUSED
8 1 YES 200 UNUSED
9 1 YES 200 UNUSED
---------- ---------- ------ ---------- --------------------------------
3 1 NO 50 CURRENT
4 1 YES 200 UNUSED
5 1 YES 200 UNUSED
6 1 YES 200 UNUSED
7 1 YES 200 UNUSED
8 1 YES 200 UNUSED
9 1 YES 200 UNUSED
7 rows selected.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/9240380/viewspace-752259/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 日誌分析常規操作
- 操作日誌記錄(包括輸出至自定義日誌檔案)
- 日誌檔案使用小結(轉)
- oracle歸檔日誌Oracle
- Mysql 事務日誌(Ib_logfile)MySql
- Laravel 指定日誌檔案記錄任意日誌Laravel
- 歸檔oracle alert日誌Oracle
- Oracle歸檔日誌清理Oracle
- Oracle使用備份檔案集恢復歸檔日誌Oracle
- 【Oracle】如何修改資料檔案和日誌檔案的路徑Oracle
- 分析Oracle資料庫日誌檔案(三)EPOracle資料庫
- 分析Oracle資料庫日誌檔案(二)DOOracle資料庫
- 分析Oracle資料庫日誌檔案(一)HBOracle資料庫
- 【Oracle】歸檔日誌管理-設定歸檔日誌路徑以及歸檔日誌冗餘Oracle
- 在Oracle中,如何定時刪除歸檔日誌檔案?Oracle
- springboot使用logback記錄日誌,配置檔案Spring Boot
- Oracle11g redo log 建立、新增、刪除(重做日誌組,重做日誌檔案)Oracle
- oracle DG 日誌傳輸小結Oracle
- 【LOG】Oracle資料庫清理日誌、跟蹤檔案利器Oracle資料庫
- SLF4J記錄日誌&&日誌檔案的滾動策略__SpringBootSpring Boot
- 使用配置檔案方式記錄Python程式日誌Python
- MySQL提升筆記(3)日誌檔案詳解MySql筆記
- 【REDO】Oracle 日誌挖掘,分析歸檔日誌線上日誌主要步驟Oracle
- 【MySQL日誌】MySQL日誌檔案初級管理MySql
- java專案日誌配置檔案Java
- Linux伺服器常見的日誌檔案儲存位置!Linux伺服器
- oracle11G歸檔日誌管理Oracle
- oracle rman備份歸檔日誌需要先切換日誌嗎Oracle
- 記錄一則clear重做日誌檔案的案例
- 捕獲NSLog日誌小記
- 日誌檔案過大清理
- sybase iq日誌檔案管理
- MySQL InnoDB日誌檔案配置MySql
- oracle之 如何 dump logfileOracle
- mysql關於redo事務日誌ib_logfile的理解MySql
- 使用log4j列印異常堆疊到日誌檔案
- Oracle實驗6--掌握Oracle資料庫的日誌操作Oracle資料庫
- oracle dg 歸檔日誌恢復情況Oracle
- oracle 刪除過期的歸檔日誌Oracle