将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出来的
 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值