Oracle 10g rman backup and recovery 3

Source: Internet
Author: User

Oracle 10g rman backup and recovery 3 1. rman is actually a backup tool that coordinates this part. It means that the target database, auxiliary database, disk/sbt tape, catalog database/controlfile are connected to the above three databases at the same time to back up to the disk or tape, or recover from the tape or tape. ---------------------------------------------------------------------- 2. A typical Incremental backup solution on Sunday evening-level 0 backup completed MED (full backup) monday evening-level 2 backup rolled med Tuesday evening-level 2 backup rolled med Wednesday evening-level 1 backup rolled med Thursday evening-level 2 backup rolled med Saturday evening-level 2 backup completed MED assumes that the database needs to be restored on Tuesday, backup on Sunday and Monday is used. If the database needs to be restored on Thursday, backup on Sunday and Wednesday is required. Of course, rman will automatically go to the backup set during recovery. ----------------------------------------------------------------------- Automatic backup: backup script + execution script rman target/msglog = bakl0.log prepare file = bakl0rman target/msglog = bakl1.log prepare file = bak11rman target/msglog = bakl2.log prepare file = bakl2 prepare create script [oracle @ redhat restart] $ cd script/[oracle @ redhat script] $ cat bakl0 run {allocate channel cha1 type disk; backupincremental level 0 format "/oracle/ora10g/rmanback/inc0 _ % u _ % T" tag monday_inc0database; release channel cha1 ;} [oracle @ redhat script] $ cp bakl0 bacl1 [oracle @ redhat script] $ cp bakl0 bakl2 [oracle @ redhat script] $ mv bacl1 bakl1 [oracle @ redhat script] $ lsbakl0 bakl1 bakl2 [oracle @ redhat script] $ ls-ltotal 12-rw-r -- r -- 1 oracle oinstall 160 Apr 21 bakl0-rw-r -- r -- 1 oracle oinstall 160 Apr 21 bakl1-rw-r -- r -- 1 oracle oinstall 160 apr 21 bakl2 [oracle @ redhat script] $ chmod 755 * [oracle @ redhat script] $ lltotal 12-rwxr-xr-x 1 oracle oinstall 160 Apr 21 bakl0-rwxr-xr-x 1 oracle oinstall 160 Apr 21 bakl1-rwxr-xr-x 1 oracle oinstall 160 Apr 21 bakl2 [oracle @ redhat script] $ [oracle @ redhat script] $ vi bakl1 [oracle @ redhat script] $ cat bakl1run {allocate channel cha1 type disk; backupincremental level 1 format "/oracle/ora10g/rmanback/inc0 _ % u _ % T" tag monday_inc1database; release channel cha1 ;} [oracle @ redhat script] $ vi bakl2 [oracle @ redhat script] $ cat bakl2run {allocate channel cha1 type disk; backupincremental level 2 format "/oracle/ora10g/rmanback/inc0 _ % u _ % T" tag monday_inc2database; release channel cha1 ;} [oracle @ redhat script] $ restore command rman target/msglog =/oracle/ora10g/rmanback/bakl0.log prepare file =/oracle/rmanback/script/bakl0rman target/msglog =/oracle/ora10g /rmanback/bakl1.log partition file =/oracle/rmanback/script/bakl1rman target/msglog =/oracle/ora10g/rmanback/bakl2.log partition file =/oracle/rmanback/script/bakl2 I created here run the backup in the catalog directory [oracle @ redhat script] $ rman target/catrman rman/rman msglog =/oracle/ora10g/rmanback/backl0.log prepare file =/oracle/ora10g/script/bakl0RMAN> 2> 3> 4> 5> 6> 7> 8> 9> 10> 11> [oracle @ redhat script] $ lsbakl0 bakl1 bakl2 [oracle @ redhat ora10g] $ lsadmin bakl0 flash_recovery_area oradata oraInventory product rmanback history script [oracle @ redhat ora10g] $ cd rmanback/[oracle @ redhat rmanback] $ lsbackl0.log full_20130420 runtime [oracle @ redhat rmanback] $ ll total capacity -- r -- 1 oinstall 1555 Apr 21 backl0.log-rw-r ----- 1 oracle oinstall 559783936 Apr 20 full_20130420-rw-r ----- 1 oracle oinstall 561201152 Apr 21 release [oracle @ redhat rmanback] $ cat backl0.logRecovery Manager: release 10.2.0.1.0-Production on Sunday April 21 02:38:11 2013 Copyright (c) 1982,200 5, Oracle. all rights reserved. connected to target database: WOLF (DBID = 3778783462) connected to recovery catalog databaseRMAN> run {2> allocate channel cha1 type disk; 3> backup4> incremental level 05> format "/oracle/ora10g/rmanback/inc0 _ % u _ % T" 6> tag monday_inc07> database; 8> release channel cha1; 9 >}10> 11> allocated channel: cha1channel cha1: sid = 135 devtype = DISKStarting backup at-13 channel cha1: starting incremental level 0 datafile backupsetchannel cha1: specifying datafile (s) in backupsetinput datafile fno = 00001 name =/oracle/ora10g/oradata/wolf/system01.dbfinput datafile fno = 00003 name =/oracle/ora10g/oradata/wolf/login datafile fno = 00002 name = /oracle/ora10g/oradata/wolf/undotbs01.dbfinput datafile fno = 00005 name =/oracle/ora10g/oradata/wolf/rmanwolf. dbfinput datafile fno = 00004 name =/oracle/ora10g/oradata/wolf/users01.dbfchannel cha1: starting piece 1 at-13 channel cha1: finished piece 1 at 21-4 month-13 piece handle =/oracle/ora10g/rmanback/shard tag = MONDAY_INC0 comment = NONEchannel cha1: backup set complete, elapsed time: 00: 06: 45 Finished backup at-13 Starting Control File and SPFILE Autobackup at-13 piece handle =/oracle/ora10g/flash_recovery_area/WOLF/autobackup/2013_04_21/snapshot _. bkp comment = NONEFinished Control File and SPFILE Autobackup at-13 released channel: cha1Recovery Manager complete. [oracle @ redhat rmanback] $ it is best to specify the full path for the preceding command, including rman [oracle @ redhat rmanback] $ which rman/oracle/ora10g/product/10.2.0/db_1/bin/rman full path/oracle/ora10g/product/10.2.0/db_1/bin/ rman target/catalog rman/rman msglog =/oracle/ora10g/rmanback/backl0.log export file =/oracle/ora10g/script/bakl01 and 2. the BACKUP command is as follows:/oracle/ora10g/product /10.2.0/db_1/bin/rman target/catalog rman/rman msglog =/oracle/ora10g/rmanback/backl1.log prepare file =/oracle/ora10g/script/bakl1/oracle/ora10g/product /10.2.0/db_1/bin/rman target/catalog rman/rman msglog =/oracle/ora10g/rmanback/backl2.log history file =/oracle/ora10g/script/bakl2 explain scheduled task crontabroot to execute cron file Syntax: commands for hours, days, months, and weeks 0-59 0-23 1-31 1-12 0-6 commands (value range: 0 indicates that a task is usually displayed in a row on Sunday) use the root user to edit crontab-e-u oracle. Specify to restart crontabservice crond restart after the oracle user editing scheduled task is edited.

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.