专家,我拥有Oracle数据库11g版本11.2.0.3.0 - 使用Real Application Clusters和自动存储管理进行64位生产。
操作系统是Linux Red Hat 2.6.18-348.12.1.el5。
数据库名称:dbname
数据库大小约为92 GB。
使用RMAN执行备份需要大约4小时45分钟才能完成任务,并且会损坏与数据库交互的其他进程的正确执行。
这些表每天都有很多DML(udpate / insert / delete)。
我在rman日志中看到两个评论家的时刻:
Starting backup at 04-04-2017 04:33:59
channel dbname_backup_disk1: starting incremental level 1 datafile backup set
channel dbname_backup_disk1: specifying datafile(s) in backup set
input datafile file number=00017 name=file_name ....
... "here all files"
channel dbname_backup_disk1: starting piece 1 at 04-04-2017 04:34:00
channel dbname_backup_disk1: finished piece 1 at 04-04-2017 07:22:47
piece handle=+RECOVERY/dbname/backupset/2017_04_04/nnndn1_dbname_level_0_0.2614.940394043 tag=DBNAME_LEVEL_0 comment=NONE
channel dbname_backup_disk1: backup set complete, ***elapsed time: 02:48:48***
和
Starting backup at 04-04-2017 07:46:20
backup will be obsolete on date 04-07-2017 07:46:20
archived logs required to recover from this backup will expire when this
backup expires
channel dev1: starting compressed full datafile backup set
channel dev1: starting piece 1 at 04-04-2017 07:46:21
channel dev1: finished piece 1 at 04-04-2017 09:22:07
piece handle=/backup/oracle/backup/DBNAME_940405581_6656_1 tag=TAG20170404T074620 comment=NONE
channel dev1: backup set complete, ***elapsed time: 01:35:46***
Finished backup at 04-04-2017 09:22:07
请帮我找到减少所用时间的关键。感谢
下面的行是主脚本的一部分,名为backup.pl。每天上午02:30从当地(UTC -3)执行,来自crontab。
RMAN> run {
show all;
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 1 DAYS;
configure controlfile autobackup on;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '+RECOVERY/DBTARGET/%F';
CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '+RECOVERY/DBTARGET/%d_%t_%s_%p';
allocate channel dbname_backup_disk1 device type disk;
REPORT OBSOLETE;
DELETE OBSOLETE;
recover copy of database with tag 'dbname_LEVEL_0' until time 'sysdate-1';
backup incremental level 1 cumulative copies=1 for recover of copy with tag 'dbname_LEVEL_0' database include current controlfile;
backup archivelog all not backed up format '+RECOVERY/DBTARGET/%d_%t_s%s_s%p';
backup current controlfile for standby;
delete archivelog until time='sysdate-3';
release channel dbtarget_backup_disk1;
sql "create pfile=''/backup/oracle/backup/ros1or01-initdbtarget1-20170404.ora'' from spfile";
}
allocate channel for maintenance type disk;
delete noprompt obsolete device type disk;
CROSSCHECK BACKUP;
CROSSCHECK DATAFILECOPY ALL;
CHANGE ARCHIVELOG ALL CROSSCHECK;
DELETE EXPIRED ARCHIVELOG ALL;
REPORT OBSOLETE;
DELETE OBSOLETE;
release channel;
run
{
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/backup/oracle/backup/%F';
allocate channel dev1 device type disk format '/backup/oracle/backup/%d_%t_%s_%p';
backup backupset completed after 'sysdate-3/24';
backup as compressed backupset datafilecopy all noduplicates KEEP UNTIL TIME 'SYSDATE+3' logs;
release channel dev1;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '+RECOVERY/DBTARGET/%F';
}
quit
using target database control file instead of recovery catalog
RMAN configuration parameters for database with db_unique_name DBTARGET are:
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 1 DAYS;
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '+RECOVERY/DBTARGET/%F';
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 CHANNEL DEVICE TYPE DISK FORMAT '+RECOVERY/DBTARGET/%d_%t_%s_%p';
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 '/cots/oracle/11.2.0/dbhome_1/dbs/snapcf_dbtarget1.f'; # default
先谢谢
答案 0 :(得分:0)
你能告诉我92GB的快递吗?
我怀疑它是备份的大小或实际数据大小。
我怀疑你的桌子很碎片。这意味着,从磁盘读取许多空块。输出看起来很少,但实际上还有很多工作要做(适用于压缩备份)。
除了你的备份脚本疯了!我建议首先简化它,然后尝试提高性能。
尝试以下脚本。它或多或少与你的相同:
RMAN>
#Do all the CONFIGURE... stuff here if you do not want to rely on the current controlfile config.
# Configure the default channel to disk and configure a format so the output goes to the filesystem not to your FRA (ASM).
CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '/backup/DBTARGET/%d_%t_%s_%p';
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO COMPRESSED BACKUPSET;
# Place your controlfile autobackup to disk not asm. In case of a recovery szenario you will be glad to have it in your filesystem.
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/backup/DBTARGET/%F';
BACKUP DATABASE;
CROSSCHECK ARCHIVELOG ALL;
BACKUP ARCHIVELOG ALL DELETE ALL INPUT;
CROSSCHECK BACKUP;
DELETE NOPROMPT EXPIRED BACKUP;
DELETE NOPROMPT EXPIRED ARCHIVELOG ALL;
DELETE NOPROMPT OBSOLETE;
run {
allocate channel d1 device type disk;
recover copy of database with tag 'dbname_LEVEL_0';
backup incremental level 1 for recover of copy with tag 'dbname_LEVEL_0' database;
}