Oracle Manual Full Recovery (iv) database recover data files in open state

Source: Internet
Author: User
Tags commit manual

Case 3: (Recover tablespace, database open state)

--database Recover data files in open state (except system tablespace)

(1) Simulation Environment:

06:10:52 sql> INSERT INTO scott.t01 values (4);

1 row created.

06:13:12 sql> INSERT INTO scott.t01 values (5);

1 row created.

06:13:13 sql> INSERT INTO scott.t01 values (6);

1 row created.

06:13:15 sql> commit;

Commit complete.

06:13:17 sql> SELECT * from scott.t01;

Id

----------

1

2

3

4

5

6

6 rows selected.

--delete datafile in open state

[Oracle@work ~]$ rm/u01/app/oracle/oradata/prod/test*.dbf

[Oracle@work ~]$

Sql> select * from SCOTT.TB01;

Id

----------

1

2

3

4

5

6

7

8

8 rows selected.

Sql> alter system flush Buffer_cache; Clear Data buffer

System altered.

Sql> select * from SCOTT.DB01;

SELECT * FROM SCOTT.DB01

*

ERROR at line 1:

Ora-00942:table or view does not exist

06:15:09 sql> SELECT * from scott.t01;

SELECT * FROM scott.t01

*

ERROR at line 1:

Ora-01116:error in opening database file 8

Ora-01110:data file 8: '/U01/APP/ORACLE/ORADATA/PROD/TEST02.DBF '

Ora-27041:unable to open File

Linux error:2: No such file or directory

Additional Information:3

This article URL address: http://www.bianceng.cn/database/Oracle/201410/45394.htm

(2) View datafile information

Sql> Select A.name,b.file#,b.name from v$tablespace a,v$datafile b where a.ts#=b.ts#;

Name file# name

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

SYSTEM 1/u01/app/oracle/oradata/anny/system01.dbf

Sysaux 3/u01/app/oracle/oradata/anny/sysaux01.dbf

USERS 4/u01/app/oracle/oradata/anny/user01.dbf

TEST 11/u01/app/oracle/oradata/anny/test02.dbf

TEST 5/u01/app/oracle/oradata/anny/test01.dbf

LX01 6/u01/app/oracle/oradata/anny/lx01.dbf

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.