使用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/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/13177610/viewspace-713552/