Oracle

Oracle - 日誌文件名中的 MUST_RENAME_THIS_LOGFILE

  • June 11, 2020

我正在data guard從主伺服器創建使用熱備份。在我的還原中,我使用了以下命令進行還原:

run{
set newname for database to '+DADOS';
restore database;
switch datafile all;
switch tempfile all;
recover database;
}

成功還原和恢復後,我的重做日誌文件名稱如下:

select member from v$logfile;

+DADOS/MUST_RENAME_THIS_LOGFILE_1.4294967295.4294967295
+FRA/MOOTDB/ONLINELOG/group_1.287.1040583755
+DADOS/MUST_RENAME_THIS_LOGFILE_2.4294967295.4294967295
+DADOS/MUST_RENAME_THIS_LOGFILE_3.4294967295.4294967295
+FRA/MOOTDB/ONLINELOG/group_3.259.1036639239
+DADOS/MUST_RENAME_THIS_LOGFILE_4.4294967295.4294967295
+FRA/MOOTDB/ONLINELOG/group_2.288.1040583761
+DADOS/MUST_RENAME_THIS_LOGFILE_5.4294967295.4294967295
+FRA/MOOTDB/ONLINELOG/group_5.295.1042634101
+DADOS/MUST_RENAME_THIS_LOGFILE_6.4294967295.4294967295
+FRA/MOOTDB/ONLINELOG/group_6.297.1042634113

為什麼他們有“MUST_RENAME_THIS_LOGFILE_”?不是自動的嗎?

在我的待機中,我正在使用db_log_file_name_convertandlog_file_name_convert

log_file_name_convert = +DATA, +DADOS
db_file_name_convert = +DATA, +DADOS

另一個問題是一些臨時文件只帶有 DG 名稱(見下面的最後一行)。

select name from v$datafile union all select name from v$tempfile;

+DADOS/MOOTSTB/DATAFILE/system.266.1042731967
+DADOS/MOOTSTB/DATAFILE/sysaux.292.1042731967
+DADOS/MOOTSTB/A249914E10CA3494E0532900A8C0EAA4/DATAFILE/system.278.1042732081
+DADOS/MOOTSTB/A249914E10CA3494E0532900A8C0EAA4/DATAFILE/sysaux.296.1042732081
+DADOS/MOOTSTB/DATAFILE/users.309.1042731967
+DADOS/MOOTSTB/A249914E10CA3494E0532900A8C0EAA4/DATAFILE/undotbs1.320.1042732081
+DADOS/MOOTSTB/DATAFILE/undotbs2.283.1042731967
+DADOS/MOOTSTB/A249E748BB047773E0532900A8C02088/DATAFILE/system.257.1042731811
+DADOS/MOOTSTB/A249E748BB047773E0532900A8C02088/DATAFILE/sysaux.284.1042731809
+DADOS/MOOTSTB/A249E748BB047773E0532900A8C02088/DATAFILE/undotbs1.289.1042731811
+DADOS/MOOTSTB/A249E748BB047773E0532900A8C02088/DATAFILE/users.267.1042731811
+DADOS/MOOTSTB/A249E748BB047773E0532900A8C02088/DATAFILE/soe.311.1042731809
+DADOS/MOOTSTB/A249E748BB047773E0532900A8C02088/DATAFILE/teste.308.1042731811
+DADOS/MOOTSTB/A249E748BB047773E0532900A8C02088/DATAFILE/undo_2.304.1042731811
+DADOS/MOOTSTB/DATAFILE/undotbs1.302.1042731967
+DADOS/MOOTSTB/TEMPFILE/temp.319.1042736311
+DADOS/MOOTSTB/A249914E10CA3494E0532900A8C0EAA4/TEMPFILE/temp.318.1042736323
+DADOS  <<<<<< is a tempfile

從備份中恢復 + 恢復不使用線上重做日誌。你的重做日誌只是命名了一些東西,但這些文件還不存在。物理備用數據庫也不使用線上重做日誌(它使用備用重做日誌)。

當第一次需要重做日誌組時,它們將被自動清除(根據 OMF 重命名+創建文件)。就像您READ WRITE在將物理備用數據庫轉換為主數據庫或快照備用數據庫或邏輯備用數據庫後實際以模式打開數據庫一樣。

+FRA/MOOTDB/ONLINELOG/group_1.287.1040583755也是不正確的。此時該文件不存在,並且該文件的位置一旦被清除,將+FRA/MOOTSTB/ONLINELOG/...db_unique_name備用站點上的一樣MOOTSTB。(假設您在那裡有一個 FRA 磁碟組。)

正確設置db_create_file_dest, db_create_online_log_dest_N,db_recovery_file_dest參數後,您可以簡單地手動清除日誌文件組(無論如何都會在需要時自動完成),因此它們將被正確命名和放置:

alter database clear logfile group 1;
alter database clear logfile group 2;
alter database clear logfile group 3;
alter database clear logfile group 4;
alter database clear logfile group 5;
alter database clear logfile group 6;

命名的臨時文件+DADOS也不是問題。掛載階段的物理備用不需要臨時文件。打開數據庫後,臨時文件將自動重命名和創建。

引用自:https://dba.stackexchange.com/questions/268908