rman compress

2024-09-09 07:28
文章标签 rman compress

本文主要是介绍rman compress,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

   级别         初始         备完    耗时
   low          1804       3572    0:10 
   High         1812       3176   2:00 

   MEDIUM  1820       3288    0:13

   BASIC      1828   3444    0:56 ---不如MEDIUM,时间还长
 
  NO COMPRESS     1820    5924  0:5

RMAN> CONFIGURE COMPRESSION ALGORITHM 'MEDIUM'; 

RMAN> BACKUP AS COMPRESSED BACKUPSET DATABASE include current controlfile plus archivelog;

SYMPTOMS

 1> Rman  COMPRESSION ALGORITHM is set to  'BASIC'  ---> Default value

   

SET COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE;

两个命令都可以

RMAN> CONFIGURE COMPRESSION ALGORITHM 'basic';

old RMAN configuration parameters:
CONFIGURE COMPRESSION ALGORITHM 'MEDIUM' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE;
new RMAN configuration parameters:
CONFIGURE COMPRESSION ALGORITHM 'basic' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE;

 

2> Compressed backup takes more time then Uncompressed backup.

  

    BACKUP AS COMPRESSED BACKUPSET DATABASE include current controlfile plus archivelog;

    BACKUP  DATABASE include current controlfile plus archivelog;

COMPRESS:
=========

DBGIO:         Type %Comp Blocks     Tot Blocks Blksize    ElpTime(s) IO Rt(b/s) Name [17:42:22.326] (krmkqio)
DBGIO:         ---- ----- ---------- ---------- ---------- ---------- ---------- ----- [17:42:22.326] (krmkqio)
DBGIO:         IN   100.0 4192894    4194302    8192       808        42510133  <path>/<db_filename> [17:42:22.326] (krmkqio)
DBGIO:         OUT        472348                8192       808        4788953    <path>/<backup_piece_name> [17:42:22.326] (krmkqio)
DBGIO:         AGG        4192894               8192       808        42510133     [17:42:22.326] (krmkqio)
DBGMISC:       ENTERED krmzlog [17:42:22.326]

NO COMPRESS:
============

DBGIO:         Type %Comp Blocks     Tot Blocks Blksize    ElpTime(s) IO Rt(b/s) Name [17:49:38.004] (krmkqio)
DBGIO:         ---- ----- ---------- ---------- ---------- ---------- ---------- ----- [17:49:38.004] (krmkqio)
DBGIO:         IN   100.0 4192894    4194302    8192       116        296105065  <path>/<db_filename> [17:49:38.004] (krmkqio)
DBGIO:         OUT        4192900               8192       116        296105489  <path>/<backup_piece_name> [17:49:38.004] (krmkqio)
DBGIO:         AGG        4192894               8192       116        296105065    [17:49:38.004] (krmkqio)

CHANGES

CAUSE

Bug 14157581 was created on this issue

 Bug 14157581 - EXADATA: RMAN COMPRESS BASIC BACKUP EXTREMELY SLOW Bug 14157581 - EXADATA: RMAN COMPRESS BASIC BACKUP EXTREMELY SLOWBug 14157581 - EXADATA: RMAN COMPRESS BASIC BACKUP EXTREMELY SLOW> ----> Closed as duplicate of  Bug 13784430   . 

 This was closed as not a Bug and expected behavior.
 

13784430Bug 13784430Bug 13784430Bug 13784430Thi

SOLUTION

This is an expected behavior as confirmed by development.Performance slowness can be a part of basic compression.

Moreover, the default compression algorithm is optimized for best compression (not best performance).

You can try using other other type of Compression((like LOW, MEDIUM and HIGH) ,However please note you need to have License for Advanced Compression to use them.

-----

GOAL

How does RMAN compression works ?

Goal of this document is to give you a Complete Understanding of

1. Null compression

2. Unused block compression

3. Binary compression

SOLUTION

A Complete Understanding of RMAN Compression


By default RMAN has three types of compression : 

1.  Null compression

2.  Unused block compression

3.  Binary compression

Untill Oracle Version 10.1 only 'Null' compression is done by default.  In Oracle Version 10.2, and forward, 'Null' and 'unused block' compression is done by default.   The types of compression are done automatically, no special command is required. 

'Null' and 'unused block' compression are filtering which blocks are send to the backups. 'Binary' compression is an additional compression on the blocks send to the backup. 

1. Null Compression

When backing up datafiles into backup sets, RMAN does not back up the contents of data blocks that have never contained data.  This behavior is referred to as 'NULL block compression'. This means RMAN will not backup blocks that have never been used.  RMAN, through Oracle version 9i and forward has performed null compression. 

Example : You have a tablespace having one datafile of size 100MB and out of 100MB only 50 MB is used. Then RMAN will backup only 50MB. 

NOTE:  Null Compression also applies to Standard Edition and SE ONE

2. Unused Block

From Oracle version 10.2 forward, RMAN skips reading, and backing up, any database blocks that are not currently allocated to a database object. This is regardless of whether those blocks had previously been allocated.  This behavior is reffered to as 'Unused Block Compression'. RMAN now creates more compact backups of datafiles, by skipping datafile blocks that are not currently allocated to a database object.  Skipping these unallocated data blocks, i.e., for a dropped table, where possible enables RMAN to back up datafiles using less space, and can make I/O more efficient.  No extra action is required on the part of the DBA to use this feature. 

Example : You have a tablespace having one datafile of size 100MB and out of 100MB, 50MB is used by the user tables. Then user dropped a table belonging to that tablespace which was of 25MB, with the new unused block compression on 25MB of the files is backed up. In this example if null compression is used then it would have backed up 50MB because null compression will consider the blocks that are formatted/ever used.

Unused Block Compression is done, if all of the following conditions apply:

+ The COMPATIBLE initialization parameter is set to 10.2 or higher

+ There are currently no guaranteed restore points defined for the database

+ The datafile is locally managed

+ The datafile is being backed up to a backup set as part of a full backup or a level 0 incremental backup

+ The backup set is being created on DISK

+ The backup is done to TAPE using "OSB" (Oracle Secure Backup)

+ The backup is done with ZDLRA
    

  Note:
  Unused block compression is NOT used if backup done to tape using a THIRD PARTY BACKUP SOFTWARE !  
  Unused block compression is ONLY used in Enterprise Edition.  
 

3. Binary Compression

Binary Compression can be done by specifying "AS COMPRESSED" clause in backup command, this compression is called as binary compression.

RMAN can apply a binary compression algorithm as it writes data to backup sets. This compression is similar to the compression provided by many tape vendors when backing up data to tape. But we cannot give exact percentage of compression. This binary compression algorithm can greatly reduce the space required for disk backup storage. It is typically 2x to 4x, and greater for text-intensive databases.

The command to take the compressed backup :

RMAN> backup as compressed backupset database;

 + There is some CPU overhead associated with compressing backup sets. If the database being backed up is running at or near its maximum load, you may find the overhead from using AS COMPRESSED BACKUPSET unacceptable. In most other circumstances, compressing backupsets saves enough disk space to be worth the CPU overhead. ---时间太慢

+ There is no special command to restore database from the compressed backupsets, the restore command will be the same as with uncompressed backups.
+ The restore from the compressed backpuset will take more time than uncompressed backupsets. 

In addition to the existing binary compression of backup in oracle 10G, RMAN 11G executable offers a wider range of compression levels with the Advanced Compression Option (ACO). The default compression algorithm setting is BASIC and does not require the Advanced Compression Option.

If, however, you have enabled the Oracle Database 11g Release 2 Advanced Compression Option, you can choose from the following compression levels:

LOW - Least impact on backup throughput and suited for environments where CPU resources are the limiting factor.
MEDIUM - Recommended for most environments. Good combination of compression ratios and speed
HIGH - Best suited for backups over slower networks where the limiting factor is network speed

NOTE: Only BASIC compression is allowed in Standard Edition 

 Compression can be used for backupset of datafile, archive log and controlfiles.  For example: 

RMAN> backup as compressed backupset archivelog all;
RMAN> backup as compressed backupset database;
RMAN> backup as compressed backupset current controlfile;


RMAN compress the backupset contents before writing to disk. No extra decompression steps are required during recovery for rman compressed backup;

To configure the compression algorithm:

RMAN> CONFIGURE COMPRESSION ALGORITHM '<alg_name>';

4. Various Compression Types:

For various compression types you can refer to V$RMAN_COMPRESSION_ALGORITHM

SQL> select ALGORITHM_NAME, ALGORITHM_DESCRIPTION, ALGORITHM_COMPATIBILITY from V$RMAN_COMPRESSION_ALGORITHM ;

ALGORITHM_NAME  ALGORITHM_DESCRIPTION                                        ALGORITHM_COMPATIB
--------------- ------------------------------------------------------------ ------------------
BZIP2           good compression ratio                                       9.2.0.0.0
BASIC           good compression ratio                                       9.2.0.0.0
LOW             maximum possible compression speed                           11.2.0.0.0
ZLIB            balance between speed and compression ratio                  11.0.0.0.0
MEDIUM          balance between speed and compression ratio                  11.0.0.0.0
HIGH            maximum possible compression ratio                           11.2.0.0.0

6 rows selected.

 5. Undo Block Compression/Optimization

Starting 11g, RMAN performs undo block optimization.  In backup undo optimization, RMAN excludes undo not needed for recovery of a backup, that is, for transactions that have been committed.    Undo optimization is only possible if:

  • This is a backup set backup
  • Full or incremental level 0
  • Not a validate
  • Backup piece version is 11.0 or above
  • User has not disabled undo optimization with:
    _undo_block_compression = FALSE
  • Backup is going to DISK or OSB tape
  • No Guaranteed Restore Point (This check is enabled from 11.2 onwards)

这篇关于rman compress的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/1150525

相关文章

ASM 10G 基于RMAN 迁移

ASM 10G 基于RMAN 迁移 场景 单节点基于10G R2 的数据库,其数据文件及日志文件均存放在ASM 里,现在为业务需求,将此数据库做迁 移,迁移到另个机房,但是两个机房的网络是通畅的,为尽量减少数据的丢失及平稳迁移和经济实惠,迁 移时,数据库需停应用 工具 本次采用RMAN 的duplicate 命令来进行迁移,运用此命令简化复杂度; 一、源库和目标库的

Oracle(110)什么是RMAN(Recovery Manager)?

RMAN(Recovery Manager)是Oracle数据库提供的一个高效的备份和恢复工具。它能够简化和自动化复杂的备份和恢复操作,并且提供了强大的功能来确保数据的完整性和安全性。 RMAN 的主要功能 备份数据库:支持全备份、增量备份和归档日志备份。恢复数据库:支持从备份中恢复整个数据库或部分数据。克隆数据库:可以方便地创建数据库的副本。验证备份:确保备份数据的一致性和完整性。管理备份空

OEM Activity Summary AAS 不记录后台进程 比如 rman

OEM中rman 备份认为是后台进程,所以在Activity Summary未显示 ,AAS 可以显示 去掉后台进程rman 一个也不显示!

通过RMAN将数据库恢复到同类机异机

--通过RMAN将数据库恢复到同类机异机 --下面开始讲源路径称为host1,新路径称为host2 SYS@PROD2> select dbid from v$database; --查询DBIDDBID----------1564287740RMAN> backup incremental level 0 as compressed backupset databa

RMAN-06172: no AUTOBACKUP found or specified handle is not a valid copy or piece

问题描述: 在通过RMAN将数据库恢复到同类机异机的时候,restore spfile一直报RMAN-06172: no AUTOBACKUP found or specified handle is not a valid copy or piece RMAN> restore spfile from '/tmp/bak/db_14_1_928703445';Starting rest

认识org.apache.hadoop.io.compress解码器/编码器

认识org.apache.hadoop.io.compress解码器/编码器 编码器和解码器用以执行压缩解压算法。在Hadoop里,编码/解码器是通过一个压缩解码器接口实现的。因此,例如,GzipCodec封装了gzip压缩的压缩和解压算法。下表列出了Hadoop可用的编码/解码器。    压缩格式  Hadoop压缩编码/解码器 DEFLATE org.apache.hadoop.io

【Oracle篇】Oracle数据库坏块处理:rman修复坏块实践与案例分析(第七篇,总共八篇)

💫《博主介绍》:✨又是一天没白过,我是奈斯,DBA一名✨ 💫《擅长领域》:✌️擅长Oracle、MySQL、SQLserver、阿里云AnalyticDB for MySQL(分布式数据仓库)、Linux,也在扩展大数据方向的知识面✌️ 💖💖💖大佬们都喜欢静静的看文章,并且也会默默的点赞收藏加关注💖💖💖     今天这篇文章作为Oracle rman系列的倒数第二篇,那

Linux下oracle_rman备份配置参考文档

今天出一份linux下oracle数据库rman备份配置文档供参考,目前很多环境,我都用这份文档在做备份,如果有写的不对的地方还请铁友们指正,我好到生产环境改正。 1. 目录设置 1.1. Rman备份说明  备份级别说明 1、Level 0级全备是各增量备份的基础; 2、增量备份分两种情况,incremental和cumulitive,前者备份跟自己同级或比自己级别低的,后者只备份比自己

【Oracle篇】rman时间点异机恢复:从RAC环境到单机测试环境的转移(第六篇,总共八篇)

💫《博主介绍》:✨又是一天没白过,我是奈斯,DBA一名✨ 💫《擅长领域》:✌️擅长Oracle、MySQL、SQLserver、阿里云AnalyticDB for MySQL(分布式数据仓库)、Linux,也在扩展大数据方向的知识面✌️ 💖💖💖大佬们都喜欢静静的看文章,并且也会默默的点赞收藏加关注💖💖💖     今天是端午假期后的第一天,拖着疲惫的身体,开始了新的