backup as copy的强大

利用backup as copy将数据库迁移到其他文件系统或者asm环境

oracle@pri ~]$ sqlplus / as sysdba



SQL*Plus: Release 11.2.0.4.0 Production on Sat Dec 10 02:55:25 2016


Copyright (c) 1982, 2013, Oracle.  All rights reserved.




Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options


SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount
ORACLE instance started.


Total System Global Area  304807936 bytes
Fixed Size                  2252744 bytes
Variable Size             167772216 bytes
Database Buffers          130023424 bytes
Redo Buffers                4759552 bytes
Database mounted.


[oracle@pri ~]$ rman target /


Recovery Manager: Release 11.2.0.4.0 - Production on Sat Dec 10 03:02:13 2016


Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.


connected to target database: PRODPRI (DBID=2010738349, not open)


RMAN> backup as copy database format '/oracle/oradata/oradata_%u.dbf';   // backup as copy database format '+data‘


Starting backup at 10-DEC-16
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=19 device type=DISK
channel ORA_DISK_1: starting datafile copy
input datafile file number=00001 name=/u01/app/oradata/prodpri/system01.dbf
output file name=/oracle/oradata/oradata_05rn37ts.dbf tag=TAG20161210T030220 RECID=5 STAMP=930193347
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:15
channel ORA_DISK_1: starting datafile copy
input datafile file number=00002 name=/u01/app/oradata/prodpri/sysaux01.dbf
output file name=/oracle/oradata/oradata_06rn37ub.dbf tag=TAG20161210T030220 RECID=6 STAMP=930193360
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:07
channel ORA_DISK_1: starting datafile copy
input datafile file number=00005 name=/u01/app/oradata/prodpri/example01.dbf
output file name=/oracle/oradata/oradata_07rn37ui.dbf tag=TAG20161210T030220 RECID=7 STAMP=930193365
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03
channel ORA_DISK_1: starting datafile copy
input datafile file number=00003 name=/u01/app/oradata/prodpri/undotbs01.dbf
output file name=/oracle/oradata/oradata_08rn37ul.dbf tag=TAG20161210T030220 RECID=8 STAMP=930193366
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting datafile copy
copying current control file
output file name=/oracle/oradata/oradata_09rn37um.dbf tag=TAG20161210T030220 RECID=9 STAMP=930193367
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03
channel ORA_DISK_1: starting datafile copy
input datafile file number=00004 name=/u01/app/oradata/prodpri/users01.dbf
output file name=/oracle/oradata/oradata_0arn37up.dbf tag=TAG20161210T030220 RECID=10 STAMP=930193369
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 10-DEC-16
channel ORA_DISK_1: finished piece 1 at 10-DEC-16
piece handle=/oracle/oradata/oradata_0brn37ur.dbf tag=TAG20161210T030220 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 10-DEC-16


RMAN> switch database to copy;   (单独的数据文件switch:switch datafile 1 to copy)


datafile 1 switched to datafile copy "/oracle/oradata/oradata_05rn37ts.dbf"
datafile 2 switched to datafile copy "/oracle/oradata/oradata_06rn37ub.dbf"
datafile 3 switched to datafile copy "/oracle/oradata/oradata_08rn37ul.dbf"
datafile 4 switched to datafile copy "/oracle/oradata/oradata_0arn37up.dbf"
datafile 5 switched to datafile copy "/oracle/oradata/oradata_07rn37ui.dbf"


RMAN> alter database open;


database opened


[oracle@pri ~]$ sqlplus / as sysdba


SQL*Plus: Release 11.2.0.4.0 Production on Sat Dec 10 03:04:26 2016


Copyright (c) 1982, 2013, Oracle.  All rights reserved.




Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options


SQL> select name from v$datafile;


NAME
--------------------------------------------------------------------------------
/oracle/oradata/oradata_05rn37ts.dbf
/oracle/oradata/oradata_06rn37ub.dbf
/oracle/oradata/oradata_08rn37ul.dbf
/oracle/oradata/oradata_0arn37up.dbf
/oracle/oradata/oradata_07rn37ui.dbf
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值