Last time we introduced:OracleExamples of Common Database rman commands. This article introduces the Oracle databaseRman environment ConfigurationNext, let's take a look at this part!
1. Configure Automatic Channels
Configure Automatic channel concurrency. RMAN automatically allocates two channels:
- RMAN> configure device type disk parallelism 2;
- RMAN> configure device type sbt parallelism 2;
Configure the backup file format for all channels
- RMAN> configure channel device type disk
- 2> format '/oracle/10g/oracle/bakup/%d_%s_%p.bak';
Configure the format of the backup file for a specific channel. Configure the format of the backup file for Channel 1:
- RMAN> configure channel 1 device type disk
- 2> format '/oracle/10g/oracle/bakup/%u.bak';
Configure the default storage device
- RMAN> configure default device type to sbt; -- tape
- RMAN> configure default device type to disk; -- disk
2. Configure the maximum size of the Backup set and backup slice.
- RMAN> configure maxsetsize to 1G;
- RMAN> configure channel device type disk maxpiecesize 500M;
By default, each backup set contains only one backup slice file. By configuring the maximum size of the backup slice, you can divide a large backup set into several smaller backup slice files.
3. Configure backup Optimization
Backup optimization is used to skip the backup of a specific file in some cases. If a backup with the same file already exists, the file will be skipped when backup optimization is activated. Backup optimization is only applicable to the backup database, backup archivelog all/like, and backup backupset all commands. Activate backup optimization: RMAN> configure backup optimization on;
4. Configure multiple backups
By default, rman generates a backup copy. You can configure multiple backups. Example:
- RMAN> configure datafile backup copies for device type disk to 3;
5. Configure to exempt tablespaces
- RMAN> configure exclude for tablespace testspc;
6. Configure Backup Redundancy policies
Delete obsolete is used to delete obsolete backups. An example of configuring a Backup Redundancy policy is as follows:
- RMAN> configure retention policy to redundancy 2;
7. Configure the data file name of the auxiliary routine
It is used for rman to restore or copy the database at the tablespace execution time point. Example:
- RMAN> configure auxname for datafile 2 to '/oracle/10g/data/df_2.dbf';
8. Configure the snapshot control file name
When the directory or backup control file is restored synchronously, rman needs to create a snapshot control file.
- RMAN> show snapshot controlfile name;
- RMAN configuration parameters are:
- Configure snapshot controlfile name to '/oracle/10g/oracle/product/10.2.0/db_1/dbs/snapcf_oralife.f'; # default -- default
- RMAN> configure snapshot controlfile name to '/oracle/10g/oracle/product/10.2.0/db_1/dbs/snapcf_oralife_test.f ';
- Snapshot control file name set to:/oracle/10g/oracle/product/10.2.0/db_1/dbs/snapcf_oralife_test.f
- New RMAN configuration parameters are successfully stored
- RMAN> show snapshot controlfile name;
- RMAN configuration parameters are:
- Configure snapshot controlfile name to '/oracle/10g/oracle/product/10.2.0/db_1/dbs/snapcf_oralife_test.f ';
9. Display rman Configuration
Display all rman environment configurations: RMAN> show all;
Display default device type: RMAN> show default device type;
Display automatic channel configuration: RMAN> show channel for device type disk/sbt;
Display the Backup Redundancy policy: RMAN> show retention policy;
Display backup optimization: RMAN> show backup optimization;
Display snapshot control file: RMAN> show snapshot controlfile name;
Display the maximum backup set size: RMAN> show maxsetsize;
Show multiple backups:
- RMAN> show datafile backup copies; -- displays multiple backups of data files
- RMAN> show archivelog backup copies; -- displays multiple backups of archived logs.
10. Clear rman Configuration
Clear the rman configuration using the clear option, for example:
- RMAN> configure retention policy clear;
- old RMAN configuration parameters:
- CONFIGURE RETENTION POLICY TO REDUNDANCY 2;
- RMAN configuration parameters are successfully reset to default value
- RMAN> show retention policy;
- RMAN configuration parameters are:
- CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
The Oracle Database rman environment configuration is introduced here. I hope this introduction will help you.