本篇文章给大家分享的是有关如何从ASM复制文件到文件系统,小编觉得挺实用的,因此分享给大家学习,希望大家阅读完这篇文章后可以有所收获,话不多说,跟着小编一起来看看吧。

版本10.2.0.5
1、使用RMAN:

$sqlplus"/assysdba"SQL*Plus:Release10.2.0.5.0-ProductiononFriMar1610:02:412012Copyright(c)1982,2010,Oracle.AllRightsReserved.Connectedtoanidleinstance.SQL>startupmount;ORACLEinstancestarted.TotalSystemGlobalArea2147483648bytesFixedSize2097696bytesVariableSize503320032bytesDatabaseBuffers1627389952bytesRedoBuffers14675968bytesDatabasemounted.SQL>selectfile#,name,bytesfromv$datafilewherefile#=5;FILE#NAMEBYTES----------------------------------------------------------------------5+DATA01/dbname/datafile/users.264.730552875524288000$rmantarget/nocatalogRecoveryManager:Release10.2.0.5.0-ProductiononFriMar1610:06:082012Copyright(c)1982,2007,Oracle.Allrightsreserved.connectedtotargetdatabase:dbname(DBID=2555001420,notopen)usingtargetdatabasecontrolfileinsteadofrecoverycatalogRMAN>copydatafile5to'/arch2/users.264.730552875';Startingbackupat16-MAR-12allocatedchannel:ORA_DISK_1channelORA_DISK_1:sid=1624instance=dbname1devtype=DISKchannelORA_DISK_1:startingdatafilecopyinputdatafilefno=00005name=+DATA01/dbname/datafile/users.264.730552875outputfilename=/arch2/users.264.730552875tag=TAG20120316T100622recid=2stamp=778068391channelORA_DISK_1:datafilecopycomplete,elapsedtime:00:00:15Finishedbackupat16-MAR-12RMAN>exitRecoveryManagercomplete.$ls-l/arch2/users.264.730552875-rw-r-----1oracleoinstall524296192Mar1610:06/arch2/users.264.730552875

[@more@]

2、使用dbms_file_transfer包:

SQL>selectopen_modefromv$database;OPEN_MODE----------READWRITESQL>createorreplacedirectorySOURCE_DIR1as'+DATA01/dbname/onlinelog/';Directorycreated.SQL>createorreplacedirectoryORACLE_DESTas'/arch2/';Directorycreated.SQL>SQL>BEGIN2dbms_file_transfer.copy_file(3source_directory_object=>'SOURCE_DIR1',4source_file_name=>'group_1.274.730565825',5destination_directory_object=>'ORACLE_DEST',6destination_file_name=>'group_1.274.730565825'7);8END;9/PL/SQLproceduresuccessfullycompleted.SQL>!ls-l/arch2/group_1.274.730565825-rw-r-----1oracleoinstall524288512Mar1410:49/arch2/group_1.274.730565825

以上就是如何从ASM复制文件到文件系统,小编相信有部分知识点可能是我们日常工作会见到或用到的。希望你能通过这篇文章学到更多知识。更多详情敬请关注亿速云行业资讯频道。