如果数据库运行在非归档模式,则唯一有效的数据库备份是一致备份。
为了使备份一致,数据库在被一致关闭之后必须被MOUNT。在还原这个备份的时候不需要进行恢复。
练习:一致备份
|
--一致数据库备份 --0.使数据库运行在非归档模式 --1.启动RMAN连接到目标数据库 [oracle@S1011:/export/home/oracle]$ rman target /
Recovery Manager: Release 11.2.0.3.0 - Production on Thu Jul 4 13:07:44 2013
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: TESTDB11 (DBID=2578856066)
--2. 一致地关闭数据库并且MOUNT数据库(因为需要向控制文件中写RMAN记录的数据) RMAN> shutdown immediate
using target database control file instead of recovery catalog database closed database dismounted Oracle instance shut down
RMAN> startup mount
connected to target database (not started) Oracle instance started database mounted
Total System Global Area 855982080 bytes
Fixed Size 2230792 bytes Variable Size 641730040 bytes Database Buffers 209715200 bytes Redo Buffers 2306048 bytes --3.备份数据库到默认的备份设备:RMAN> backup database; --3.对数据库中所有的数据文件产生镜像拷贝,备份到默认的备份设备上 RMAN> backup as copy database;
Starting backup at 04-JUL-13 allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=18 device type=DISK channel ORA_DISK_1: starting datafile copy input datafile file number=00001 name=/u01/app/oracle/oradata/TestDB11/system01.dbf output file name=/u01/app/oracle/fast_recovery_area/TESTDB11/datafile/o1_mf_system_8xcn7o4s_.dbf tag=TAG20130704T144556 RECID=2 STAMP=819902826 channel ORA_DISK_1: datafile copy complete, elapsed time: 00:01:16 channel ORA_DISK_1: starting datafile copy input datafile file number=00002 name=/u01/app/oracle/oradata/TestDB11/sysaux01.dbf output file name=/u01/app/oracle/fast_recovery_area/TESTDB11/datafile/o1_mf_sysaux_8xcnb0kw_.dbf tag=TAG20130704T144556 RECID=3 STAMP=819902892 channel ORA_DISK_1: datafile copy complete, elapsed time: 00:01:05 channel ORA_DISK_1: starting datafile copy input datafile file number=00005 name=/u01/app/oracle/oradata/TestDB11/example01.dbf output file name=/u01/app/oracle/fast_recovery_area/TESTDB11/datafile/o1_mf_example_8xcnd1pr_.dbf tag=TAG20130704T144556 RECID=4 STAMP=819902919 channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:25 channel ORA_DISK_1: starting datafile copy input datafile file number=00003 name=/u01/app/oracle/oradata/TestDB11/undotbs01.dbf output file name=/u01/app/oracle/fast_recovery_area/TESTDB11/datafile/o1_mf_undotbs1_8xcndv33_.dbf tag=TAG20130704T144556 RECID=5 STAMP=819902974 channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:55 channel ORA_DISK_1: starting datafile copy input datafile file number=00004 name=/u01/app/oracle/oradata/TestDB11/users01.dbf output file name=/u01/app/oracle/fast_recovery_area/TESTDB11/datafile/o1_mf_users_8xcngl78_.dbf tag=TAG20130704T144556 RECID=6 STAMP=819902979 channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03 channel ORA_DISK_1: starting datafile copy copying current control file output file name=/u01/app/oracle/fast_recovery_area/TESTDB11/controlfile/o1_mf_TAG20130704T144556_8xcngodc_.ctl tag=TAG20130704T144556 RECID=7 STAMP=819902982 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 04-JUL-13 channel ORA_DISK_1: finished piece 1 at 04-JUL-13 piece handle=/u01/app/oracle/fast_recovery_area/TESTDB11/backupset/2013_07_04/o1_mf_nnsnf_TAG20130704T144556_8xcngrjq_.bkp tag=TAG20130704T144556 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01 Finished backup at 04-JUL-13 --3.2 查看快速恢复区中新产生的备份的文件 [oracle@S1011:/u01/app/oracle/fast_recovery_area]$ ls -R .: TestDB11 TESTDB11
./TestDB11: control02.ctl
./TESTDB11: backupset controlfile datafile onlinelog
./TESTDB11/backupset: 2013_07_04
./TESTDB11/backupset/2013_07_04: o1_mf_nnsnf_TAG20130704T144556_8xcngrjq_.bkp
./TESTDB11/controlfile: o1_mf_TAG20130704T144556_8xcngodc_.ctl
./TESTDB11/datafile: o1_mf_example_8xcnd1pr_.dbf o1_mf_sysaux_8xcnb0kw_.dbf o1_mf_system_8xcn7o4s_.dbf o1_mf_undotbs1_8xcndv33_.dbf o1_mf_users_8xcngl78_.dbf
./TESTDB11/onlinelog: --4.打开数据库 RMAN> alter database open;
database opened
|
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/17013648/viewspace-1080182/ ,如需转载,请注明出处,否则将追究法律责任。