Use RMAN for full database backup

Source: Internet
Author: User

Using RMAN for full database backup I. backup database operations under rman: 1. in rman, you can disable, enable, convert from non-archive to archive, and enable RMAN> shutdown immediate; RMAN> startup mount; RMAN> run (SQL 'alter database noarchivelog ';} RMAN> run {SQL 'alter database open';} II. when the database is not archived, backup and recovery are as follows: 1. RMAN> backup database format 'e: \ rmanbackup \ % U. bak '; execute the full backup of the database to start the channel allocated by backup from month 04-12 to month 07: ORA_DISK_1 channel ORA_DISK_1: sid = 13 devtype = DISK channel ORA_DISK_1: starting full data file backup set channel ORA_DISK_1: the data file in the specified backup set contains the current SPFILE in the backup set. The backup set includes the input data file fno = 00001 name = E: \ ORACLE \ ORADATA \ OIC \ SYSTEM01.DBF input data file fno = 00002 name = E: \ ORACLE \ ORADATA \ OIC \ UNDOTBS01.DBF input data file fno = 00005 name = E: \ ORACLE \ ORADATA \ OIC \ EXAMPLE01.DBF input data file fno = 00010 name = E: \ ORACLE \ ORADATA \ OIC \ XDB01.DBF input data file fno = 00006 name = E: \ ORACLE \ ORADATA \ OIC \ INDX01.DBF input data file fno = 00009 name = E: \ ORACLE \ ORADATA \ OIC \ USERS01.DBF input data file fno = 00003 name = E: \ ORACLE \ ORADATA \ OIC \ CWMLITE01.DBF input data file fno = 00004 name = E: \ ORACLE \ ORADATA \ OIC \ DRSYS01.DBF input data file fno = 00007 name = E: \ ORACLE \ ORADATA \ OIC \ ODM01.DBF input data file fno = 00008 name = E: \ ORACLE \ ORADATA \ OIC \ TOOLS01.DBF channel ORA_DISK_1: starting segment 1 from month 04-12 to month 07 ORA_DISK_1: Completed segment 1 from month 04-12 to month 07 handle = E: \ RMANBACKUP \ 01j2p2d8_00001.bak comment = NONE channel ORA_DISK_1: Backup set completed, after: 00: 01: 17, the backup was completed from month 04-12 to month 072. then delete the INDX01.DBF file, start the database will prompt an error, the information is as follows: RMAN> startup after the execution is complete DB is in the mount state Oracle routine has started the database has loaded RMAN-00571: ========================================================== ============================== RMAN-00569: ================ error message stack follows ============================ RMAN-00571: ========================================================== ============================== RMAN-03002: failure of startup command at 12/04/2007 15: 56: 43ORA-01157: unable to identify/lock data file 6-see DBWR trace file ORA-01110: data file 6: 'e: \ ORACLE \ ORADATA \ OIC \ indx01.dbf' 3. execute the restore database command RMAN> restore database; execute this statement to fix the entire database and start the channel allocated by the restore from month 04-12 to month 07: ORA_DISK_1 channel ORA_DISK_1: sid = 13 devtype = DISK skipping data file 1; recovered to file E: \ ORACLE \ ORADATA \ OIC \ SYSTEM01.DBF skipping data file 2; recovered to file E: \ ORACLE \ ORADATA \ OIC \ UNDOTBS01.DBF skipping data file 3; recovered to file E: \ ORACLE \ ORADATA \ OIC \ CWMLITE01.DBF skipping data file 4; recovered to file E: \ ORACLE \ ORADATA \ OIC \ DRSYS01.DBF skipping Data File 5; recovered to file E: \ ORACLE \ ORADATA \ OIC \ EXAMPLE01.DBF skipping data file 7; recovered to file E: \ ORACLE \ ORADATA \ OIC \ ODM01.DBF skipping data file 8; recovered to file E: \ ORACLE \ ORADATA \ OIC \ TOOLS01.DBF skipping data file 9; recovered to file E: \ ORACLE \ ORADATA \ OIC \ USERS01.DBF skipping data file 10; recovered to file E: \ ORACLE \ ORADATA \ OIC \ XDB01.DBF channel ORA_DISK_1: Recovering data file backup set channel ORA_DISK_1: specifying that the data file recovered from the backup set is restoring the data file 00006 to the E: \ ORACLE \ ORADATA \ OIC \ INDX01.DBF channel ORA_DISK_1: recovered backup Segment segment 1 segment handle = E: \ RMANBACKUP \ 01j2p2d8_00001.bak tag = TAG20071204T153712 params = NULL channel ORA_DISK_1. execute the recover database Command RMAN> recover database; start the recover on the 04-12 month-07 use the channel ORA_DISK_1 to start the restoration of the media to complete the restoration of the media. The recover on the 04-12 month-075 month. start DBRMAN> run {SQL 'alter database open';} 3. note the following points in non-archive mode: 1. the database should be in the mount state; otherwise, the following error message RMAN> backup database format 'e: \ 'will appear; start the channel allocated by backup from month 12 to month 07: ORA_DISK_1 channel ORA_DISK_1: sid = 13 devtype = DISK channel ORA_DISK_1: Starting full data file backup set channel ORA_DISK_1: the data file in the specified backup set contains the current SPFILE backup set including the current control file RMAN-00571 in the backup set: ========================================================== ============================== RMAN-00569: ================ error message stack follows ============================ RMAN-00571: ========================================================== ============================== RMAN-03009: failure of backup command on ORA_DISK_1 channel at 12/04/2007 15: 11: 32ORA-19602: unable to back up or copy active files in NOARCHIVELOG Mode IV. backup and recovery of the entire database in archive Mode 1. RMAN> backup database format 'e: \ rmanbackup \ % u. bak '; during execution, the DB is in the mount state and the channel allocated by backup from month 04-12 to month 07 is started: ORA_DISK_1 channel ORA_DISK_1: sid = 13 devtype = DISK channel ORA_DISK_1: starting full data file backup set channel ORA_DISK_1: the data file in the specified backup set contains the current SPFILE in the backup set. The backup set includes the input data file fno = 00001 name = E: \ ORACLE \ ORADATA \ OIC \ SYSTEM01.DBF input data file fno = 00002 name = E: \ ORACLE \ ORADATA \ OIC \ UNDOTBS01.DBF input data file fno = 00005 name = E: \ ORACLE \ ORADATA \ OIC \ EXAMPLE01.DBF input data file fno = 00010 name = E: \ ORACLE \ ORADATA \ OIC \ XDB01.DBF input data file fno = 00006 name = E: \ ORACLE \ ORADATA \ OIC \ INDX01.DBF input data file fno = 00009 name = E: \ ORACLE \ ORADATA \ OIC \ USERS01.DBF input data file fno = 00003 name = E: \ ORACLE \ ORADATA \ OIC \ CWMLITE01.DBF input data file fno = 00004 name = E: \ ORACLE \ ORADATA \ OIC \ DRSYS01.DBF input data file fno = 00007 name = E: \ ORACLE \ ORADATA \ OIC \ ODM01.DBF input data file fno = 00008 name = E: \ ORACLE \ ORADATA \ OIC \ TOOLS01.DBF channel ORA_DISK_1: starting segment 1 from month 04-12 to month 07 ORA_DISK_1: Completed segment 1 from month 04-12 to month 07 handle = E: \ RMANBACKUP \ 02J2P7EN. BAK comment = NONE channel ORA_DISK_1: the backup set has been completed. After the time: 00: 00: 57, the backup was completed from month 04-12 to month 072. delete all data files. 3. start DB to mount status RMAN> startup mount connected to target database (not started) oracle routine started Database loaded system global region total 135338868 bytes Fixed Size 453492 bytes Variable Size 109051904 bytes Database Buffers 25165824 bytes Redo Buffers 667648 bytes 4. execute restore database. After the execution is complete, the deleted data file is generated with RMAN> restore database. Start the channel allocated by restore from month 12 to month 07: ORA_DISK_1 channel ORA_DISK_1: sid = 13 devtype = DISK channel ORA_DISK_1: starting to recover the data file backup set channel ORA_DISK_1: specifying that the data file recovered from the backup set is restoring the data file 00001 to E: \ ORACLE \ ORADATA \ OIC \ SYSTEM01.DBF is restoring data file 00002 to E: \ ORACLE \ ORADATA \ OIC \ UNDOTBS01.DBF is restoring data file 00003 to E: \ ORACLE \ ORADATA \ OIC \ CWMLITE01.DBF is restoring data file 00004 to E: \ ORACLE \ ORADATA \ OIC \ DRSYS01.DBF is restoring data file 00005 to E: \ ORACLE \ ORADATA \ OIC \ EXAMPLE01.DBF is restoring data file 00006 to E: \ ORACLE \ ORADATA \ OIC \ INDX01.DBF is restoring data file 00007 to E: \ ORACLE \ ORADATA \ OIC \ ODM01.DBF is restoring data file 00008 to E: \ ORACLE \ ORADATA \ OIC \ TOOLS01.DBF is restoring data file 00009 to E: \ ORACLE \ ORADATA \ OIC \ USERS01.DBF is restoring data file 00010 to E: \ ORACLE \ ORADATA \ OIC \ XDB01.DBF channel ORA_DISK_1: handle = E in Segment 1 of the recovered backup segment: \ RMANBACKUP \ 02J2P7EN. BAK tag = TAG20071204T170319 params = NULL channel ORA_DISK_1: the recovery is complete. recover databaseRMAN> recover database; Start recover from month 04-12 to month 07 Use channel ORA_DISK_1 to start media recovery completion from month 04-12 to month 076. open DBRMAN> run {SQL 'alter database open';} SQL statement: alter database open v. in archive mode, the table space is restored at the first level (the entire database is fully standby before restoration. disable DB and delete user01 data file 2. execute tablespace recovery. After execution, you can see the recovered data file RMAN> run {2> allocate channel d1 type disk under E: \ oracle \ oradata; 3> set newname for datafile 'e: \ oracle \ oradata \ OIC \ users01.dbf' to 'e: \ oracle \ oradata \ users01.dbf'; 4> restore tablespace users; 5> switch datafile 9; 6> recover tablespace users; 7> alter database open; 8> release channel d1;} allocated channel: d1 channel d1: sid = 13 devtype = DISK is executing command: set newname start restore on-07 channel d1: Recovering data file backup SET channel d1: the data file recovered from the backup set is being restored to E: \ ORACLE \ ORADATA \ USERS01.DBF channel d1: handle = E: \ RMANBACKUP \ 02J2P7EN in progress. BAK tag = TAG20071204T170319 params = NULL channel d1: recovery completed restore in-07 data file 9 has been converted to data file copy input data file copy recid = 33 stamp = 640459891 file name = E: \ ORACLE \ ORADATA \ USERS01.DBF starts the recovery of the media from month 04-12 to month 07. The recovery of the media is completed. The recovery of the recovered media is completed from month 04-12 to month 07. The database has opened the released channel: d1

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.