使用dbms_file_transfer從asm中抽取檔案

安佰勝發表於2011-12-19

 

使用dbms_file_transfer從asm中抽取檔案

================================

10g中可以對資料檔案、控制檔案、日誌檔案進行抽取
不能對引數檔案進行抽取

抽取檔案需要建立兩個directory
一個位於asm、一個位於檔案系統

create or replace directory arch_d as '+data2/emrep/archivelog/2011_12_19';
create or replace directory arch_dk as '/oracle/arch';


--複製檔案
BEGIN
dbms_file_transfer.copy_file(source_directory_object =>'arch_d',
               source_file_name => 'thread_1_seq_23.261.770299557',
               destination_directory_object => 'arch_dk',
               destination_file_name => 'thread_1_seq_23.261.770299557');
END;
/


--獲取檔案
BEGIN
dbms_file_transfer.get_file(source_directory_object =>'arch_d',
               source_file_name => 'thread_1_seq_25.262.770299949',
               SOURCE_DATABASE => 'EMREP',
               destination_directory_object => 'arch_dk',
               destination_file_name => 'thread_1_seq_25.262.770299949');
END;
/


--上傳檔案
BEGIN
dbms_file_transfer.put_file(source_directory_object =>'arch_dk',
               source_file_name => 'thread_1_seq_24.260.770299871',
               destination_directory_object => 'arch_d',
               destination_file_name => 'thread_1_seq_24.260.770299871',
               SOURCE_DATABASE => 'EMREP');
END;
/


---------------------

問題

使用dbms_file_transfer對asm中檔案進行傳輸後在asmcmd中刪除檔案就會報錯

ASMCMD [+data2/emrep/archivelog/2011_12_19] > rm -f thread_1_seq_24.260.770299871
ORA-15032: not all alterations performed
ORA-15028: ASM file '+data2/emrep/archivelog/2011_12_19/thread_1_seq_24.260.770299871' not dropped; currently being accessed (DBD ERROR: OCIStmtExecute)
ASMCMD [+data2/emrep/archivelog/2011_12_19] > asmcmd: caught the interrupt signal; exiting

 

處理:
重啟下資料庫,可能是bug


 

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/13177610/viewspace-713552/,如需轉載,請註明出處,否則將追究法律責任。

相關文章