Unreasonable setting of MAXPIECESIZE and FORMAT causes RMAN backup failure

Source: Internet
Author: User
If the value of MAXIECESIZE is configured as a given specific value in the RMAN parameter, the wildcard "% p" must be added to the FORMAT. Otherwise, once the backup part exceeds the set upper limit

If the value of MAXIECESIZE is configured as a given specific value in the RMAN parameter, the wildcard "% p" must be added to the FORMAT. Otherwise, once the backup part exceeds the set upper limit

Today, I went to the customer to build the DG. When I created the RMAN backup set, I encountered a problem, causing the backup set to never be generated. Because the customer's backup set is about 10 Gb, it would take more than an hour to back up data at a time, I started to waste a lot of time. After diagnosis, I found that the original problem was caused by MAXPIECESIZE. Next I did a test to illustrate the fault phenomenon and solution:

[Root @ ora10g ~] # Su-Oracle

[Oracle @ ora10g ~] $ Sqlplus/as sysdba

SQL * Plus: Release 10.2.0.1.0-Production on 24 14:32:34 2014

Copyright (c) 1982,200 5, Oracle. All rights reserved.

Connected:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0-Production
With the Partitioning, OLAP and Data Mining options

SQL> select open_mode from v $ database;

OPEN_MODE
----------
READ WRITE


SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0-Production
With the Partitioning, OLAP and Data Mining options
[Oracle @ ora10g ~] $ Rman target/


Recovery Manager: Release 10.2.0.1.0-Production on 24 14:32:52 2014


Copyright (c) 1982,200 5, Oracle. All rights reserved.


Connected to target database: ORA10G (DBID = 4175411955)


RMAN> show all;


Using target database control file instead of recovery catalog
RMAN configuration parameters are:
Configure retention policy to redundancy 5;
Configure backup optimization on;
Configure default device type to disk;
Configure controlfile autobackup on;
Configure controlfile autobackup format for device type disk to '/u01/orabackup/backupsets/ora10g-% F. ctl ';
Configure device type disk parallelism 1 backup type to backupset;
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 maxpiecesize 10000 M; -- maximum backup set limit
Configure maxsetsize to unlimited; # default
Configure encryption for database off; # default
Configure encryption algorithm 'aes128 '; # default
Configure archivelog deletion policy to none;
Configure snapshot controlfile name to '/u01/app/oracle/product/10.2.0/db_1/dbs/snapcf_ora10g.f'; # default


RMAN> exit

Recovery Manager complete.
[Oracle @ ora10g ~] $ Cd/u01/orabackup/scripts/
[Oracle @ ora10g scripts] $ ls-l
Total 4
-Rwxr-xr-x 1 oracle oinstall 2443 Dec 24 14:29 backup_full.sh
[Oracle @ ora10g scripts] $./backup_full.sh
RMAN> 2> 3> RMAN> [oracle @ ora10g backupsets] $ ls -lrth
Total 190 M
-Rw-r ----- 1 oracle oinstall 9.8 M Dec 24 ora10g-4175411955_20141224_867162246_380.arc
-Rw-r ----- 1 oracle oinstall 1.7 M Dec 24 ora10g-4175411955_20141224_867162255_381.arc
-Rw-r ----- 1 oracle oinstall 439 K Dec 24 ora10g-4175411955_20141224_867162257_382.arc
-Rw-r ----- 1 oracle oinstall 747 K Dec 24 ora10g-4175411955_20141224_867162820_384.arc
-Rw-r ----- 1 oracle oinstall 170 M Dec 24 ora10g-4175411955_20141224_867162823_385.db
-Rw-r ----- 1 oracle oinstall 491 K Dec 24 ora10g-4175411955_20141224_867162990_386.arc
-Rw-r ----- 1 oracle oinstall 7.3 M Dec 24 ora10g-c-4175411955-20141224-00.ctl
[Oracle @ ora10g backupsets] $

According to the preceding configuration, the RMAN backup set is correctly generated. The total size is about MB, and the maximum data file backup set is 170 MB.

In the backup script, the format is "$ ORACLE_SID-% I _ % T _ % t _ % s. db". The specific statement of the script is as follows:

Backup as compressed backupset database format' $ RMAN_BACKUPSETS/$ ORACLE_SID-% I _ % T _ % t _ % s. db 'tag' db _ Bak' plus archivelog format' $ RMAN_BACKUPSETS/$ ORACLE_SID-% I _ % T _ % t _ % s. arc 'not backed up 1 times delete all input tag 'arc _ Bak ';

When you change the value of MAXPIECESIZE to a smaller value than the previous largest backup set size (170 M), for example, to M, run the backup script, and then view the log file output by RMAN, A ORA-27038 was found, prompting that the file already exists:

[Oracle @ ora10g backupsets] $ cat ../logs/rman. log | grep ORA-

ORA-19504: failed to create file "/u01/orabackup/backupsets/ora10g-4175411955_20141224_867163196_389.db"

ORA-27038: created file already exists

Channel ORA_DISK_1: starting piece 2 at 2014-12-24
RMAN-00571: ========================================================== ==============================
RMAN-00569: ==================== error message stack follows ==========================
RMAN-00571: ========================================================== ==============================
RMAN-03002: failure of backup plus archivelog command at 12/24/2014 14:41:52
ORA-19504: failed to create file "/u01/orabackup/backupsets/ora10g-4175411955_20141224_867163196_389.db"
ORA-27038: created file already exists
Additional information: 1

Under normal circumstances, the maximum size of the generated backup set is 170 MB, but after you modify the MAXPIECESIZE parameter to MB, once the backup set size exceeds MB, 2nd backup slices are automatically generated, because I only configured "$ ORACLE_SID-% I _ % T _ % t _ % s. db ", the meanings of these Wildcards are:
% I -- DBID
% T -- date and time (year, month, and day)
% T -- auto-generated Timestamp
% S -- backup set serial number (Sequence)

When the first backup file reaches 2nd MB, you want to generate files. However, these Wildcards are insufficient to distinguish the backup files in the backup set (the same file name is generated ), when 2nd backup slices are created, the system prompts that the file already exists, resulting in backup failure.

There are two ways to solve this problem:

1. Add the % p wildcard to the format parameter.

When the size of MAXPIECESIZE is exceeded, only % p can generate different backup slices, because the timestamp % t is insufficient to distinguish the names of different parts.

[Oracle @ ora10g backupsets] $.../scripts/backup_full.sh

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.