Oracle ASM环境下怎么进行数据库冷备


最近被ASM折腾的够呛。昨天碰到一客户,数据库使用的是WIN2008+RAC+ASM。由于EMC存储问题,导致ASM实例出问题,读不出数据,进而导致RAC出问题。折腾了2个小时,终于将ASM实例启动,将RAC转换成单节点。可悲的是,ASM磁盘组读取错误:select 表格出错,exp、expdp出错,rman拷贝出错。赶到客户现场,继续折腾,终于修复错误。回来的路上一直在思考一个问题,在ASM环境下,怎么做数据库的冷备?
一是Oracle提供了文件传输包DBMS_FILE_TRANSFER,用于传输ASM文件至文件系统中。简要步骤如下
1、同一主机下面建另一实例,用于运行DBMS_FILE_TRANSFER
2、在该实例上运行DBMS_FILE_TRANSFER,拷贝数据文件,控制文件,日志文件

引用
CREATE DIRECTORY source_dir AS '+DATADG/ORADATA';
CREATE DIRECTORY dest_dir AS '/tmp';

BEGIN
DBMS_FILE_TRANSFER.COPY_FILE(
source_directory_object => 'source_dir',
source_file_name => 'user01.dbf',
destination_directory_object => 'dest_dir',
destination_file_name => 'user01.dbf');
END;
/

二是使用ASM提供的ftp特性
1、同一主机下面建另一实例,用于传输ftp
2、用ftp传输相关文件

附:DBMS_FILE_TRANSFER使用限制
# The user must have read privilege on the source directory object and write privilege on the destination directory object.
# The procedure converts directory object names to uppercase unless they are surrounded by double quotes.
# Files to be copied must be multiples of 512 bytes in size.
# Files to be copied must be equal to or less than 2 terabytes in size.
# File transfers are not transactional.
# Files are copied as binary, so no character conversions are performed.
# File copies can be monitored using the V$SESSION_LONGOPS view

相关内容