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

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 6008|回复: 2
打印 上一主题 下一主题

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

[复制链接]
跳转到指定楼层
楼主
发表于 2012-8-20 19:38:13 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 支持支持 反对反对
回复

使用道具 举报

沙发
 楼主| 发表于 2012-8-20 19:47:18 | 只看该作者

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

backup incremental level 1 database;

回复 支持 反对

使用道具 举报

板凳
发表于 2014-3-30 22:16:46 | 只看该作者
核心就是非归档模式的增量备份必须在mount下做。教学环境sztech_11204_for64.rar中的数据库是非归档模式,Database log mode:No Archive Mode。在上面做053的练习才发现。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|手机版|小黑屋|重庆思庄Oracle、Redhat认证学习论坛 ( 渝ICP备12004239号-4 )

GMT+8, 2024-4-29 04:19 , Processed in 0.084138 second(s), 20 queries .

重庆思庄学习中心论坛-重庆思庄科技有限公司论坛

© 2001-2020

快速回复 返回顶部 返回列表