探索ORACLE之RMAN_03一致性备份
作者:吴伟龙
在之前的已经提到过备份分为一致性备份和非一致性备份,它们的区别就在于数据库所处的备份状态不同,并且一致性备份不能做增量备份恢复,需停业务,一致性备份可以做到增量的备份恢复,从而不影响业务的正常流转。
创建一致性备份
创建一致性备份可以是在非归档模式下创建,并且数据库必须处于mount状态下,而且恢复的时候值能恢复到最后一次备份的状态。也就说从备份到发生故障的这段时间都将丢失。操作步骤如下:
1.1检查归档状态:
SQL> archive log list;
Database log mode No Archive Mode
Automatic archival Disabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 8
Current log sequence 10
SQL>
1.2将数据库启动到mount状态
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.
Total System Global Area 285212672 bytes
Fixed Size 1218968 bytes
Variable Size 79693416 bytes
Database Buffers 197132288 bytes
Redo Buffers 7168000 bytes
Database mounted.
SQL>
1.3执行备份
1.3.1 备份数据库
[oracle@wwldb ~]$ rman target /
Recovery Manager: Release 10.2.0.1.0 - Production on ÐÇÆÚÒ» 5ÔÂ 21 14:53:47 2012
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to target database: WWL (DBID=5520179, not open)
RMAN> backup database;
Starting backup at 21-5ÔÂ -12
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=156 devtype=DISK
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00001 name=/DBData/WWL/system01.dbf
input datafile fno=00003 name=/DBData/WWL/sysaux01.dbf
input datafile fno=00002 name=/DBData/WWL/undotbs01.dbf
input datafile fno=00004 name=/DBData/WWL/users01.dbf
channel ORA_DISK_1: starting piece 1 at 21-5ÔÂ -12
channel ORA_DISK_1: finished piece 1 at 21-5ÔÂ -12
piece handle=/DBBak/bak_WWL_05_21_06nbhucb_1_1 tag=TAG20120521T145403 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:16
Finished backup at 21-5ÔÂ -12
Starting Control File and SPFILE Autobackup at 21-5ÔÂ -12
piece handle=/DBSoft/product/10.2.0/db_1/dbs/c-5520179-20120521-00 comment=NONE
Finished Control File and SPFILE Autobackup at 21-5ÔÂ -12
RMAN>
1.3.2 备份USER表空间
RMAN> backup tablespace users;
Starting backup at 21-5ÔÂ -12
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=155 devtype=DISK
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00004 name=/DBData/WWL/users01.dbf
channel ORA_DISK_1: starting piece 1 at 21-5ÔÂ -12
channel ORA_DISK_1: finished piece 1 at 21-5ÔÂ -12
piece handle=/DBBak/bak_WWL_05_21_08nbhvhe_1_1 tag=TAG20120521T151349 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 21-5ÔÂ -12
Starting Control File and SPFILE Autobackup at 21-5ÔÂ -12
piece handle=/DBSoft/product/10.2.0/db_1/dbs/c-5520179-20120521-01 comment=NONE
Finished Control File and SPFILE Autobackup at 21-5ÔÂ -12
RMAN>
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/20674423/viewspace-730497/ ,如需转载,请注明出处,否则将追究法律责任。