您好,登錄后才能下訂單哦!
問題1:
使用RMAN copy進行數(shù)據(jù)文件遷移位置時遇到的問題,(從一個磁盤組遷移到另外一塊磁盤組)
采用如下拼接語句進行COPY拼接
select ‘copy datafile ‘||’’’’||file_name||’’’’||’ to ‘||’’’’||’+NEWDATA/rac/‘||substr(file_name,instr(file_name,’/‘,-1)+1)||’’’;’ from dba_data_files;
獲得如下sql語句:
copy datafile ‘+DATA/racdb/datafile/users.259.1037590363’ to ‘+NEWDATA/rac/users
.259.1037590363’;
copy datafile ‘+DATA/racdb/datafile/undotbs1.258.1037590363’ to ‘+NEWDATA/rac/un
dotbs1.258.1037590363’;
copy datafile ‘+DATA/racdb/datafile/sysaux.257.1037590363’ to ‘+NEWDATA/rac/sysa
ux.257.1037590363’;
copy datafile ‘+DATA/racdb/datafile/system.256.1037590361’ to ‘+NEWDATA/rac/syst
em.256.1037590361’;
copy datafile ‘+DATA/racdb/datafile/example.264.1037590589’ to ‘+NEWDATA/rac/exa
mple.264.1037590589’;
copy datafile ‘+DATA/racdb/datafile/undotbs2.265.1037591117’ to ‘+NEWDATA/rac/un
dotbs2.265.1037591117’;
執(zhí)行時報錯:
ORA-01276: Cannot add file +NEWDATA/rac/system.256.1037590361. File has an Oracle Managed Files file name.
原因:由于數(shù)據(jù)文件是使用OMF自動文件管理功能創(chuàng)建的數(shù)據(jù)文件,屬于OMF命名格式,當(dāng)在ASM中,進行數(shù)據(jù)文件遷移時,從一個磁盤組遷移到另外一個磁盤組時,會報錯ORA-01276,解決辦法很簡單,就是在使用RMAN COPY的同時并進行重命名,消除OMF命名規(guī)則。
修改后的拼接語句如下:
select ‘copy datafile ‘||’’’’||file_name||’’’’||’ to ‘||’’’’||’+NEWDATA/rac/‘||substr(file_name,instr(file_name,’/‘,-1)+1)||’’’;’ from dba_data_files;
獲得如下SQL:
copy datafile ‘+DATA/racdb/datafile/users.259.1037590363’ to ‘+NEWDATA/rac/users
.259.1037590363.dbf’;
copy datafile ‘+DATA/racdb/datafile/undotbs1.258.1037590363’ to ‘+NEWDATA/rac/un
dotbs1.258.1037590363.dbf’;
copy datafile ‘+DATA/racdb/datafile/sysaux.257.1037590363’ to ‘+NEWDATA/rac/sysa
ux.257.1037590363.dbf’;
copy datafile ‘+DATA/racdb/datafile/system.256.1037590361’ to ‘+NEWDATA/rac/syst
em.256.1037590361.dbf’;
copy datafile ‘+DATA/racdb/datafile/example.264.1037590589’ to ‘+NEWDATA/rac/exa
mple.264.1037590589.dbf’;
copy datafile ‘+DATA/racdb/datafile/undotbs2.265.1037591117’ to ‘+NEWDATA/rac/un
dotbs2.265.1037591117.dbf’;
執(zhí)行即可不會報錯。
遷移完成后,為了確保數(shù)據(jù)文件名字與原名字相同,就需要進行兩次重命名,但是最終重命名出來的數(shù)據(jù)文件僅僅是名字與原數(shù)據(jù)文件相同,與OMF則無關(guān)。
第一次重命名:
alter database rename file ‘+DATA/racdb/datafile/users.259.1037590363’ to ‘+NEWD
ATA/rac/users.259.1037590363.dbf’;
問題2:
遷移控制文件時:
(也是由于OMF)
ASMCMD> cp Current.260.1037590513 +NEWDATA/rac/
copying +DATA/RACDB/CONTROLFILE/Current.260.1037590513 -> +NEWDATA/rac/Current.260.1037590513
ASMCMD-8016: copy source ‘+DATA/RACDB/CONTROLFILE/Current.260.1037590513’ and target ‘+NEWDATA/rac/Current.260.1037590513’ failed
ORA-15056: additional error message
ORA-15046: ASM file name ‘+NEWDATA/rac/Current.260.1037590513’ is not in single-file creation form
ORA-06512: at “SYS.X$DBMS_DISKGROUP”, line 415
ORA-06512: at line 3 (DBD ERROR: OCIStmtExecute)
解決辦法:
ASMCMD> cp Current.260.1037590513 Current01.ctl
copying +DATA/RACDB/CONTROLFILE/Current.260.1037590513 -> +DATA/RACDB/CONTROLFILE/Current01.ctl
ASMCMD> cp Current01.ctl +NEWDATA/rac/
copying +DATA/RACDB/CONTROLFILE/Current01.ctl -> +NEWDATA/rac/Current01.ctl
修改參數(shù)中記錄的控制文件信息時要注意修改名字格式。
創(chuàng)建集群時還是不要開啟OMF自動文件管理功能,要么后續(xù)遷移DATA盤會比較麻煩。
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。