Actual Oracle actual RMAN backup operations

Source: Internet
Author: User

In previous articles, we introduced the actual Oracle RMAN backup operations and some common commands. We all know some commands in Oracle RMAN backup. In the actual environment, it is impossible for DBAs to require one command for each backup.

Through the study in the previous chapter, we are determined to optimize the work, so we should write a script, and then put it on the server side 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, in a Linux/u nix environment, this is basically similar. You do not need to change the actual Oracle RMAN script, 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 actual Oracle 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.

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.