探索ORACLE之RMAN_03一致性備份

wuweilong發表於2012-05-21

探索ORACLERMAN_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部落格 ” ,連結:http://blog.itpub.net/20674423/viewspace-730497/,如需轉載,請註明出處,否則將追究法律責任。

相關文章