Recover corrupted users tablespace with backup

Source: Internet
Author: User

BackupUserTablespace

SQL> alter tablespace users beginbackup; 

Tablespace altered.

SQL>! Cp/u01/tiger/oradata/orcl2/users01.dbf/bk 

SQL> alter tablespace users end backup; 

Tablespace altered

Trade and destroyUserTablespace

SQL>! Cp/etc/passwd/u01/tiger/oradata/orcl2/users01.dbf 

SQL> alter system switch logfile; 

System altered. 

SQL> select * from emp;

Select * from emp

*

ERROR at line 1:

ORA-00376:File 4 cannot be readat this time

ORA-01110:Data file 4: '/u01/tiger/oradata/orcl2/users01.dbf'

SQL> select * from v $ recover_file;

 

FILE # ONLINE _ error change # TIME

---------------------------------------------------------------

4 OFFLINEFILE NOT FOUND0

 

SQL>! Cp/bk/users01.dbf/u01/tiger/oradata/orcl2/users01.dbf

 

SQL> select * from v $ recover_file;

 

FILE # ONLINE _ error change # TIME

---------------------------------------------------------------

4 OFFLINE 563482 06-SEP-12

 

SQL> select * from v $ recovery_log;

 

THREAD # SEQUENCE # TIME

-----------------------------

ARCHIVE_NAME

Bytes ------------------------------------------------------------------------------------------------------------------------

1 10 06-SEP-12

/U01/tiger/flash_recovery_area/ORCL2/archivelog/2012_09_06/o1_mf_1_10_84jpo5bw _. arc

 

1 11 06-SEP-12

/U01/tiger/flash_recovery_area/ORCL2/archivelog/2012_09_06/o1_mf_1_11_84jpoctx _. arc 

SQL> alter tablespace users online;

Alter tablespace users online

*

ERROR at line 1:

ORA-01113:File 4 needs mediarecovery

ORA-01110:Data file 4: '/u01/tiger/oradata/orcl2/users01.dbf'

SQL>Recoverdatafile 4;

Media recovery complete.

SQL> alter tablespace users online;

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.