rman在歸檔與非歸檔時備份資料庫的簡單示例

eric0435發表於2012-10-31
oracle10g
如果資料庫是非歸檔模式只有資料庫在mount狀態下才能進行備份
SQL> startup nomount;
ORACLE instance started.

Total System Global Area 6442450944 bytes
Fixed Size                  2030368 bytes
Variable Size            1090520288 bytes
Database Buffers         5335154688 bytes
Redo Buffers               14745600 bytes
在nomount狀態下是不能備份的
RMAN> backup database;

Starting backup at 31-OCT-12
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=154 devtype=DISK
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of backup command at 10/31/2012 14:22:22
ORA-01507: database not mounted

在mount狀態下能進行備份
SQL> alter database mount;

Database altered.

RMAN> backup database;

Starting backup at 31-OCT-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=00005 name=/u01/app/oracle/oradata/jytest/hygeia.dbf
input datafile fno=00003 name=/u01/app/oracle/oradata/jytest/sysaux01.dbf
input datafile fno=00002 name=/u01/app/oracle/oradata/jytest/undotbs01.dbf
input datafile fno=00001 name=/u01/app/oracle/oradata/jytest/system01.dbf
input datafile fno=00004 name=/u01/app/oracle/oradata/jytest/users01.dbf
channel ORA_DISK_1: starting piece 1 at 31-OCT-12
channel ORA_DISK_1: finished piece 1 at 31-OCT-12
piece handle=/u01/app/oracle/flash_recovery_area/JYTEST/backupset/2012_10_31/o1_mf_nnndf_TAG20121031T142300_891jy4yv_.bkp tag=TAG20121031T142300 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:05:25
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
including current control file in backupset
including current SPFILE in backupset
channel ORA_DISK_1: starting piece 1 at 31-OCT-12
channel ORA_DISK_1: finished piece 1 at 31-OCT-12
piece handle=/u01/app/oracle/flash_recovery_area/JYTEST/backupset/2012_10_31/o1_mf_ncsnf_TAG20121031T142300_891k8co4_.bkp tag=TAG20121031T142300 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02
Finished backup at 31-OCT-12

如果資料庫是歸檔模式資料庫能在open和mount狀態下能進行備份
SQL> startup
ORACLE instance started.

Total System Global Area 6442450944 bytes
Fixed Size                  2030368 bytes
Variable Size            1090520288 bytes
Database Buffers         5335154688 bytes
Redo Buffers               14745600 bytes
Database mounted.
Database opened.

RMAN> backup database;

Starting backup at 31-OCT-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=00005 name=/u01/app/oracle/oradata/jytest/hygeia.dbf
input datafile fno=00003 name=/u01/app/oracle/oradata/jytest/sysaux01.dbf
input datafile fno=00002 name=/u01/app/oracle/oradata/jytest/undotbs01.dbf
input datafile fno=00001 name=/u01/app/oracle/oradata/jytest/system01.dbf
input datafile fno=00004 name=/u01/app/oracle/oradata/jytest/users01.dbf
channel ORA_DISK_1: starting piece 1 at 31-OCT-12
channel ORA_DISK_1: finished piece 1 at 31-OCT-12
piece handle=/u01/app/oracle/flash_recovery_area/JYTEST/backupset/2012_10_31/o1_mf_nnndf_TAG20121031T142300_892jy4yv_.bkp tag=TAG20121031T142301 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:05:25
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
including current control file in backupset
including current SPFILE in backupset
channel ORA_DISK_1: starting piece 1 at 31-OCT-12
channel ORA_DISK_1: finished piece 1 at 31-OCT-12
piece handle=/u01/app/oracle/flash_recovery_area/JYTEST/backupset/2012_10_31/o1_mf_ncsnf_TAG20121031T142300_891k8co4_.bkp tag=TAG20121031T142300 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02
Finished backup at 31-OCT-12

SQL> startup mount
ORACLE instance started.

Total System Global Area 6442450944 bytes
Fixed Size                  2030368 bytes
Variable Size            1090520288 bytes
Database Buffers         5335154688 bytes
Redo Buffers               14745600 bytes
Database mounted.


RMAN> backup database;

Starting backup at 31-OCT-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=00005 name=/u01/app/oracle/oradata/jytest/hygeia.dbf
input datafile fno=00003 name=/u01/app/oracle/oradata/jytest/sysaux01.dbf
input datafile fno=00002 name=/u01/app/oracle/oradata/jytest/undotbs01.dbf
input datafile fno=00001 name=/u01/app/oracle/oradata/jytest/system01.dbf
input datafile fno=00004 name=/u01/app/oracle/oradata/jytest/users01.dbf
channel ORA_DISK_1: starting piece 1 at 31-OCT-12
channel ORA_DISK_1: finished piece 1 at 31-OCT-12
piece handle=/u01/app/oracle/flash_recovery_area/JYTEST/backupset/2012_10_31/o1_mf_nnndf_TAG20121031T142300_893jy4yv_.bkp tag=TAG20121031T142302 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:05:25
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
including current control file in backupset
including current SPFILE in backupset
channel ORA_DISK_1: starting piece 1 at 31-OCT-12
channel ORA_DISK_1: finished piece 1 at 31-OCT-12
piece handle=/u01/app/oracle/flash_recovery_area/JYTEST/backupset/2012_10_31/o1_mf_ncsnf_TAG20121031T142300_891k8co4_.bkp tag=TAG20121031T142300 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02
Finished backup at 31-OCT-12


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26015009/viewspace-748007/,如需轉載,請註明出處,否則將追究法律責任。

相關文章