Simulate recover when dataifle is accidentally deleted

Source: Internet
Author: User

Simulated recover Oracle restoration test for accidental deletion of dataifle 1: 1. hot Backup tablespace users. 2. a) scott login, B) create table tt (seq number); c) declare I number; begin for I in 1 .. 20 loop insert into tt values (I); end loop; commit; end; d) alter system switch logfile; e) insert into tt values (21 ); alter system switch logfile ;... until all online redo files have archived (Application for testing the archived log) f) commit; 3. shutdown immediate; 4. rm datafile users; recovery: SQL> startup ORACLE instance started. total System Global Area 285212672 bytes Fixed Size 1218992 bytes Variable Size 121636432 bytes Database Buffers 159383552 bytes Redo Buffers 2973696 bytes Database mounted. ORA-01157: cannot identify/lock data file 4-see DBWR trace file ORA-01110: data file 4: '/oracle/product/10.2.0/oradata/orcl/users01.dbf' SQL> host cp/oracle/backup/users01.dbf/oracle/product/10.2.0/oradata/orcl/SQL> alter database open; alter database open * ERROR at line 1: ORA-01113: file 4 needs media recovery ORA-01110: data file 4: '/oracle/product/10.2.0/oradata/orcl/users01.dbf' SQL> recover tablespace users; ORA-00279: change 546700 generated at 05/14/2013 20:51:07 needed for thread 1 ORA-00289: suggestion: /oracle/product/10.2.0/db_1/flash_recovery_area/ORCL/archivelog/2013_05_14/o1_mf_1_6 _ % u _. arc ORA-00280: change 546700 for thread 1 is in sequence #6 --- ORA-00289: Lookup archived log file recovery... because Specify log: {<RET> = suggested | filename | AUTO | CANCEL} Log applied. media recovery complete. SQL> alter database open; Database altered. note: view the scn: 1. select file #, checkpoint_change # from v $ datafile_header; 2. select file #, checkpoint_change # from v $ datafile; v $ datafile_header information comes from the file header of each data file. v $ datafile information comes from control file 3. select sequence #, first_change #, next_change # from v $ archived_log; 4. select dbms_flashback.get_system_change_number from dual; -- system scn

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.