将ASM里面的文件copy到文件系统


将ASM里面的文件copy到文件系统

数据文件存放在ASM里面查看不是很直观,有时候需要把文件从ASM里面copy到文件系统。我记录了一下两种方法,还有一种用AMDU,ODU也可以实现

1. 直接在asmcmd里面用cp命令

ASMCMD> ls   
SYSAUX.260.894187589
SYSTEM.259.894187575
UNDOTBS1.261.894187601
UNDOTBS2.263.894187615
USERS.264.894187621
USERS.268.895081225
USERS.269.895582787
USERS.280.898078315


ASMCMD> cp SYSAUX.260.894187589 /home/grid/sysaux.dbf
copying +datadg01/xedb/datafile/SYSAUX.260.894187589 -> /home/grid/sysaux.dbf


[root@rac01test grid]# pwd
/home/grid
You have new mail in /var/spool/mail/root
[root@rac01test grid]# ll
total 1894508
drwxr-xr-x 2 grid oinstall       4096 Oct 23 16:34 Desktop
drwxr-xr-x 2 grid oinstall       4096 Oct 23 16:34 Documents
drwxr-xr-x 2 grid oinstall       4096 Oct 23 16:34 Downloads
-rw-r----- 1 grid oinstall 1939873792 Apr 14 16:18 sysaux.dbf
这里sysaux.dbf就是copy出来的文件

2.用rman copy命令

2.1 rman  copy 归档
copy archivelog '+ARCH_DG/arc1/1_1216_894187568.dbf' to '/tmp/log/1_1216_894187568.dbf';

2.1 rman copy 数据文件

RMAN> copy datafile  '+DATADG01/xedb/datafile/system.259.894187575' to '/home/oracle/system.dbf'

Starting backup at 14-APR-16
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=152 device type=DISK
channel ORA_DISK_1: starting datafile copy
input datafile file number=00003 name=+DATADG01/xedb/datafile/undotbs1.261.894187601
output file name=/home/oracle/system.dbf tag=TAG20160414T171543 RECID=2 STAMP=909162958
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:15
Finished backup at 14-APR-16


[root@rac01test oracle]# ll
-rw-r----- 1 oracle asmadmin 770711552 Apr 14 16:29 system.dbf
这里的system文件就是copy出来的
 

你可能感兴趣的:(ASM到文件系统)