利用RMAN举行解除表空间备份-备份恢复[Oracle防范]
本文“利用RMAN举行解除表空间备份-备份恢复[Oracle防范]”是由七道奇为您精心收集,来源于网络转载,文章版权归文章作者所有,本站不对其观点以及内容做任何评价,请读者自行判断,以下是其具体内容:
在RMAN的备份中,可以通过Exclude号令解除某些不需求备份的表空间.
这样可以缩减备份的容量,对备份举行得当优化和调整.
解除某个表空间可以利用近似以下号令:
configure exclude for tablespace users;
其设置可以在RMAN中通过show exclude号令来查看.
假如将来想暂时增添解除表空间的备份,可以通过以下号令实现:
backup database noexclude;
假如想撤消解除设置则可以利用以下号令:
CONFIGURE EXCLUDE FOR TABLESPACE users CLEAR;
此外常用的解除备份号令还有:
BACKUP DATABASE SKIP READONLY, SKIP OFFLINE;
以下是一个简单的测试历程.
履行备份:
[oracle@test126 udump]$ rman target /Recovery Manager: Release 10.2.0.1.0 - Production on Mon Oct 9 06:47:19 2006
Copyright (c) 1982, 2005, Oracle. All rights reserved.connected to target database: EYGLE (DBID=2590148133)
RMAN> configure exclude for tablespace users;
using target database control file instead of recovery catalog
tablespace USERS will be excluded from future whole database backups
new RMAN configuration parameters are successfully storedRMAN> backup full database;
Starting backup at 09-OCT-06
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=527 devtype=DISK
file 4 is excluded from whole database backup
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00001 name=/opt/oracle/oradata/eygle/system01.dbf
input datafile fno=00003 name=/opt/oracle/oradata/eygle/sysaux01.dbf
input datafile fno=00002 name=/opt/oracle/oradata/eygle/undotbs01.dbf
channel ORA_DISK_1: starting piece 1 at 09-OCT-06
channel ORA_DISK_1: finished piece 1 at 09-OCT-06
piece handle=/opt/oracle/flash_recovery_area/EYGLE/backupset/2006_10_09/o1_mf_nnndf_TAG20061009T070612_2lm135od_.bkp tag=TAG20061009T070612 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:48
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
including current control file in backupset
channel ORA_DISK_1: starting piece 1 at 09-OCT-06
channel ORA_DISK_1: finished piece 1 at 09-OCT-06
piece handle=/opt/oracle/flash_recovery_area/EYGLE/backupset/2006_10_09/o1_mf_ncnnf_TAG20061009T070612_2lm14ppc_.bkp tag=TAG20061009T070612 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02
Finished backup at 09-OCT-06RMAN> exit
Recovery Manager complete.
然后关闭数据库,我们可以举行一次恢复尝试:
[oracle@test126 udump]$ sqlplus "/ as sysdba"SQL*Plus: Release 10.2.0.1.0 - Production on Mon Oct 9 07:07:28 2006
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning and Data Mining optionsSQL> select name from v$datafile;
NAME
--------------------------------------------------------------------------------
/opt/oracle/oradata/eygle/system01.dbf
/opt/oracle/oradata/eygle/undotbs01.dbf
/opt/oracle/oradata/eygle/sysaux01.dbf
/opt/oracle/oradata/eygle/users01.dbfSQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning and Data Mining options
看看恢复进程:
[oracle@test126 udump]$ rman target /Recovery Manager: Release 10.2.0.1.0 - Production on Mon Oct 9 07:08:40 2006
Copyright (c) 1982, 2005, Oracle. All rights reserved.connected to target database (not started)
RMAN> startup mount;
Oracle instance started
database mountedTotal System Global Area 536870912 bytes
Fixed Size 1220460 bytes
Variable Size 150995092 bytes
Database Buffers 377487360 bytes
Redo Buffers 7168000 bytesRMAN> restore database;
Starting restore at 09-OCT-06
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=542 devtype=DISKfile 4 is excluded from whole database backup
channel ORA_DISK_1: starting datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00001 to /opt/oracle/oradata/eygle/system01.dbf
restoring datafile 00002 to /opt/oracle/oradata/eygle/undotbs01.dbf
restoring datafile 00003 to /opt/oracle/oradata/eygle/sysaux01.dbf
channel ORA_DISK_1: reading from backup piece /opt/oracle/flash_recovery_area/EYGLE/backupset/2006_10_09/o1_mf_nnndf_TAG20061009T070612_2lm135od_.bkp
channel ORA_DISK_1: restored backup piece 1
piece handle=/opt/oracle/flash_recovery_area/EYGLE/backupset/2006_10_09/o1_mf_nnndf_TAG20061009T070612_2lm135od_.bkp tag=TAG20061009T070612
channel ORA_DISK_1: restore complete, elapsed time: 00:00:36
failover to previous backupFinished restore at 09-OCT-06
RMAN> recover database;
Starting recover at 09-OCT-06
using channel ORA_DISK_1starting media recovery
media recovery complete, elapsed time: 00:00:02Finished recover at 09-OCT-06
RMAN> alter database open;
database opened
RMAN>
但是需求注意,假如未备份的表空间文件丧失,不可恢复,你大概需求重建以复原数据库.
以上是“利用RMAN举行解除表空间备份-备份恢复[Oracle防范]”的内容,如果你对以上该文章内容感兴趣,你可以看看七道奇为您推荐以下文章:
本文地址: | 与您的QQ/BBS好友分享! |