Oracle actual RMAN backup, it is best to "see"

Source: Internet
Author: User

In the previous examples, we have some knowledge about it and tried some commands related to Oracle actual RMAN backup. However, in the actual operating environment, it is impossible to require DBAs to execute a command and a command to repeat the previous chapter. We are determined to optimize the work.

Therefore, we should write a script and put it on the server for regular execution. DBA only needs to regularly check the results of script execution.

Before writing a script, let's clarify our goals:

Run the command at 1 o'clock every night.

Database full backup, backup control files and archive log files at the same time, backup files are saved to the F: \ oracle \ backup \ directory, and after archiving log files are backed up, the archived logs backed up are automatically deleted.

The backup is retained for 14 days, and is automatically deleted after expiration.

Keep operation logs for future reference.

Taking a Windows environment as an example, the Linux/u nix environment is basically similar. You do not need to change the RMAN script or even change it, modify the command line that calls the RMAN script and the backup set storage path!

8.6.1 compile the RMAN batch processing file

Compile the RMAN batch file:

 
 
  1. RUN {  
  2. CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 14 DAYS;  
  3. CONFIGURE CONTROLFILE AUTOBACKUP ON;  
  4. CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR 
    DEVICE TYPE DISK TO ' F:\ORACLE\BACKUP\%F ' ;  
  5. ALLOCATE CHANNEL C1 DEVICE TYPE DISK FORMAT ' 
    F:\ORACLE\BACKUP\BAK_%U ' ;  
  6. BACKUP DATABASE SKIP INACCESSIBLE  
  7. PLUS ARCHIVELOG FILESPERSET 20  
  8. DELETE ALL INPUT;  
  9. RELEASE CHANNEL C1;  
  10. }  
  11. ALLOCATE CHANNEL FOR MAINTENANCE DEVICE TYPE DISK;  
  12. CROSSCHECK BACKUPSET;  
  13. DELETE NOPROMPT OBSOLETE;  

Save to F: \ oracle \ script \ backup \ db_fullbak_jssbook.rman.

Tip:

The CONFIGURE command in the first few lines can also be executed in addition to the batch processing script. It only needs to be executed once, because all CONFIGURE configurations will be saved to the control file of the target database, it will always be valid if no one changes it.

The above commands are mentioned in the previous chapters. If you look at your eyes, go back and read the previous content. The command is known, and several parameters may not understand its meaning.

For example, do not worry about the skip inaccessible parameter in the BACKUP command ...... Outside ...... Outside and outside ...... Let's take a look at the notes. You don't have to shake the kitchen knife around. You, you, and you, don't come here, I can't say it.) en, seeing everyone so devout, I will disclose this part of content in advance.

The above content is an introduction to Oracle's actual RMAN backup. I hope you will have some gains.

Related Article

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.