您好,登錄后才能下訂單哦!
問題1:
使用RMAN copy進行數據文件遷移位置時遇到的問題,(從一個磁盤組遷移到另外一塊磁盤組)
采用如下拼接語句進行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’;
執行時報錯:
ORA-01276: Cannot add file +NEWDATA/rac/system.256.1037590361. File has an Oracle Managed Files file name.
原因:由于數據文件是使用OMF自動文件管理功能創建的數據文件,屬于OMF命名格式,當在ASM中,進行數據文件遷移時,從一個磁盤組遷移到另外一個磁盤組時,會報錯ORA-01276,解決辦法很簡單,就是在使用RMAN COPY的同時并進行重命名,消除OMF命名規則。
修改后的拼接語句如下:
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’;
執行即可不會報錯。
遷移完成后,為了確保數據文件名字與原名字相同,就需要進行兩次重命名,但是最終重命名出來的數據文件僅僅是名字與原數據文件相同,與OMF則無關。
第一次重命名:
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
修改參數中記錄的控制文件信息時要注意修改名字格式。
創建集群時還是不要開啟OMF自動文件管理功能,要么后續遷移DATA盤會比較麻煩。
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。