Rman Configuration and Rman Common command operation _oracle

Source: Internet
Author: User
Tags current time oracle database

I. Rman-related configuration

1, into the rman:cmd under the Rman target/
2, check whether in the archive mode: sql>archive log list; (Rman needs to run in archive mode)
3, open the archive mode:

Copy Code code as follows:

Sql>shutdown immediate;
Sql>startup Mount;
Sql>alter Database Archivelog (Close archive mode: ALTER DATABASE noarchivelog;)
Sql>alter database open;
Sql>archive log start;

3, global parameter setting (rman>show all;)
①configure retention Policy to redundancy 1:
is used to determine that the backup is no longer needed, it has a total of three options, respectively
Copy Code code as follows:

CONFIGURE RETENTION POLICY to RECOVERY windows of 7 days;
CONFIGURE RETENTION POLICY to redundancy 5;
CONFIGURE RETENTION POLICY to NONE;

The first recover window is to maintain all sufficient backups to restore the database system to any time in the last seven days. Any database backup that exceeds the last seven days will be marked as obsolete.
The second type of redundancy is to maintain the latest 5 database backups that can be recovered, and any backups exceeding the latest 5 will be marked as redundancy. Its default value is 1 copies.
The third does not need to maintain the policy, clear will revert back to the default retention policy.
The safest way to do this is to use the second retention strategy.
②configure BACKUP Optimization off
The default is off, and if opened, Rman will perform an optimized algorithm for the backed-up data files and files.
③configure default device type to disk:
Is the device type that specifies all I/O operations is a hard disk or a tape, and the default is a hard disk
The setting of the tape is configure DEFAULT DEVICE TYPE to SBT;
④configure Controlfile autobackup off
Force the database to automatically back up files after backing up files or executing commands that alter the structure of the database, and the default value is off. This prevents the control files from being recovered after the control files and catalog are lost.
⑤configure controlfile autobackup FORMAT for DEVICE TYPE DISK to '%F '
is the backup path and backup format of the configuration control file
⑥configure DEVICE TYPE DISK PARALLELISM 1;
is the degree of parallelism that configures the database device type, and the number of concurrent numbers determines the number of open channels.
⑦configure datafile BACKUP copies for DEVICE TYPE DISK to 1;
CONFIGURE Archivelog BACKUP copies for DEVICE TYPE DISK to 1
Whether to start a composite backup and generate the specified number of copies to the location specified in the specified I/O device. The default is 1. This configuration is used only for data files and archives, and will only take effect if the channel is automatically allocated!
⑧configure SNAPSHOT controlfile NAME to ' c:oracle ... Sncftest. ORA '
is the location and file name of the snapshot file for the configuration control file, which was generated during the backup to control the read consistency of the file.
⑨configure CHANNEL DEVICE TYPE DISK FORMAT ' c:...%d_db_%u_%s_%p ';
is to configure backup paths and backup formats for backup files
⑩configure EXCLUDE for tablespace <tablespace> [clear];
Use this command to not back up the specified tablespace to a backup set, which is useful for read-only tablespace.

Ii. related operation of Rman

1, verify the backup information

Copy Code code as follows:

Crosscheck backup;
Crosscheck Backup of database;
Crosscheck Backup of Tablespacesystem;
Crosscheck Backup of Controlfile;
Crosscheck Backup of SPFile;
Crosscheck Archivelog All;

2. View Backup
Copy Code code as follows:

List backup;
list backup of database;
List backup of Tablespacetable_name;
List backup of Controlfile;
List backup of SPFile;
List backupset ID; This ID refers to the ID number of the backup set, such as 2, 3.

3. Delete Backup
Copy Code code as follows:

the obsolete; Report Stale backups
Delete obsolete; --Delete stale backups
Delete expired backup;
Delete expired copy; Delete Expired Copy
Delete Backupset 9; Remove the backup set number 9.
Delete Backuppiece¨f:\backup\demo_9.bak¨; Delete a specific backup slice
Delete backup; --Delete all backups
Delete copy; remove image copy
Delete Datafilecopy¨f:\backup\demo_9.bak¨ remove a specific image copy

Attention:
Note that Oracle's definition of obsolete and expired is contrary to our conventional understanding. Oracle's definition is that for manually deleted files that are physically non-existent, Oracle marks them as expired after the crosscheck is executed, and is marked as obsolete for backup set backup slices that exceed the backup retention policy.
4, Rman provides validate command, can be used to verify the validity of the backup set, the common commands are as follows:
Restore Validate Controlfile;
Restore validate database;
5. Format form Detailed
The activation ID of the%a:oracle database is resetlog_id.
%c: Number of copies of the backup fragment (numbered from 1, maximum not exceeding 256).
%d:oracle the database name.
%d: The day in the current time, in the form of DD.
%e: Archive serial number.
%f: Absolute file number.
%F: A unique name based on "dbid+ time", in the form of C-IIIIIIIIII-YYYYMMDD-QQ, where IIIIIIIIII is the DBID,YYYYMMDD of the database, and QQ is a 1~256 sequence.
%H: Archive log thread number.
The dbid of the%i:oracle database.
%m: The month in the current time, the format is mm.
%N: Table space name.
%n: The name of the database and will be populated with x characters on the right side to keep it at length 8. For example, the database name Jssbook, the generated name is JSSBOOKX.
%p: The number of backup fragments in the backup set, starting at 1.
%s: Backup set number.
%t: Backup set timestamp.
%T: The current time of Year Month Day format (YYYYMMDD).
%u: is a 8-character name that consists of a backup set number and a build time compression. With%u, you can generate a unique name for each backup set.
%u: Default is the shorthand form of%u_%p_%c, which enables you to generate a unique name for each backup fragment (that is, a disk file), which is the most commonly used naming method, and the resulting rules are different when performing different backup operations, as follows:
When the backup fragment is generated,%u=%u_%p_%c;
%u=data-d-%d_id-%i_ts-%n_fno-%f_%u when generating data file mirroring replication;
When generating an archive image copy,%u=arch-d_%d-id-%i_s-%e_t-%h_a-%a_%u;
%u=cf-d_%d-id-%i_%u when generating control file mirroring replication.
%Y: The year in the current time, the format is yyyy.
Note: If the format option is not specified in the backup command, Rman uses%u to name the backup fragment by default.

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.