RMAN backup and recovery instance Test

Source: Internet
Author: User

Backup:

Db_fullbak_jssbook.bat

Name = "code" class = "SQL"> SET Oracle_SID = jssbook

Rman target/LOG = c: \ ORACLE \ SCRIPT \ BACKUP \ LOGS \ BAK _ % DATE :~ 0, 10%. LOG

Export File = c: \ ORACLE \ SCRIPT \ BACKUP \ DB_FULLBAK_JSSBOOK.RMAN

Db_fullbak_jssbook.rman

[Plain]
  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 'C: \ ORACLE \ BACKUP \ % F ';
  5. Allocate channel C1 device type disk format 'C: \ 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;
Construct Data:

...

Simulated loss:

...

Reboot error:

[SQL]
  1. SQL> startup
  2. The ORACLE routine has been started.
  3. Total SystemGlobalArea 612368384 bytes
  4. FixedSize1250428 bytes
  5. VariableSize192940932 bytes
  6. DatabaseBuffers 411041792 bytes
  7. Redo Buffers 7135232 bytes
  8. The database has been loaded.
  9. ORA-01157: unable to identify/lock data file 4-see DBWR trace file
  10. ORA-01110: data file 4:'C: \ ORACLE \ ORADATA \ JSSOOK \ JSSBOOK \ users01.dbf'
Fix:

[SQL]
  1. C: \ oracle \ script>SetOracle_sid = jssbook
  2. C: \ oracle \ script> rman target/
  3. Recovery MANAGER: Release 10.2.0.1.0-ProductionOnWednesday, September 16, February 1 22:37:06, 2012
  4. Copyright (c) 1982,200 5, Oracle.AllRights reserved.
  5. Connected to the target database: JSSBOOK (DBID = 1507698744, not enabled)
  6. RMAN> restore datafile 4
  7. 2>;
  8. Start restore from to 12
  9. Use the target database control file to replace the recovery directory
  10. Allocated channel: ORA_DISK_1
  11. Channel ORA_DISK_1: sid = 156 devtype = DISK
  12. Channel ORA_DISK_1: Recovering data file backup set
  13. Channel ORA_DISK_1: Specifies the data file to be recovered from the backup set.
  14. Restoring data file 00004 to C: \ ORACLE \ ORADATA \ JSSOOK \ JSSBOOK \ USERS01.DBF
  15. Channel ORA_DISK_1: Reading the BACKUP section C: \ ORACLE \ BACKUP \ BAK_0FN28OQ1_1_1
  16. Channel ORA_DISK_1: recovered backup segment 1
  17. Segment handle = C: \ ORACLE \ BACKUP \ BAK_0FN28OQ1_1_1 mark = TAG20120201T215721
  18. Channel ORA_DISK_1: Recovery completed, time: 00:00:36
  19. The restore is completed from month 1 to Month 12.
Recovery:

[SQL]
  1. RMAN> restore datafile 4
  2. 2>;
  3. Start restore from to 12
  4. Use the target database control file to replace the recovery directory
  5. Allocated channel: ORA_DISK_1
  6. Channel ORA_DISK_1: sid = 156 devtype = DISK
  7. Channel ORA_DISK_1: Recovering data file backup set
  8. Channel ORA_DISK_1: Specifies the data file to be recovered from the backup set.
  9. Restoring data file 00004 to C: \ ORACLE \ ORADATA \ JSSOOK \ JSSBOOK \ USERS01.DBF
  10. Channel ORA_DISK_1: Reading the BACKUP section C: \ ORACLE \ BACKUP \ BAK_0FN28OQ1_1_1
  11. Channel ORA_DISK_1: recovered backup segment 1
  12. Segment handle = C: \ ORACLE \ BACKUP \ BAK_0FN28OQ1_1_1 mark = TAG20120201T215721
  13. Channel ORA_DISK_1: Recovery completed, time: 00:00:36
  14. The restore is completed from month 1 to Month 12.
  15. RMAN> recover datafile 4
  16. 2>;
  17. Start recover from month 1 to Month 12
  18. Use channel ORA_DISK_1
  19. Restoring media...
  20. Media Recovery completed. Time: 00:00:02
  21. The recover is completed from month 1 to Month 12.
Verification:

[SQL]
  1. RMAN>Alter Database Open
  2. 2>;
  3. Database opened
  4. RMAN> host;
  5. Microsoft Windows XP [version 5.1.2600]
  6. (C) Copyright 1985-2001 Microsoft Corp.
  7. C: \ oracle \ script> sqlplus scott/tiger
  8. SQL * Plus: Release 10.2.0.1.0-ProductionOnWednesday, September 16, February 1 22:39:49, 2012
  9. Copyright (c) 1982,200 5, Oracle.AllRights reserved.
  10. Connect:
  11. OracleDatabase10g Enterprise Edition Release 10.2.0.1.0-Production
  12. WithThe Partitioning, OLAPAndData Mining options
  13. SQL>Select*FromTemp1;
  14. NAME
  15. --------------------
  16. Test1
  17. Test2
  18. Test3
  19. SQL>

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.