重庆思庄Oracle、Redhat认证学习论坛

标题: oracle 11g 非归档模式下的增量备份 [打印本页]

作者: 郑全    时间: 2012-8-20 19:38
标题: oracle 11g 非归档模式下的增量备份

oracle 11g 非归档模式下的增量备份

1.数据库设置到非归档模式
  1.1 启动数据库到mount状态
SQL> startup mount;
ORACLE instance started.

Total System Global Area  619360256 bytes
Fixed Size                  1346700 bytes
Variable Size             411042676 bytes
Database Buffers          201326592 bytes
Redo Buffers                5644288 bytes
Database mounted.
  1.2 查看当前数据库的状态,目前为归档
SQL> archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     1
Next log sequence to archive   1
Current log sequence           1

  1.3 设置为非归档

SQL> alter database noarchivelog;

Database altered.

  1.4 打开数据库

SQL> alter database open;

Database altered.


2. 把数据库启动到mount状态
   非归档模式状态,数据库备份只能在mount状态下执行备份 
   2.1 关闭数据库
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.

   2.2 启动数据库到mount状态
QL> startup mount;
ORACLE instance started.

Total System Global Area  619360256 bytes
Fixed Size                  1346700 bytes
Variable Size             411042676 bytes
Database Buffers          201326592 bytes
Redo Buffers                5644288 bytes
Database mounted.

   2.3 验证目前运行模式为非归档

SQL> archive log list;
Database log mode              No Archive Mode
Automatic archival             Disabled
Archive destination            USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     1
Current log sequence           1
SQL>

3.进行增量备份
  3.1 使用rman登陆
     
[oracle@dbserver ~]$ rman target /

Recovery Manager: Release 11.2.0.3.0 - Production on Mon Aug 20 18:56:24 2012

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

connected to target database: SZTECH1 (DBID=3206860853, not open)

RMAN>


  3.2 进行零级备份
    RMAN> backup incremental level 0 database;

Starting backup at 20-AUG-12
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=133 device type=DISK
channel ORA_DISK_1: starting incremental level 0 datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/oracle/app/oracle/oradata/sztech1/system01.dbf
input datafile file number=00002 name=/oracle/app/oracle/oradata/sztech1/sysaux01.dbf
input datafile file number=00005 name=/oracle/app/oracle/oradata/sztech1/example01.dbf
input datafile file number=00003 name=/oracle/app/oracle/oradata/sztech1/undotbs01.dbf
input datafile file number=00006 name=/oracle/app/oracle/oradata/sztech1/idx01.dbf
input datafile file number=00004 name=/oracle/app/oracle/oradata/sztech1/users01.dbf
channel ORA_DISK_1: starting piece 1 at 20-AUG-12
channel ORA_DISK_1: finished piece 1 at 20-AUG-12
piece handle=/oracle/app/oracle/fast_recovery_area/SZTECH1/backupset/2012_08_20/o1_mf_nnnd0_TAG20120820T185705_834601rt_.bkp tag=TAG20120820T185705 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:15
channel ORA_DISK_1: starting incremental level 0 datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 20-AUG-12
channel ORA_DISK_1: finished piece 1 at 20-AUG-12
piece handle=/oracle/app/oracle/fast_recovery_area/SZTECH1/backupset/2012_08_20/o1_mf_ncsn0_TAG20120820T185705_83462gf2_.bkp tag=TAG20120820T185705 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 20-AUG-12

   3.3  进行1级增量备份
    RMAN> backup incremental level 1 database;

Starting backup at 20-AUG-12
using channel ORA_DISK_1
channel ORA_DISK_1: starting incremental level 1 datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/oracle/app/oracle/oradata/sztech1/system01.dbf
skipping datafile 00001 because it has not changed
input datafile file number=00002 name=/oracle/app/oracle/oradata/sztech1/sysaux01.dbf
skipping datafile 00002 because it has not changed
input datafile file number=00005 name=/oracle/app/oracle/oradata/sztech1/example01.dbf
skipping datafile 00005 because it has not changed
input datafile file number=00003 name=/oracle/app/oracle/oradata/sztech1/undotbs01.dbf
skipping datafile 00003 because it has not changed
input datafile file number=00006 name=/oracle/app/oracle/oradata/sztech1/idx01.dbf
skipping datafile 00006 because it has not changed
input datafile file number=00004 name=/oracle/app/oracle/oradata/sztech1/users01.dbf
skipping datafile 00004 because it has not changed
channel ORA_DISK_1: backup cancelled because all files were skipped
channel ORA_DISK_1: starting incremental level 1 datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 20-AUG-12
channel ORA_DISK_1: finished piece 1 at 20-AUG-12
piece handle=/oracle/app/oracle/fast_recovery_area/SZTECH1/backupset/2012_08_20/o1_mf_ncsn1_TAG20120820T190328_8346d2k5_.bkp tag=TAG20120820T190328 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 20-AUG-12


    可以看到1级增量备份很快就完成.

  3.4 打开数据库
    RMAN> alter database open;

database opened

 到此,非归档模式下数据库增量备份完成   


作者: 郑全    时间: 2012-8-20 19:47

也就是在非归档模式下,也可以使用 增量级别

backup incremental level 1 database;


作者: symenjoe    时间: 2014-3-30 22:16
核心就是非归档模式的增量备份必须在mount下做。教学环境sztech_11204_for64.rar中的数据库是非归档模式,Database log mode:No Archive Mode。在上面做053的练习才发现。




欢迎光临 重庆思庄Oracle、Redhat认证学习论坛 (http://bbs.cqsztech.com/) Powered by Discuz! X3.2