作者:瞄瞄摩卡李流 | 来源:互联网 | 2014-07-13 17:52
相关链接:探索ORACLE之RMAN_01概念http://www.2cto.com/database/201205/132243.html;探索ORACLE之RMAN_02基本使用http://www.2cto.com/database/201205/132329.html在之前的已经提到过备份分为一致性备份和非..
相关链接:
探索ORACLE之RMAN_01概念
http://www.2cto.com/database/201205/132243.html;
探索ORACLE之RMAN_02基本使用
http://www.2cto.com/database/201205/132329.html
在之前的已经提到过备份分为一致性备份和非一致性备份,它们的区别就在于
数据库所处的备份状态不同,并且一致性备份不能做增量备份恢复,需停业务,一致性备份可以做到增量的备份恢复,从而不影响业务的正常流转。 www.2cto.com
创建一致性备份
创建一致性备份可以是在非归档模式下创建,并且数据库必须处于mount状态下,而且恢复的时候值能恢复到最后一次备份的状态。也就说从备份到发生故障的这段时间都将丢失。操作步骤如下:
1.1检查归档状态:
SQL> archive log list;
Database log mode No Archive Mode
Automaticarchival Disabled
Archivedestination USE_DB_RECOVERY_FILE_DEST
Oldest onlinelog sequence 8
Current logsequence 10
SQL>
1.2将数据库启动到mount状态
SQL> shutdown immediate
Databaseclosed.
Databasedismounted.
ORACLE instanceshut down.
SQL> startup mount;
ORACLE instancestarted.
Total SystemGlobal Area 285212672 bytes
Fixed Size 1218968 bytes
VariableSize 79693416 bytes
DatabaseBuffers 197132288 bytes
RedoBuffers 7168000 bytes
Databasemounted. www.2cto.com
SQL>
1.3执行备份
1.3.1 备份数据库
[oracle@wwldb ~]$ rman target /
RecoveryManager: Release 10.2.0.1.0 - Production on ÐÇÆÚÒ» 5ÔÂ 21 14:53:47 2012
Copyright (c)1982, 2005,
Oracle. All rights reserved.
connected totarget database: WWL (DBID=5520179, not open)
RMAN> backup database;
Starting backupat 21-5ÔÂ -12
using targetdatabase control file instead of recovery catalog
allocatedchannel: ORA_DISK_1
channelORA_DISK_1: sid=156 devtype=DISK
channelORA_DISK_1: starting full datafile backupset
channelORA_DISK_1: specifying datafile(s) in backupset
input datafilefno=00001 name=/DBData/WWL/system01.dbf
input datafilefno=00003 name=/DBData/WWL/sysaux01.dbf
input datafilefno=00002 name=/DBData/WWL/undotbs01.dbf
input datafilefno=00004 name=/DBData/WWL/users01.dbf
channelORA_DISK_1: starting piece 1 at 21-5ÔÂ -12
channelORA_DISK_1: finished piece 1 at 21-5ÔÂ -12
piece handle=/DBBak/bak_WWL_05_21_06nbhucb_1_1tag=TAG20120521T145403 comment=NONE
channelORA_DISK_1: backup set complete, elapsed time: 00:01:16
Finished backupat 21-5ÔÂ -12 www.2cto.com
Starting ControlFile and SPFILE Autobackup at 21-5ÔÂ -12
piecehandle=/DBSoft/product/10.2.0/db_1/dbs/c-5520179-20120521-00 comment=NONE
Finished ControlFile and SPFILE Autobackup at 21-5ÔÂ -12
RMAN>
1.3.2 备份USER表空间
RMAN> backup tablespace users;
Starting backupat 21-5ÔÂ -12
using targetdatabase control file instead of recovery catalog
allocated channel:ORA_DISK_1
channelORA_DISK_1: sid=155 devtype=DISK
channelORA_DISK_1: starting full datafile backupset
channelORA_DISK_1: specifying datafile(s) in backupset
input datafilefno=00004 name=/DBData/WWL/users01.dbf
channelORA_DISK_1: starting piece 1 at 21-5ÔÂ -12
channelORA_DISK_1: finished piece 1 at 21-5ÔÂ -12
piecehandle=/DBBak/bak_WWL_05_21_08nbhvhe_1_1 tag=TAG20120521T151349 comment=NONE
channelORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backupat 21-5ÔÂ -12 www.2cto.com
Starting ControlFile and SPFILE Autobackup at 21-5ÔÂ -12
piecehandle=/DBSoft/product/10.2.0/db_1/dbs/c-5520179-20120521-01 comment=NONE
Finished ControlFile and SPFILE Autobackup at 21-5ÔÂ -12
RMAN>
作者 吴伟龙