Learning notes for RMAN

Source: Internet
Author: User
RMAN learning notes, RMAN list command 1 lists the corresponding objects RMANgt; listincarnation; 2 list backup 2.1 Overview available backups RMANgt; list

Learning notes for RMAN: list command 1 of RMAN lists corresponding objects RMANgt; list incarnation; 2 list backup 2.1 Overview available backups RMANgt; list

RMAN list Command
1. list the corresponding event RMAN> list incarnation;

2. List backups
2.1 Overview of available backup RMAN> list backup summary;
B Indicates backup
F indicates FULL
A Indicates archive log
0 1 indicates incremental backup
S indicates the backup status (a available x expired)

2.2 list backup RMAN> list backup by file by backup Type;
List data file backup, archive log backup, control file backup, and server parameter file backup

2.3 list Detailed backup RMAN> list backup;

2.4 list expired backup RMAN> list expired backup;

2.5 list tablespaces and data file backups
List backup of tablespace and list backup of datafile output are similar to list backup
For example, list backup of tablespace user_tbs;
List backup of datafile 3;

2.6 list archived log backup RMAN> list archivelog all; Brief Information
RMAN> list backup of archivelog all; details

2.7 list control files and server parameter files
RMAN> list backup of controfile;
RMAN> list backup of spfile;

========================================================== ==================

========================================================== ==================
RMAN report command
1. Report data files that have not been backed up recently
RMAN> report need backup days = 3;
2. Report Backup Redundancy or recovery window
RMAN> report need backup redundancy = 2;
RMAN> report need backup recovery window of 2 days;
3. Report unrecoverable operations on data files
RMAN> report unrecoverable;

4. Report database mode
RMAN> report schema;
5. Report discarded backups
If the storage policy is used, the backup is marked as the discard state RMAN> report obsolete; delete the discard state backup RMAN> delete obsolete;

========================================================== ==================

========================================================== ==================
RMAN crosscheck command
1 backup set has two statuses: A (Available, which RMAN considers to exist on the backup media) X (Expired, which is stored in the control file or recovery directory,
Yes, it does not physically exist on the backup media)
2 crosscheck is used to check the RMAN directory and physical file. If the physical file does not exist on the media, it is marked as Expired. If the physical file
Yes, it will maintain Available. If the backup set marked as Expired is stored on the backup media again (for example, after the damaged disk drive is restored ),
Crosscheck marks the status again from Expired back to Available.
3 The crosscheck output is divided into two parts. The first part lists all backup set slices that are determined to exist on the backup media, and the second part lists the copies that do not exist on the backup media.
The backup set and mark it as Expired. After a backup storage policy is set, a backup expires, and the backup status marked as discarded after crosscheck is still
Availabel: delete the delete obsolete of the discarded backup.

4 EXAMPLE:
Crosscheck backup
Crosscheck backup of datafile 1;
Crosscheck backup of tablespace users;
Crosscheck backup of controfile;
Crosscheck backup of controlfile;
Crosscheck backup tag = 'sat _ backup ';
Crosscheck backup completed after 'sysdate-2'
Crosscheck backup completed between 'sysdate-5' and 'sysdate-2'
Crosscheck backup device type sbt;
Crosscheck archivelog all;
Crosscheck archivelog like '% ARC00012.001'
Crosscheck archivelog from sequence 12;
Crosscheck archivelog until sequence 522;

========================================================== ==================

========================================================== ==================
RMAN validate command
1 validate command to verify whether the backup set can be restored
2 list backup summary; obtain the backup set's primary key ID, such as 40, and then validate backupset 40;
========================================================== ==================

========================================================== ==================
RMAN backup and storage policy and the change and delete commands
0. The change command with the delete parameter deletes the backup set, from the backup media, and from the control file and recovery directory.
Change backupset 117,118 delete;
Change backuppiece 1304 delete;
Change archivelog until logseq = 544 delete;

1. Two types of policies: recovery window backup and Storage policy (recovery windows backup retension policy) based on time
Backup redundancy backup storage policy (backup redundancy backup retension policy) Number of backups
Two policies are mutually exclusive.
2. Even if the backup storage policy is used, the backup will not be deleted when it expires, but is marked as discarded in the RMAN directory, and the status is still available;
To view the backup report obsolete marked as discarded, only delete obsolete is used for physical deletion.
3. configure retension policy to recovery window of 7 days;
Configure retension policy to redundancy 3;
Show all;
4. You may need to manually save some backups when viewing expired and discarded backups. You can use the change command to include the keep parameter,
After using this command, the modified backups will be considered as long-term backup, and will not be affected by the storage policy.
That is to say, delete obsolete is not deleted.
5. Use the backup command with the keep parameter to prevent backup from being affected by the storage policy.
Backup database keep forever;
Backup database keep 5 days;
6. change command function
You can change the backup to permanent storage and save the logs related to the backup to ensure that the backup is always restored to the current time point.
Change backupset 31 keep forever logs;
You can set a new date for backup discarding, save the backup for 7 days, and delete the backup after 7 days.
Change backupset 32 keep until time 'sysdata + 7' logs;
7. change can set the backup set to unavailable.
Change backupset 33 unavailable;
A backup set marked as unavailable does not participate in crosscheck;

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.