Oracle 10g DG 数据文件迁移的实现

 RMAN list copy of database;List of Datafile CopiesKey File S Completion Time Ckp SCN Ckp Time Name------- ---- - --------------- ---------- --------------- ----13 9 A 05-MAY-18 35309314 05-MAY-18 /datafile/data9.dbf14 10 A 05-MAY-18 35309314 05-MAY-18 /datafile/data10.dbf15 11 A 05-MAY-18 35309314 05-MAY-18 /datafile/datafile11.dbfRMAN delete copy of datafile 9,10,11;allocated channel: ORA_DISK_1channel ORA_DISK_1: sid=146 devtype=DISKList of Datafile CopiesKey File S Completion Time Ckp SCN Ckp Time Name------- ---- - --------------- ---------- --------------- ----13 9 A 05-MAY-18 35309314 05-MAY-18 /datafile/data9.dbf14 10 A 05-MAY-18 35309314 05-MAY-18 /datafile/data10.dbf15 11 A 05-MAY-18 35309314 05-MAY-18 /datafile/datafile11.dbfDo you really want to delete the above objects (enter YES or NO) yesdeleted datafile copydatafile copy filename=/datafile/data9.dbf recid=13 stamp=975320371deleted datafile copydatafile copy filename=/datafile/data10.dbf recid=14 stamp=975320371deleted datafile copydatafile copy filename=/datafile/datafile11.dbf recid=15 stamp=975320371Deleted 3 objects 

结合增量备份提出的备份策略

 SQL select file#, name from v$datafile; FILE# NAME---------- ------------------------------------------------------- 1 /oradata/jy/datafile/system.256.839673875 2 /oradata/jy/datafile/undotbs1.258.839673877 3 /oradata/jy/datafile/sysaux.257.839673877 4 /oradata/jy/datafile/users.259.839673877 5 /oradata/jy/datafile/example.267.839673961 6 /oradata/jy/datafile/undotbs2.268.839674103 7 /oradata/jy/datafile/dbs_d_school.276.840618437 8 /oradata/jy/datafile/dbs_cssf_gt.289.848228741 9 /datafile/dbs_data9.dbf 10 /datafile/dbs_data10.dbf 11 /datafile/dbs_data11.dbf11 rows selected. 

 

编写脚本:

 检查数据库化身

3.备份copy副本到新目录并切换

CATALOG命令帮助表示和编目文件,这儿写文件未在RMAN中记录,因此RMAN并不知道他们。下面的任意事件都可能导致这种情况出现

4.1 删除之前的文件:

 

首先想到的是10gDG是在mount模式下应用的,在测试环境可以很容易的模拟下这个需求实现的过程:

2 文本脚本:保存在普通的文本文件中

3.3 切换数据文件到copy副本:

 在恢复目录中注册数据库

1.查询当前DG的状态 2.停止DG应用 3.备份copy副本到新目录并切换
4.删除之前的目录并开启应用

RMAN> CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/u01/app/oracle/recovery_area/YOON/autobackup/cf_%F';

old RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/u01/app/oracle/recovery_area/YOON/autobackup/2016_12_13/cf_%F';
new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/u01/app/oracle/recovery_area/YOON/autobackup/cf_%F';
new RMAN configuration parameters are successfully stored

RMAN> BACKUP TABLESPACE sysaux;

Starting backup at 13-DEC-16
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00002 name=/u01/app/oracle/oradata/yoon/sysaux01.dbf
channel ORA_DISK_1: starting piece 1 at 13-DEC-16
channel ORA_DISK_1: finished piece 1 at 13-DEC-16
piece handle=/u01/app/oracle/recovery_area/YOON/backupset/2016_12_13/o1_mf_nnndf_TAG20161213T102630_d4yq2pz4_.bkp tag=TAG20161213T102630 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:35
Finished backup at 13-DEC-16

Starting Control File and SPFILE Autobackup at 13-DEC-16
piece handle=/u01/app/oracle/recovery_area/YOON/autobackup/cf_c-781817860-20161213-02 comment=NONE
Finished Control File and SPFILE Autobackup at 13-DEC-16

2.停止DG应用

 

可以看到DG处于正常应用状态。

 备份控制文件

至此,就完成了客户的需求,我们可以多思考一下,如果客户环境是11g的ADG环境呢?会有哪些不同呢?

 备份命令还可以使员工FORMAT来指定备份片和副本的位置和名字们使用替换变量来生成唯一的文件名

后台执行脚本:nohup sh copy_datafile.sh &

1 存储脚本:保存在RMAN恢复目录中

4.删除之前的目录并开启应用

RMAN提供了几个非常有用的报告命令,他们允许检查备份和恢复过程。可查询RMAN,有哪些文件需要备份,哪些文件废弃,从而可以删除

 Connected to:Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit ProductionWith the Partitioning, OLAP, Data Mining and Real Application Testing optionsSQL select name, database_role, open_mode from gv$database;NAME DATABASE_ROLE OPEN_MODE--------- ---------------- ----------JY PHYSICAL STANDBY MOUNTEDSQL select recovery_mode from v$archive_dest_status;RECOVERY_MODE-----------------------MANAGED REAL TIME APPLYIDLEIDLEIDLEIDLEIDLEIDLEIDLEIDLEIDLEIDLE11 rows selected.SQL select * from v$dataguard_stats;NAME VALUE UNIT TIME_COMPUTED---------------------------------- ---------------------------------------------------------------- ------------------------------ ------------------------------apply finish time +00 00:00:00.0 day(2) to second(1) interval 05-MAY-2018 10:04:20apply lag +00 00:00:12 day(2) to second(0) interval 05-MAY-2018 10:04:20estimated startup time 41 second 05-MAY-2018 10:04:20standby has been open N 05-MAY-2018 10:04:20transport lag +00 00:00:00 day(2) to second(0) interval 05-MAY-2018 10:04:20 

 

查看当前的数据文件,确认将9,10,11三个文件迁移回原来的目录:

 

3.2 备份相关数据文件副本:

 

 RMAN list copy of database;using target database control file instead of recovery catalogList of Datafile CopiesKey File S Completion Time Ckp SCN Ckp Time Name------- ---- - --------------- ---------- --------------- ----10 9 A 05-MAY-18 35303533 05-MAY-18 /oradata/jy/datafile/dbs_data9.dbf11 10 A 05-MAY-18 35303533 05-MAY-18 /oradata/jy/datafile/dbs_data10.dbf12 11 A 05-MAY-18 35303533 05-MAY-18 /oradata/jy/datafile/dbs_data11.dbfRMAN switch datafile 9,10,11 to copy;datafile 9 switched to datafile copy "/oradata/jy/datafile/dbs_data9.dbf"datafile 10 switched to datafile copy "/oradata/jy/datafile/dbs_data10.dbf"datafile 11 switched to datafile copy "/oradata/jy/datafile/dbs_data11.dbf" 

备份命令

 =======Begin at : Sat May 5 10:51:24 CST 2018=======Recovery Manager: Release 10.2.0.5.0 - Production on Sat May 5 10:51:24 2018Copyright (c) 1982, 2007, Oracle. All rights reserved.connected to target database: JY (DBID=857123342, not open)RMAN 2 3 4 5 6 7 8 9 10 11 12 13 using target database control file instead of recovery catalogallocated channel: c1channel c1: sid=152 devtype=DISKallocated channel: c2channel c2: sid=159 devtype=DISKallocated channel: c3channel c3: sid=144 devtype=DISKStarting backup at 05-MAY-18channel c1: starting datafile copyinput datafile fno=00009 name=/datafile/dbs_data9.dbfoutput filename=/oradata/jy/datafile/dbs_data9.dbf tag=TAG20180505T105125 recid=22 stamp=975322288channel c1: datafile copy complete, elapsed time: 00:00:03Finished backup at 05-MAY-18Starting backup at 05-MAY-18channel c1: starting datafile copyinput datafile fno=00010 name=/datafile/dbs_data10.dbfoutput filename=/oradata/jy/datafile/dbs_data10.dbf tag=TAG20180505T105129 recid=23 stamp=975322292channel c1: datafile copy complete, elapsed time: 00:00:07Finished backup at 05-MAY-18Starting backup at 05-MAY-18channel c1: starting datafile copyinput datafile fno=00011 name=/datafile/dbs_data11.dbfoutput filename=/oradata/jy/datafile/dbs_data11.dbf tag=TAG20180505T105136 recid=24 stamp=975322315channel c1: datafile copy complete, elapsed time: 00:00:25Finished backup at 05-MAY-18released channel: c1released channel: c2released channel: c3RMANRecovery Manager complete.=======End at : Sat May 5 10:52:02 CST 2018======= 

 

查询当前DG的状态:

RMAN> REGISTER DATABASE;

database registered in recovery catalog
starting full resync of recovery catalog
full resync complete

1.查询当前DG的状态

RMAN> BACKUP INCREMENTAL LEVEL 0 DATABASE;

Starting backup at 09-DEC-16
using channel ORA_DISK_1
channel ORA_DISK_1: starting incremental level 0 datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/u01/app/oracle/oradata/yoon/system01.dbf
input datafile file number=00002 name=/u01/app/oracle/oradata/yoon/sysaux01.dbf
input datafile file number=00003 name=/u01/app/oracle/oradata/yoon/undotbs01.dbf
input datafile file number=00005 name=/u01/app/oracle/oradata/yoon/example01.dbf
input datafile file number=00004 name=/u01/app/oracle/oradata/yoon/users01.dbf
channel ORA_DISK_1: starting piece 1 at 09-DEC-16
channel ORA_DISK_1: finished piece 1 at 09-DEC-16
piece handle=/u01/app/oracle/recovery_area/YOON/backupset/2016_12_09/o1_mf_nnnd0_TAG20161209T113141_d4n9dyty_.bkp tag=TAG20161209T113141 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:45
channel ORA_DISK_1: starting incremental level 0 datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 09-DEC-16
channel ORA_DISK_1: finished piece 1 at 09-DEC-16
piece handle=/u01/app/oracle/recovery_area/YOON/backupset/2016_12_09/o1_mf_ncsn0_TAG20161209T113141_d4n9j87n_.bkp tag=TAG20161209T113141 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 09-DEC-16

停止DG应用:

RMAN> list backup;


List of Backup Sets
===================


BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
8       Full    3.27M      DISK        00:00:01     09-DEC-16      

3.1 确认需要迁移的数据文件

这是我平时摘录的笔记,从管理艺术那本书上摘录出来的,放到这里

背景:某客户Oracle 10g
的DG由于空间不足,之前将部分数据文件迁移到其他目录,如今原目录扩容成功,要将之前迁移的数据文件再次迁移回来。

SWITCH 命令类似于ALTER DATABASE RENAME
 DATAFILE命令,允许用RMAN所做的文件副本替换一个数据文件

环境:Oracle 10.2.0.5 DG 单机

4 代理副本

 SQL alter database recover managed standby database cancel;Database altered. 
[oracle@gzxbi01 backupset]{content}nbsp;rman CATALOG rman/rman

Recovery Manager: Release 11.2.0.1.0 - Production on Tue Dec 13 11:13:59 2016

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

connected to recovery catalog database

RMAN> 
RMAN> connect target yoon

target database Password: 
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
ORA-01005: null password given; logon denied

RMAN> connect target yoon

target database Password: 
connected to target database: YOON (DBID=781817860)
 vi copy_datafile.sh echo "=======Begin at : `date`=======" /tmp/copy_datafile_`date +%Y%m%d`.logrman target / EOF /tmp/copy_datafile_`date +%Y%m%d`.logrun {allocate channel c1 device type disk;allocate channel c2 device type disk;allocate channel c3 device type disk;backup as copy datafile 9 format '/oradata/jy/datafile/dbs_data9.dbf';backup as copy datafile 10 format '/oradata/jy/datafile/dbs_data10.dbf';backup as copy datafile 11 format '/oradata/jy/datafile/dbs_data11.dbf';release channel c1;release channel c2;release channel c3;}EOFecho "=======End at : `date`=======" /tmp/copy_datafile_`date +%Y%m%d`.log 

这里可以查出来

记录的日志如下:

差异备份:备份最近级别为1或级别为0的增量备份后更改的所有块

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持脚本之家。

验证命令:

4.2 开启日志应用:

备份删除

 SQL --recover_std_realSQL alter database recover managed standby database using current logfile disconnect from session;Database altered.SQL set lines 1000SQL select * from v$dataguard_stats;NAME VALUE UNIT TIME_COMPUTED-------------------------------- ---------------------------------------------------------------- ------------------------------ ------------------------------apply finish time +00 00:00:00.0 day(2) to second(1) interval 05-MAY-2018 10:20:56apply lag +00 00:02:00 day(2) to second(0) interval 05-MAY-2018 10:20:56estimated startup time 41 second 05-MAY-2018 10:20:56standby has been open N 05-MAY-2018 10:20:56transport lag +00 00:00:00 day(2) to second(0) interval 05-MAY-2018 10:20:56SQL select recovery_mode from v$archive_dest_status;RECOVERY_MODE-----------------------MANAGED REAL TIME APPLYIDLEIDLEIDLEIDLEIDLEIDLEIDLEIDLEIDLEIDLE11 rows selected. 

备份数据文件

有一些RMAN命令可在仅使用恢复目录时使用。还可以在仅使用恢复目录时使用RMAN存储脚本。如果使用控制文件,要冒某些历史数据被覆盖的风险,但恢复目录将保障这些数据的安全,这是因为控制文件与备份有关的活动分配的空间有限,从而恢复目录有更多的空间存储备份历史。系统中的一个恢复目录可对多个Oracle数据库执行备份、复原和恢复活动.Oracle建议使用专门的数据库来运行恢复目录

SQL>RUN{
ALLOCATE CHANNEL c1 DEVICE TYPE DISK
PARMS='ENV=(NSR_GROUP=default)';
BACKUP DATAFILE 1;
}

allocated channel: c1
channel c1: SID=200 device type=DISK

Starting backup at 09-DEC-16
channel c1: starting full datafile backup set
channel c1: specifying datafile(s) in backup set
input datafile file number=00001 name=/u01/app/oracle/oradata/yoon/system01.dbf
channel c1: starting piece 1 at 09-DEC-16
channel c1: finished piece 1 at 09-DEC-16
piece handle=/u01/app/oracle/recovery_area/YOON/backupset/2016_12_09/o1_mf_nnndf_TAG20161209T135641_d4nkwsns_.bkp tag=TAG20161209T135641 comment=NONE
channel c1: backup set complete, elapsed time: 00:00:25
channel c1: starting full datafile backup set
channel c1: specifying datafile(s) in backup set
including current control file in backup set
including current SPFILE in backup set
channel c1: starting piece 1 at 09-DEC-16
channel c1: finished piece 1 at 09-DEC-16
piece handle=/u01/app/oracle/recovery_area/YOON/backupset/2016_12_09/o1_mf_ncsnf_TAG20161209T135641_d4nkxmok_.bkp tag=TAG20161209T135641 comment=NONE
channel c1: backup set complete, elapsed time: 00:00:01
Finished backup at 09-DEC-16
released channel: c1

注:在使用RMAN中,有三个实体是可选的:闪回恢复区
恢复目录数据库和介质管理软件

RMAN还可以使用利用非RMAN操作系统应用程序做的副本,这些类型的副本称为用户管理的副本或操作系统副本

RMAN> RESYNC CATALOG;

starting full resync of recovery catalog
full resync complete

 

 现在,如果使用任何备份命令,控制文件和SPFILE两者都会自动备份

LIST COPY:相当于LIST BACKUP,显示利用RMAN做的所有副本的列表

在此情况下,每天的级别为1的累积备份将备份自星期天备份以来更改的所有块。因此,如果星期四需要恢复,只需要将头天晚上的为一个累积备份应用到星期天的级别为0的增量备份即可

RMAN> BACKUP DATABASE;

Starting backup at 09-DEC-16
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=200 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/u01/app/oracle/oradata/yoon/system01.dbf
input datafile file number=00002 name=/u01/app/oracle/oradata/yoon/sysaux01.dbf
input datafile file number=00003 name=/u01/app/oracle/oradata/yoon/undotbs01.dbf
input datafile file number=00005 name=/u01/app/oracle/oradata/yoon/example01.dbf
input datafile file number=00004 name=/u01/app/oracle/oradata/yoon/users01.dbf
channel ORA_DISK_1: starting piece 1 at 09-DEC-16
channel ORA_DISK_1: finished piece 1 at 09-DEC-16
piece handle=/u01/app/oracle/recovery_area/YOON/backupset/2016_12_09/o1_mf_nnndf_TAG20161209T104834_d4n6w3lm_.bkp tag=TAG20161209T104834 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:02:16
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 09-DEC-16
channel ORA_DISK_1: finished piece 1 at 09-DEC-16
piece handle=/u01/app/oracle/recovery_area/YOON/backupset/2016_12_09/o1_mf_ncsnf_TAG20161209T104834_d4n70cdv_.bkp tag=TAG20161209T104834 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 09-DEC-16

RMAN> BACKUP TABLESPACE users;
Starting backup at 09-DEC-16
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00004 name=/u01/app/oracle/oradata/yoon/users01.dbf
channel ORA_DISK_1: starting piece 1 at 09-DEC-16
channel ORA_DISK_1: finished piece 1 at 09-DEC-16
piece handle=/u01/app/oracle/recovery_area/YOON/backupset/2016_12_09/o1_mf_nnndf_TAG20161209T105136_d4n71s00_.bkp tag=TAG20161209T105136 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 09-DEC-16
RMAN> BACKUP DATAFILE '/u01/app/oracle/oradata/yoon/users01.dbf';

Starting backup at 09-DEC-16
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00004 name=/u01/app/oracle/oradata/yoon/users01.dbf
channel ORA_DISK_1: starting piece 1 at 09-DEC-16
channel ORA_DISK_1: finished piece 1 at 09-DEC-16
piece handle=/u01/app/oracle/recovery_area/YOON/backupset/2016_12_09/o1_mf_nnndf_TAG20161209T105248_d4n7412s_.bkp tag=TAG20161209T105248 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 09-DEC-16

 RMAN备份的例子

RMAN> BACKUP AS COPY DATAFILE 1;

Starting backup at 09-DEC-16
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=200 device type=DISK
channel ORA_DISK_1: starting datafile copy
input datafile file number=00001 name=/u01/app/oracle/oradata/yoon/system01.dbf
output file name=/u01/app/oracle/recovery_area/YOON/datafile/o1_mf_system_d4nln51m_.dbf tag=TAG20161209T140908 RECID=11 STAMP=930146971
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:25
channel ORA_DISK_1: starting datafile copy
copying current control file
output file name=/u01/app/oracle/recovery_area/YOON/controlfile/o1_mf_TAG20161209T140908_d4nlnxq6_.ctl tag=TAG20161209T140908 RECID=12 STAMP=930146974
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03
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 09-DEC-16
channel ORA_DISK_1: finished piece 1 at 09-DEC-16
piece handle=/u01/app/oracle/recovery_area/YOON/backupset/2016_12_09/o1_mf_nnsnf_TAG20161209T140908_d4nlo0x7_.bkp tag=TAG20161209T140908 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 09-DEC-16

-- 使用旧的COPY命令
RMAN> COPY DATAFILE 1 TO '/tmp/test.copy';

Starting backup at 09-DEC-16
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
input datafile file number=00001 name=/u01/app/oracle/oradata/yoon/system01.dbf
output file name=/tmp/test.copy tag=TAG20161209T141120 RECID=13 STAMP=930147105
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:25
Finished backup at 09-DEC-16

开始一个级别为0的备份,

 

RMAN脚本,提供了两种脚本:

RMAN配置参数

有几个设计控制文件备份的参数,

SQL>BACKUP FORMAT='AL_%d/%t/%s/%p' ARCHIVELOG LIKE '%arc_dest%';
RMAN> BACKUP CURRENT CONTROLFILE;

Starting backup at 13-DEC-16
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=13 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
channel ORA_DISK_1: starting piece 1 at 13-DEC-16
channel ORA_DISK_1: finished piece 1 at 13-DEC-16
piece handle=/u01/app/oracle/recovery_area/YOON/backupset/2016_12_13/o1_mf_ncnnf_TAG20161213T144453_d4z676f5_.bkp tag=TAG20161213T144453 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 13-DEC-16

Starting Control File and SPFILE Autobackup at 13-DEC-16
piece handle=/u01/app/oracle/recovery_area/YOON/autobackup/cf_c-781817860-20161213-0a comment=NONE
Finished Control File and SPFILE Autobackup at 13-DEC-16

 

提供了两种类型

RMAN> CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 14 DAYS;

using target database control file instead of recovery catalog
old RMAN configuration parameters:
CONFIGURE RETENTION POLICY TO REDUNDANCY 2;
new RMAN configuration parameters:
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 14 DAYS;
new RMAN configuration parameters are successfully stored

1 备份片

备份优化

RMAN> BACKUP DATABASE TAG='weekly_backup';

Starting backup at 09-DEC-16
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/u01/app/oracle/oradata/yoon/system01.dbf
input datafile file number=00002 name=/u01/app/oracle/oradata/yoon/sysaux01.dbf
input datafile file number=00003 name=/u01/app/oracle/oradata/yoon/undotbs01.dbf
input datafile file number=00005 name=/u01/app/oracle/oradata/yoon/example01.dbf
input datafile file number=00004 name=/u01/app/oracle/oradata/yoon/users01.dbf
channel ORA_DISK_1: starting piece 1 at 09-DEC-16
channel ORA_DISK_1: finished piece 1 at 09-DEC-16
piece handle=/u01/app/oracle/recovery_area/YOON/backupset/2016_12_09/o1_mf_nnndf_WEEKLY_BACKUP_d4n89gvn_.bkp tag=WEEKLY_BACKUP comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:45
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 09-DEC-16
channel ORA_DISK_1: finished piece 1 at 09-DEC-16
piece handle=/u01/app/oracle/recovery_area/YOON/backupset/2016_12_09/o1_mf_ncsnf_WEEKLY_BACKUP_d4n8drs0_.bkp tag=WEEKLY_BACKUP comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
Finished backup at 09-DEC-16

 删除恢复目录

在每次执行备份或恢复时,BACKUP和COPY命令将自动执行重新同步,但是有两种情况,可能需要手动同步,目标数据库刚尽心改了许多物理备份,以及目标数据库在备份之间进行了大量的日志交换

RMAN> BACKUP AS COPY DATABASE;

Starting backup at 09-DEC-16
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
input datafile file number=00001 name=/u01/app/oracle/oradata/yoon/system01.dbf
output file name=/u01/app/oracle/recovery_area/YOON/datafile/o1_mf_system_d4n7orl8_.dbf tag=TAG20161209T110216 RECID=3 STAMP=930135794
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:01:05
channel ORA_DISK_1: starting datafile copy
input datafile file number=00002 name=/u01/app/oracle/oradata/yoon/sysaux01.dbf
output file name=/u01/app/oracle/recovery_area/YOON/datafile/o1_mf_sysaux_d4n7qwjt_.dbf tag=TAG20161209T110216 RECID=4 STAMP=930135854
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:55
channel ORA_DISK_1: starting datafile copy
input datafile file number=00003 name=/u01/app/oracle/oradata/yoon/undotbs01.dbf
output file name=/u01/app/oracle/recovery_area/YOON/datafile/o1_mf_undotbs1_d4n7sk41_.dbf tag=TAG20161209T110216 RECID=5 STAMP=930135865
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:15
channel ORA_DISK_1: starting datafile copy
input datafile file number=00005 name=/u01/app/oracle/oradata/yoon/example01.dbf
output file name=/u01/app/oracle/recovery_area/YOON/datafile/o1_mf_example_d4n7t08c_.dbf tag=TAG20161209T110216 RECID=6 STAMP=930135881
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:15
channel ORA_DISK_1: starting datafile copy
copying current control file
output file name=/u01/app/oracle/recovery_area/YOON/controlfile/o1_mf_TAG20161209T110216_d4n7thbt_.ctl tag=TAG20161209T110216 RECID=7 STAMP=930135888
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/oracle/oradata/yoon/users01.dbf
output file name=/u01/app/oracle/recovery_area/YOON/datafile/o1_mf_users_d4n7tllf_.dbf tag=TAG20161209T110216 RECID=8 STAMP=930135890
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 09-DEC-16
channel ORA_DISK_1: finished piece 1 at 09-DEC-16
piece handle=/u01/app/oracle/recovery_area/YOON/backupset/2016_12_09/o1_mf_nnsnf_TAG20161209T110216_d4n7tmsz_.bkp tag=TAG20161209T110216 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 09-DEC-16
RMAN> BACKUP AS COPY TABLESPACE USERS;

Starting backup at 09-DEC-16
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
input datafile file number=00004 name=/u01/app/oracle/oradata/yoon/users01.dbf
output file name=/u01/app/oracle/recovery_area/YOON/datafile/o1_mf_users_d4n7xwgq_.dbf tag=TAG20161209T110636 RECID=9 STAMP=930135997
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 09-DEC-16

RMAN> BACKUP AS COPY DATAFILE '/u01/app/oracle/oradata/yoon/users01.dbf';

Starting backup at 09-DEC-16
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
input datafile file number=00004 name=/u01/app/oracle/oradata/yoon/users01.dbf
output file name=/u01/app/oracle/recovery_area/YOON/datafile/o1_mf_users_d4n7ym0w_.dbf tag=TAG20161209T110658 RECID=10 STAMP=930136019
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:02
Finished backup at 09-DEC-16

 

累计备份:备份最近级别为0的增量备份后更改的所有块

列表命令

 标记全数据库备份

在备份过程中使用关键字LOGICAL让RMAN对备份文件进行逻辑检查。

DELETE OBSOLETE命令将删除所有不在需要的备份,可以定期执行DELETE
OBSOLETE删除所有废弃的备份。

 

 

RMAN> DELETE ARCHIVELOG ALL BACKED UP 2 TIMES TO DEVICE TYPE DISK;

released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=200 device type=DISK
RMAN-08138: WARNING: archived log not deleted - must create more backups
archived log file name=/u01/oradata/archive_bak/1_67_929897742.dbf thread=1 sequence=67
RMAN-08138: WARNING: archived log not deleted - must create more backups
archived log file name=/u01/oradata/archive_bak/1_68_929897742.dbf thread=1 sequence=68
RMAN-08138: WARNING: archived log not deleted - must create more backups
archived log file name=/u01/oradata/archive_bak/1_69_929897742.dbf thread=1 sequence=69
RMAN-08138: WARNING: archived log not deleted - must create more backups
archived log file name=/u01/oradata/archive_bak/1_70_929897742.dbf thread=1 sequence=70
RMAN-08138: WARNING: archived log not deleted - must create more backups
archived log file name=/u01/oradata/archive_bak/1_71_929897742.dbf thread=1 sequence=71
RMAN-08138: WARNING: archived log not deleted - must create more backups
archived log file name=/u01/oradata/archive_bak/1_72_929897742.dbf thread=1 sequence=72
RMAN-08138: WARNING: archived log not deleted - must create more backups
archived log file name=/u01/oradata/archive_bak/1_73_929897742.dbf thread=1 sequence=73
RMAN-08138: WARNING: archived log not deleted - must create more backups
archived log file name=/u01/oradata/archive_bak/1_74_929897742.dbf thread=1 sequence=74
RMAN-08138: WARNING: archived log not deleted - must create more backups
archived log file name=/u01/oradata/archive_bak/1_75_929897742.dbf thread=1 sequence=75
RMAN-08138: WARNING: archived log not deleted - must create more backups
archived log file name=/u01/oradata/archive_bak/1_76_929897742.dbf thread=1 sequence=76
RMAN> BACKUP INCREMENTAL LEVEL 1 DATABASE;

Starting backup at 09-DEC-16
using channel ORA_DISK_1
channel ORA_DISK_1: starting incremental level 1 datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/u01/app/oracle/oradata/yoon/system01.dbf
input datafile file number=00002 name=/u01/app/oracle/oradata/yoon/sysaux01.dbf
input datafile file number=00003 name=/u01/app/oracle/oradata/yoon/undotbs01.dbf
input datafile file number=00005 name=/u01/app/oracle/oradata/yoon/example01.dbf
input datafile file number=00004 name=/u01/app/oracle/oradata/yoon/users01.dbf
channel ORA_DISK_1: starting piece 1 at 09-DEC-16
channel ORA_DISK_1: finished piece 1 at 09-DEC-16
piece handle=/u01/app/oracle/recovery_area/YOON/backupset/2016_12_09/o1_mf_nnnd1_TAG20161209T113421_d4n9kxs2_.bkp tag=TAG20161209T113421 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:25
channel ORA_DISK_1: starting incremental level 1 datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 09-DEC-16
channel ORA_DISK_1: finished piece 1 at 09-DEC-16
piece handle=/u01/app/oracle/recovery_area/YOON/backupset/2016_12_09/o1_mf_ncsn1_TAG20161209T113421_d4n9lqj6_.bkp tag=TAG20161209T113421 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 09-DEC-16
还可以执行一种叫代理副本的特殊备份,其中介质管理器得到复制进程的控制权,对磁盘不能使用代理副本。
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP ON;

new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters are successfully stored
数据文件备份集合副本
归档重做日志副本和备份集
表空间和数据文件信息
存储脚本和RMAN配置设置

 

RMAN备份逻辑检查

RMAN的信息首先写入到控制文件,然后在写到恢复目录(如果存在)

 用脚本执行联机备份

目录报告

一个操作系统文件 包含一个数据文件、一个控制文件或数个归档重做日志文件的备份,备份信息以RMAN专门格式存储

RMAN命令

数据文件副本

RMAN> BACKUP DATABASE PLUS ARCHIVELOG;


Starting backup at 13-DEC-16
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=67 RECID=141 STAMP=930002431
input archived log thread=1 sequence=68 RECID=143 STAMP=930003123
input archived log thread=1 sequence=69 RECID=145 STAMP=930016837
input archived log thread=1 sequence=70 RECID=147 STAMP=930038442
input archived log thread=1 sequence=71 RECID=149 STAMP=930060057
input archived log thread=1 sequence=72 RECID=151 STAMP=930078067
input archived log thread=1 sequence=73 RECID=153 STAMP=930088842
input archived log thread=1 sequence=74 RECID=155 STAMP=930099902
input archived log thread=1 sequence=75 RECID=157 STAMP=930121228
input archived log thread=1 sequence=76 RECID=159 STAMP=930142615
input archived log thread=1 sequence=77 RECID=161 STAMP=930160254
input archived log thread=1 sequence=78 RECID=163 STAMP=930175228
input archived log thread=1 sequence=79 RECID=165 STAMP=930182421
input archived log thread=1 sequence=80 RECID=167 STAMP=930203266
input archived log thread=1 sequence=81 RECID=169 STAMP=930211579
input archived log thread=1 sequence=82 RECID=171 STAMP=930225529
input archived log thread=1 sequence=83 RECID=173 STAMP=930236428
input archived log thread=1 sequence=84 RECID=175 STAMP=930248459
input archived log thread=1 sequence=85 RECID=177 STAMP=930262535
input archived log thread=1 sequence=86 RECID=179 STAMP=930279663
input archived log thread=1 sequence=87 RECID=181 STAMP=930290431
input archived log thread=1 sequence=88 RECID=183 STAMP=930305189
input archived log thread=1 sequence=89 RECID=185 STAMP=930320950
input archived log thread=1 sequence=90 RECID=187 STAMP=930334014
input archived log thread=1 sequence=91 RECID=189 STAMP=930348429
input archived log thread=1 sequence=92 RECID=191 STAMP=930364903
input archived log thread=1 sequence=93 RECID=193 STAMP=930385632
input archived log thread=1 sequence=94 RECID=195 STAMP=930406626
input archived log thread=1 sequence=95 RECID=197 STAMP=930424789
input archived log thread=1 sequence=96 RECID=199 STAMP=930434440
input archived log thread=1 sequence=97 RECID=201 STAMP=930448841
input archived log thread=1 sequence=98 RECID=203 STAMP=930469306
input archived log thread=1 sequence=99 RECID=205 STAMP=930482166
input archived log thread=1 sequence=100 RECID=207 STAMP=930482728
input archived log thread=1 sequence=101 RECID=209 STAMP=930483779
channel ORA_DISK_1: starting piece 1 at 13-DEC-16
channel ORA_DISK_1: finished piece 1 at 13-DEC-16
piece handle=/u01/app/oracle/recovery_area/YOON/backupset/2016_12_13/o1_mf_annnn_TAG20161213T114259_d4yvl4gn_.bkp tag=TAG20161213T114259 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:02:05
Finished backup at 13-DEC-16

Starting backup at 13-DEC-16
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00006 name=/u01/app/oracle/oradata/yoon/rman_tbsp.dbf
input datafile file number=00001 name=/u01/app/oracle/oradata/yoon/system01.dbf
input datafile file number=00002 name=/u01/app/oracle/oradata/yoon/sysaux01.dbf
input datafile file number=00003 name=/u01/app/oracle/oradata/yoon/undotbs01.dbf
input datafile file number=00005 name=/u01/app/oracle/oradata/yoon/example01.dbf
input datafile file number=00004 name=/u01/app/oracle/oradata/yoon/users01.dbf
channel ORA_DISK_1: starting piece 1 at 13-DEC-16
channel ORA_DISK_1: finished piece 1 at 13-DEC-16
piece handle=/u01/app/oracle/recovery_area/YOON/backupset/2016_12_13/o1_mf_nnndf_TAG20161213T114505_d4yvp467_.bkp tag=TAG20161213T114505 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:56
Finished backup at 13-DEC-16

Starting backup at 13-DEC-16
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=102 RECID=211 STAMP=930484028
channel ORA_DISK_1: starting piece 1 at 13-DEC-16
channel ORA_DISK_1: finished piece 1 at 13-DEC-16
piece handle=/u01/app/oracle/recovery_area/YOON/backupset/2016_12_13/o1_mf_annnn_TAG20161213T114709_d4yvsx85_.bkp tag=TAG20161213T114709 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 13-DEC-16

Starting Control File and SPFILE Autobackup at 13-DEC-16
piece handle=/u01/app/oracle/recovery_area/YOON/autobackup/cf_c-781817860-20161213-05 comment=NONE
Finished Control File and SPFILE Autobackup at 13-DEC-16
RMAN> BACKUP TABLESPACE USERS;

Starting backup at 13-DEC-16
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00004 name=/u01/app/oracle/oradata/yoon/users01.dbf
channel ORA_DISK_1: starting piece 1 at 13-DEC-16
channel ORA_DISK_1: finished piece 1 at 13-DEC-16
piece handle=/u01/app/oracle/recovery_area/YOON/backupset/2016_12_13/o1_mf_nnndf_TAG20161213T144643_d4z6bmlx_.bkp tag=TAG20161213T144643 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 13-DEC-16

Starting Control File and SPFILE Autobackup at 13-DEC-16
piece handle=/u01/app/oracle/recovery_area/YOON/autobackup/cf_c-781817860-20161213-0b comment=NONE
Finished Control File and SPFILE Autobackup at 13-DEC-16

1:首先有一个基本的级别为0的备份

RMAN> DROP CATALOG;

recovery catalog owner is RMAN
enter DROP CATALOG command again to confirm catalog removal

RMAN> DROP CATALOG;

recovery catalog dropped

如果希望之星一个PITR到某个比最近备份更早的时间。归档的备份是有用的。如果当前备份不能使用,还有一个备选的备份集可用

BACKUP
OPTIMIZATION保证。如果RMAN已经备份了某个文件的相同版本,则不会进行该文件的备份。

 备份表空间

SQL>RUN{
ALLOCATE CHANNEL d1 TYPE DISK;
ALLOCATE CHANNEL d2 TYPE DISK;
ALLOCATE CHANNEL d3 TYPE DISK;
BACKUP TAG whole_database_open FORMAT '/u01/app/oracle/recovery_area/backups/db_%t_%s_p%p' DATABASE;
SQL 'alter system archive log current';
BACKUP ARCHIVELOG ALL FORMAT '/u01/app/oracle/recovery_area/backups/al_%t_%s_p%p';
BACKUP CURRENT CONTROLFILE TAG = cf1 FORMAT '/u01/app/oracle/recovery_area/backups/cf_%t_%s_p%p';
RELEASE channel d1;
RELEASE channel d2;
RELEASE channel d3;
}

allocated channel: d1
channel d1: SID=13 device type=DISK

allocated channel: d2
channel d2: SID=76 device type=DISK

allocated channel: d3
channel d3: SID=137 device type=DISK

Starting backup at 13-DEC-16
channel d1: starting full datafile backup set
channel d1: specifying datafile(s) in backup set
input datafile file number=00006 name=/u01/app/oracle/oradata/yoon/rman_tbsp.dbf
input datafile file number=00004 name=/u01/app/oracle/oradata/yoon/users01.dbf
channel d1: starting piece 1 at 13-DEC-16
channel d2: starting full datafile backup set
channel d2: specifying datafile(s) in backup set
input datafile file number=00001 name=/u01/app/oracle/oradata/yoon/system01.dbf
input datafile file number=00005 name=/u01/app/oracle/oradata/yoon/example01.dbf
channel d2: starting piece 1 at 13-DEC-16
channel d3: starting full datafile backup set
channel d3: specifying datafile(s) in backup set
input datafile file number=00002 name=/u01/app/oracle/oradata/yoon/sysaux01.dbf
input datafile file number=00003 name=/u01/app/oracle/oradata/yoon/undotbs01.dbf
channel d3: starting piece 1 at 13-DEC-16
channel d1: finished piece 1 at 13-DEC-16
piece handle=/u01/app/oracle/recovery_area/backups/db_930494182_54_p1 tag=WHOLE_DATABASE_OPEN comment=NONE
channel d1: backup set complete, elapsed time: 00:00:04
channel d2: finished piece 1 at 13-DEC-16
piece handle=/u01/app/oracle/recovery_area/backups/db_930494182_55_p1 tag=WHOLE_DATABASE_OPEN comment=NONE
channel d2: backup set complete, elapsed time: 00:01:46
channel d3: finished piece 1 at 13-DEC-16
piece handle=/u01/app/oracle/recovery_area/backups/db_930494183_56_p1 tag=WHOLE_DATABASE_OPEN comment=NONE
channel d3: backup set complete, elapsed time: 00:01:45
Finished backup at 13-DEC-16

Starting Control File and SPFILE Autobackup at 13-DEC-16
piece handle=/u01/app/oracle/recovery_area/YOON/autobackup/cf_c-781817860-20161213-08 comment=NONE
Finished Control File and SPFILE Autobackup at 13-DEC-16

sql statement: alter system archive log current

Starting backup at 13-DEC-16
current log archived
channel d1: starting archived log backup set
channel d1: specifying archived log(s) in backup set
input archived log thread=1 sequence=67 RECID=141 STAMP=930002431
input archived log thread=1 sequence=68 RECID=143 STAMP=930003123
input archived log thread=1 sequence=69 RECID=145 STAMP=930016837
input archived log thread=1 sequence=70 RECID=147 STAMP=930038442
input archived log thread=1 sequence=71 RECID=149 STAMP=930060057
input archived log thread=1 sequence=72 RECID=151 STAMP=930078067
input archived log thread=1 sequence=73 RECID=153 STAMP=930088842
input archived log thread=1 sequence=74 RECID=155 STAMP=930099902
input archived log thread=1 sequence=75 RECID=157 STAMP=930121228
input archived log thread=1 sequence=76 RECID=159 STAMP=930142615
input archived log thread=1 sequence=77 RECID=161 STAMP=930160254
input archived log thread=1 sequence=78 RECID=163 STAMP=930175228
channel d1: starting piece 1 at 13-DEC-16
channel d2: starting archived log backup set
channel d2: specifying archived log(s) in backup set
input archived log thread=1 sequence=79 RECID=165 STAMP=930182421
input archived log thread=1 sequence=80 RECID=167 STAMP=930203266
input archived log thread=1 sequence=81 RECID=169 STAMP=930211579
input archived log thread=1 sequence=82 RECID=171 STAMP=930225529
input archived log thread=1 sequence=83 RECID=173 STAMP=930236428
input archived log thread=1 sequence=84 RECID=175 STAMP=930248459
input archived log thread=1 sequence=85 RECID=177 STAMP=930262535
input archived log thread=1 sequence=86 RECID=179 STAMP=930279663
input archived log thread=1 sequence=87 RECID=181 STAMP=930290431
input archived log thread=1 sequence=88 RECID=183 STAMP=930305189
input archived log thread=1 sequence=89 RECID=185 STAMP=930320950
input archived log thread=1 sequence=90 RECID=187 STAMP=930334014
channel d2: starting piece 1 at 13-DEC-16
channel d3: starting archived log backup set
channel d3: specifying archived log(s) in backup set
input archived log thread=1 sequence=91 RECID=189 STAMP=930348429
input archived log thread=1 sequence=92 RECID=191 STAMP=930364903
input archived log thread=1 sequence=93 RECID=193 STAMP=930385632
input archived log thread=1 sequence=94 RECID=195 STAMP=930406626
input archived log thread=1 sequence=95 RECID=197 STAMP=930424789
input archived log thread=1 sequence=96 RECID=199 STAMP=930434440
input archived log thread=1 sequence=97 RECID=201 STAMP=930448841
input archived log thread=1 sequence=98 RECID=203 STAMP=930469306
input archived log thread=1 sequence=99 RECID=205 STAMP=930482166
input archived log thread=1 sequence=100 RECID=207 STAMP=930482728
input archived log thread=1 sequence=101 RECID=209 STAMP=930483779
input archived log thread=1 sequence=102 RECID=211 STAMP=930484028
input archived log thread=1 sequence=103 RECID=213 STAMP=930493890
input archived log thread=1 sequence=104 RECID=215 STAMP=930493896
channel d3: starting piece 1 at 13-DEC-16
channel d1: finished piece 1 at 13-DEC-16
piece handle=/u01/app/oracle/recovery_area/backups/al_930494306_58_p1 tag=TAG20161213T143826 comment=NONE
channel d1: backup set complete, elapsed time: 00:02:16
channel d1: starting archived log backup set
channel d1: specifying archived log(s) in backup set
input archived log thread=1 sequence=105 RECID=217 STAMP=930494299
input archived log thread=1 sequence=106 RECID=219 STAMP=930494305
channel d1: starting piece 1 at 13-DEC-16
channel d2: finished piece 1 at 13-DEC-16
piece handle=/u01/app/oracle/recovery_area/backups/al_930494306_59_p1 tag=TAG20161213T143826 comment=NONE
channel d2: backup set complete, elapsed time: 00:02:16
channel d3: finished piece 1 at 13-DEC-16
piece handle=/u01/app/oracle/recovery_area/backups/al_930494307_60_p1 tag=TAG20161213T143826 comment=NONE
channel d3: backup set complete, elapsed time: 00:02:15
channel d1: finished piece 1 at 13-DEC-16
piece handle=/u01/app/oracle/recovery_area/backups/al_930494442_61_p1 tag=TAG20161213T143826 comment=NONE
channel d1: backup set complete, elapsed time: 00:00:01
Finished backup at 13-DEC-16

Starting backup at 13-DEC-16
channel d1: starting full datafile backup set
channel d1: specifying datafile(s) in backup set
including current control file in backup set
channel d1: starting piece 1 at 13-DEC-16
channel d1: finished piece 1 at 13-DEC-16
piece handle=/u01/app/oracle/recovery_area/backups/cf_930494444_62_p1 tag=CF1 comment=NONE
channel d1: backup set complete, elapsed time: 00:00:03
Finished backup at 13-DEC-16

Starting Control File and SPFILE Autobackup at 13-DEC-16
piece handle=/u01/app/oracle/recovery_area/YOON/autobackup/cf_c-781817860-20161213-09 comment=NONE
Finished Control File and SPFILE Autobackup at 13-DEC-16

released channel: d1

released channel: d2

released channel: d3

 

1 增量备份
2 可联机修补数据文件的部分讹误数据块,不需要从备份文件复原文件 称为介质恢复
3 人为错误最小化
4 一条简单命令 BACKUP DATABASE即可
5 RMAN新的快比较特性允许在备份中跳过数据文件中从未使用的数据块备份,节省存储空间和备份时间
6 通过RMAN容易进行自动化备份和恢复
7 在备份和恢复中可 进行错误检查
8 RMAN在联机备份中不生成重做信息,降低联机备份开销
9 二进制压缩特性降低保存磁盘上备份的大小
10 使用恢复目录catelog可直接在其中的存储备份和恢复脚本
11 RMAN 可执行模拟备份和恢复
12 允许进行映像复制,类似操作系统的文件备份
13 RMAN与第三方介质管理产品集成,使磁带备份极为容易
14 RMAN与OEM集成的很好
15 可利用RMAN功能方便克隆数据库和维护备用数据库
RMAN> BACKUP DATABASE;

Starting backup at 13-DEC-16
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=139 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00006 name=/u01/app/oracle/oradata/yoon/rman_tbsp.dbf
input datafile file number=00001 name=/u01/app/oracle/oradata/yoon/system01.dbf
input datafile file number=00002 name=/u01/app/oracle/oradata/yoon/sysaux01.dbf
input datafile file number=00003 name=/u01/app/oracle/oradata/yoon/undotbs01.dbf
input datafile file number=00005 name=/u01/app/oracle/oradata/yoon/example01.dbf
input datafile file number=00004 name=/u01/app/oracle/oradata/yoon/users01.dbf
channel ORA_DISK_1: starting piece 1 at 13-DEC-16
channel ORA_DISK_1: finished piece 1 at 13-DEC-16
piece handle=/u01/app/oracle/recovery_area/YOON/backupset/2016_12_13/o1_mf_nnndf_TAG20161213T113851_d4yvbdng_.bkp tag=TAG20161213T113851 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:55
Finished backup at 13-DEC-16

Starting Control File and SPFILE Autobackup at 13-DEC-16
piece handle=/u01/app/oracle/recovery_area/YOON/autobackup/cf_c-781817860-20161213-04 comment=NONE
Finished Control File and SPFILE Autobackup at 13-DEC-16

5 通道

 连接到RMAN

 

RMAN信息库包含的条目信息:

默认的REDUNDANCY选项和RETENTION WINDOW选项

 

控制文件自动备份

You can leave a response, or trackback from your own site.

Leave a Reply

网站地图xml地图