ITPub博客

首页 > Linux操作系统 > Linux操作系统 > Controlfile auto backup

Controlfile auto backup

原创 Linux操作系统 作者:DBA_oracle_java 时间:2013-07-08 15:01:58 0 删除 编辑

Oracle 10g中可以在rman里面开启控制文件自动备份

CONFIGURE CONTROLFILE AUTOBACKUP ON;

Oracle recommends that CONFIGURE CONTROLFILE AUTOBACKUP be set to ON

 

Oracle联机文档里面解释了开启控制文件自动备份之后,在哪些情况话会自动备份控制文件

When RMAN Performs Control File Autobackups

. Control File Autobackups After Backup Acivities

. Control File Autobackups After Database Structural Changes

 

演示操作步骤(10gR2 10.2.0.1)

###开启控制文件自动备份

RMAN> CONFIGURE CONTROLFILE AUTOBACKUP ON;

 

new RMAN configuration parameters:

CONFIGURE CONTROLFILE AUTOBACKUP ON;

new RMAN configuration parameters are successfully stored

 

RMAN> CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '//RECO/rman/%F';

 

using target database control file instead of recovery catalog

new RMAN configuration parameters:

CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '//RECO/rman/%F';

new RMAN configuration parameters are successfully stored

 

####新建表空,改变数据库的结构

[oracle@oracle ~]$ sqlplus / as sysdba

 

SQL*Plus: Release 10.2.0.1.0 - Production on Mon Jul 8 15:32:10 2013

 

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, OLAP and Data Mining options

 

SQL> SELECT FILE_NAME FROM DBA_DATA_FILES;

 

FILE_NAME

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

/u01/app/oracle/oradata/ora10g/users01.dbf

/u01/app/oracle/oradata/ora10g/sysaux01.dbf

/u01/app/oracle/oradata/ora10g/undotbs01.dbf

/u01/app/oracle/oradata/ora10g/system01.dbf

/u01/app/oracle/oradata/ora10g/example01.dbf

 

SQL> SELECT TABLESPACE_NAME FROM DBA_TABLESPACES;

 

TABLESPACE_NAME

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

SYSTEM

UNDOTBS1

SYSAUX

TEMP

USERS

EXAMPLE

 

6 rows selected.

 

SQL> CREATE TABLESPACE JSSZ DATAFILE '/u01/app/oracle/oradata/ora10g/jssz01.dbf' size 20M;

 

Tablespace created.

 

##alert日志中会立刻出现添加表空间的信息

CREATE TABLESPACE JSSZ DATAFILE '/u01/app/oracle/oradata/ora10g/jssz01.dbf' size 20M

Mon Jul  8 15:33:16 2013

Starting control autobackup

Mon Jul  8 15:33:19 2013

Control autobackup written to DISK device

        handle '/RECO/rman/c-4129990014-20130708-00'

Completed: CREATE TABLESPACE JSSZ DATAFILE '/u01/app/oracle/oradata/ora10g/jssz01.dbf' size 20M

 

[oracle@oracle ~]$ ls -l /RECO/rman/c-4129990014-20130708-00

-rw-r-----  1 oracle oinstall 7143424 Jul  8 15:33 /RECO/rman/c-4129990014-20130708-00

 

 

11gR2里面有些不一样

Starting with Oracle 11g Release 2, RMAN creates a single autobackup file

encompassing all of the structural changes that have occurred within a few

minutes of each other rather than creating a new backup of the controlfile

on each structural change to the database.

 

演示操作步骤(10gR2 11.2.0.3)

##开启控制文件自动备份,并制定备份控制文件的路径及命名格式

oracle@szsckj:/u02/app/oracle/products/11.2.0/dbs>rman target /

 

Recovery Manager: Release 11.2.0.3.0 - Production on Mon Jul 8 14:37:46 2013

 

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

 

connected to target database: SZSCDB (DBID=2429344538)

 

RMAN> show all;

 

using target database control file instead of recovery catalog

RMAN configuration parameters for database with db_unique_name SZSCDB are:

CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default

CONFIGURE BACKUP OPTIMIZATION OFF; # default

CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default

CONFIGURE CONTROLFILE AUTOBACKUP OFF; # default

CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default

CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default

CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default

CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default

CONFIGURE MAXSETSIZE TO UNLIMITED; # default

CONFIGURE ENCRYPTION FOR DATABASE OFF; # default

CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default

CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE ; # default

CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default

CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u02/app/oracle/products/11.2.0/dbs/snapcf_szscdb.f'; # default

 

RMAN> CONFIGURE CONTROLFILE AUTOBACKUP ON;

 

new RMAN configuration parameters:

CONFIGURE CONTROLFILE AUTOBACKUP ON;

new RMAN configuration parameters are successfully stored

 

RMAN> CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/RECO/rman/%F';

 

new RMAN configuration parameters:

CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/RECO/rman/%F';

new RMAN configuration parameters are successfully stored

 

 

 

 

###创建新的表空间

oracle@szsckj:/u02/app/oracle/products/11.2.0/dbs>sqlplus  / as sysdba

 

SQL*Plus: Release 11.2.0.3.0 Production on Mon Jul 8 14:33:47 2013

 

Copyright (c) 1982, 2011, Oracle.  All rights reserved.

 

 

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

 

SQL> alter system switch logfile;

 

System altered.

 

SQL> SELECT FILE_NAME FROM DBA_DATA_FILES;

 

FILE_NAME

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

/ORADATA/szscdb/users01.dbf

/ORADATA/szscdb/sysaux01.dbf

/ORADATA/szscdb/undotbs01.dbf

/ORADATA/szscdb/system01.dbf

/ORADATA/szscdb/example01.dbf

 

SQL> SELECT TABLESPACE_NAME FROM DBA_TABLESPACES;

 

TABLESPACE_NAME

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

SYSTEM

UNDOTBS1

SYSAUX

TEMP

USERS

EXAMPLE

 

6 rows selected.

 

SQL> CREATE TABLESPACE JSSZ DATAFILE '/ORADATA/szscdb/jssz01.dbf' size 20M;

 

Tablespace created.

 

 

###监控alert日志文件

CREATE TABLESPACE JSSZ DATAFILE '/ORADATA/szscdb/jssz01.dbf' size 20M

Completed: CREATE TABLESPACE JSSZ DATAFILE '/ORADATA/szscdb/jssz01.dbf' size 20M

日志中并没有说明产生了自动备份的控制文件,在对应的目录也没有发现任何物理文件

几分钟之后可以看到备份的控制文件产生,alert日志中依然没有相关记录。

 

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

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

注册时间:2013-07-02

  • 博文量
    31
  • 访问量
    117560