ITPub博客

首页 > Linux操作系统 > Linux操作系统 > rman exclude表空间

rman exclude表空间

原创 Linux操作系统 作者:安佰胜 时间:2011-01-04 11:33:08 0 删除 编辑

Rman可以对表空间设置exclude属性,即在备份过程中跳过设置的表空间进行备份。这样可以根据自己的业务特征选择性的备份,特别是在很大的数据库中节省备份时间。

 

测试版本

SQL> select * from v$version;

 

BANNER                                                                         

----------------------------------------------------------------               

Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Prod               

PL/SQL Release 10.1.0.2.0 - Production                                         

CORE        10.1.0.2.0   Production                                                      

TNS for 32-bit Windows: Version 10.1.0.2.0 - Production                        

NLSRTL Version 10.1.0.2.0 - Production                                         

 

已有表空间

SQL> select name from v$tablespace;

 

NAME                                                                           

------------------------------                                                 

SYSTEM                                                                          

UNDOTBS1                                                                       

SYSAUX                                                                         

USERS                                                                           

TEMP                                                                           

ATEST                                                                          

BTEST                                                                           

 

7 rows selected.

 

 

设置表空间的exclude属性

C:\Documents and Settings\Administrator>rman target /

Recovery Manager: Release 10.1.0.2.0 - Production

Copyright (c) 1995, 2004, Oracle.  All rights reserved.

connected to target database: DB10 (DBID=1310023677)

 

RMAN> configure exclude for tablespace atest;    --设置

 

tablespace ATEST will be excluded from future whole database backups

new RMAN configuration parameters are successfully stored

 

RMAN> show exclude;      --查看

 

RMAN configuration parameters are:

CONFIGURE EXCLUDE FOR TABLESPACE 'ATEST';

 

 

备份数据库

RMAN> backup database;

 

Starting backup at 04-1月 -11

allocated channel: ORA_DISK_1

channel ORA_DISK_1: sid=145 devtype=DISK

file 5 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=F:\ORACLE\PRODUCT\10.1.0\ORADATA\DB10\SYSTEM01.DBF

input datafile fno=00003 name=F:\ORACLE\PRODUCT\10.1.0\ORADATA\DB10\SYSAUX01.DBF

input datafile fno=00002 name=F:\ORACLE\PRODUCT\10.1.0\ORADATA\DB10\UNDOTBS01.DBF

input datafile fno=00004 name=F:\ORACLE\PRODUCT\10.1.0\ORADATA\DB10\USERS01.DBF

input datafile fno=00006 name=F:\ORACLE\PRODUCT\10.1.0\ORADATA\DB10\BTEST.DBF  

 

<---备份的表空间中不包括已经设置exclude的atest表空间>

 

channel ORA_DISK_1: starting piece 1 at 04-1月 -11

channel ORA_DISK_1: finished piece 1 at 04-1月 -11

piece handle=F:\ORACLE\PRODUCT\10.1.0\FLASH_RECOVERY_AREA\DB10\BACKUPSET\2011_01_04\O1_MF_NNNDF_TAG20110104T112244_6L54N5HB_.BKP comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:00:35

channel ORA_DISK_1: starting full datafile backupset

channel ORA_DISK_1: specifying datafile(s) in backupset

including current controlfile in backupset

including current SPFILE in backupset

channel ORA_DISK_1: starting piece 1 at 04-1月 -11

channel ORA_DISK_1: finished piece 1 at 04-1月 -11

piece handle=F:\ORACLE\PRODUCT\10.1.0\FLASH_RECOVERY_AREA\DB10\BACKUPSET\2011_01_04\O1_MF_NCSNF_TAG20110104T112244_6L54O9S3_.BKP comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:00:04

Finished backup at 04-1月 -11

 

清除exclude设置

RMAN> configure exclude for tablespace atest clear;

 

tablespace ATEST will be included in future whole database backups

old RMAN configuration parameters are successfully deleted

 

简单而实用的技巧,记录下。

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/13177610/viewspace-683214/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2009-08-26

  • 博文量
    215
  • 访问量
    660364