博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
rac开启block change tracking
阅读量:2446 次
发布时间:2019-05-10

本文共 5486 字,大约阅读时间需要 18 分钟。

rac上开启block change tracking功能

首先在测试库测试一下开启block change tracking增量备份的速度
这个server配置很低,做一次全备份要很长时间,总共有60G数据

先做一个level 0的全备份

RMAN> backup incremental level 0 as compressed backupset database format '/data/oracle/backup/justin/justin_%U.bak';

Starting backup at 08-AUG-11

using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=1077 devtype=DISK
channel ORA_DISK_1: starting compressed incremental level 0 datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
******
channel ORA_DISK_1: starting piece 1 at 08-AUG-11
channel ORA_DISK_1: finished piece 1 at 08-AUG-11
piece handle=/data/oracle/backup/justin/justin_01mjfu2v_1_1.bak tag=TAG20110808T140622 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:59:06
channel ORA_DISK_1: starting compressed incremental level 0 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 08-AUG-11
channel ORA_DISK_1: finished piece 1 at 08-AUG-11
piece handle=/data/oracle/backup/justin/justin_02mjg1hq_1_1.bak tag=TAG20110808T140622 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 08-AUG-11
此次level 0备份消耗将近1个小时,
在数据库中新建一个表空间
SQL> create tablespace test datafile '/data/oracle/oradata/justin/test.dbf' size 8g;

Tablespace created.

SQL>  create table test tablespace test as select * from dba_objects;

Table created.

运行增量备份

RMAN> backup incremental level 1 as compressed backupset database;
Starting backup at 08-AUG-11
using channel ORA_DISK_1
channel ORA_DISK_1: starting compressed incremental level 1 datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
********
channel ORA_DISK_1: starting piece 1 at 08-AUG-11
channel ORA_DISK_1: finished piece 1 at 08-AUG-11
piece handle=/data/oracle/product/10.2/db1/dbs/03mjg62v_1_1 tag=TAG20110808T162255 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:17:06
channel ORA_DISK_1: starting compressed incremental level 1 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 08-AUG-11
channel ORA_DISK_1: finished piece 1 at 08-AUG-11
piece handle=/data/oracle/product/10.2/db1/dbs/04mjg731_1_1 tag=TAG20110808T162255 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 08-AUG-11

新建的表只有2M,但是增量备份仍要17分钟

此时再创建一个表,然后开启block change tracking
SQL> create table test2 tablespace test as select * from dba_objects;

Table created.

SQL> alter database enable block change tracking using file '/data/oracle/backup/justin/block_track.log';

Database altered.

此时再来一个增量备份
RMAN> backup incremental level 1 as compressed backupset database;

Starting backup at 08-AUG-11

using channel ORA_DISK_1
channel ORA_DISK_1: starting compressed incremental level 1 datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
********
channel ORA_DISK_1: starting piece 1 at 08-AUG-11
channel ORA_DISK_1: finished piece 1 at 08-AUG-11
piece handle=/data/oracle/product/10.2/db1/dbs/05mjg7i1_1_1 tag=TAG20110808T164800 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
channel ORA_DISK_1: starting compressed incremental level 1 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 08-AUG-11
channel ORA_DISK_1: finished piece 1 at 08-AUG-11
piece handle=/data/oracle/product/10.2/db1/dbs/06mjg7i4_1_1 tag=TAG20110808T164800 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 08-AUG-11
这次相当之快,只需要3秒

RAC库开启block change tracking,需要把文件放到共享目录下,否则会创建不成功

SQL> alter database enable block change tracking using file '+DATA/JUSTIN/block_change_tracking.log';

Database altered.

接下来部署脚本,每周3做全备,其余时间做增量差异备份

0 03 * * 3 sh /home/oracle/justinscript/rman_level0.sh >> /home/oracle/justinscript/rman_level0.log
0 03 * * 0,1,2,4,5,6 sh /home/oracle/justinscript/rman_level1.sh >> /home/oracle/justinscript/rman_level1.log
具体脚本如下
[oracle@justin ~]$ more /home/oracle/monitor/script/rman_level0.sh
. /home/oracle/.bash_profile
rman target / @/home/oracle/monitor/script/rman_level0
[oracle@justin ~]$ more /home/oracle/monitor/script/rman_level0
crosscheck backup;
delete obsolete;
run
{allocate channel d1 type disk maxpiecesize=3g;
allocate channel d2 type disk;
allocate channel d3 type disk;
allocate channel d4 type disk;
backup incremental level=0 as compressed backupset database format '/data/oracle/backup/rman/Lv0_%d_%T_%U.bak';
release channel d1;
release channel d2;
release channel d3;
release channel d4;
}
[oracle@justin ~]$ more  /home/oracle/monitor/script/rman_level1.sh
. /home/oracle/.bash_profile
rman target / @/home/oracle/monitor/script/rman_level1
[oracle@justin ~]$ more /home/oracle/monitor/script/rman_level1
run
{allocate channel d1 type disk maxpiecesize=3g;
allocate channel d2 type disk;
allocate channel d3 type disk;
allocate channel d4 type disk;
backup incremental level=1 as compressed backupset database format '/data/oracle/backup/rman/Lv1_%d_%T_%U.bak';
release channel d1;
release channel d2;
release channel d3;
release channel d4;
}

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

转载于:http://blog.itpub.net/15480802/viewspace-704624/

你可能感兴趣的文章
android卸载应用代码_如何在Android设备上卸载应用
查看>>
xbmc_如何在XBMC上重新创建频道冲浪体验
查看>>
选择偏好_网站如何记住您的偏好(以及关于Cookie的选择)?
查看>>
将隐藏的车库门开启器添加到您的车辆中
查看>>
如何在Ubuntu 14.04中轻松隐藏Unity Launcher
查看>>
snapchat_如何配置Bitmoji和Snapchat
查看>>
在Redhat Linux机器上更改主机名
查看>>
如何在Windows Server 2003的IIS 6上安装Perl
查看>>
如何删除Trovi /管道/搜索保护浏览器劫持恶意软件
查看>>
normal forms_使用Google Forms轻松创建基于Web的调查
查看>>
word文档插入复选框_如何将复选框添加到Word文档
查看>>
sql truncate_如何在SQL Delete和SQL Truncate语句后使用数据库备份恢复数据
查看>>
为SQL Server Always On可用性组配置域控制器和Active Directory
查看>>
SQL Server连接面试SQL Server数据库管理员问答
查看>>
ssisdb_SSISDB入门
查看>>
如何在SQL Server Management Studio中创建和配置链接服务器以连接到MySQL
查看>>
使用PowerShell和T-SQL在多服务器环境中规划SQL Server备份和还原策略
查看>>
ansi_nulls_影响查询结果SQL Server SET选项-SET ANSI_NULLS,SET ANSI_PADDING,SET ANSI_WARNINGS和SET ARITHABORT
查看>>
使用Microsoft数据迁移助手在Oracle数据库和SQL Server之间迁移的具体示例
查看>>
大数据数据科学家常用面试题_面试有关数据科学,数据理解和准备的问答
查看>>