Oracle RMAN完全恢複案例(三)資料表空間資料檔案全部丟失

來源:互聯網
上載者:User

案例3:

--資料表空間資料檔案全部丟失,恢複資料檔案(open)

1)測試環境

07:37:23 SQL> insert into scott.test values (6);

1 row created.

07:39:18 SQL> insert into scott.test values (7);

1 row created.

07:39:20 SQL> insert into scott.test values (8);

1 row created.

07:39:21 SQL> commit;

Commit complete.

07:39:23 SQL> select * from scott.test;

ID

----------

6

7

8

1

2

3

4

5

8 rows selected.

07:40:06 SQL>

----在open 狀態下datafile 被破壞

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

[oracle@work ~]$

07:41:19 SQL> alter system flush buffer_cache;

System altered.

07:41:25 SQL> conn scott/tiger

Connected.

07:41:28 SQL>

本欄目更多精彩內容:http://www.bianceng.cn/database/Oracle/

07:41:28 SQL> insert into scott.test values (10);

insert into scott.test values (10)

*

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

07:41:31 SQL>

2)利用rman 恢複

RMAN> run {

2> sql 'alter database datafile 6,8 offline';

3> restore datafile 6,8;

4> recover datafile 6,8;

5> sql 'alter database datafile 6,8 online';

6> }

3)驗證

07:41:31 SQL> insert into scott.test values (10);

1 row created.

07:45:58 SQL> commit;

Commit complete.

07:46:01 SQL> select * from test;

ID

----------

10

6

7

8

9

1

2

3

4

5

10 rows selected.

07:46:04 SQL>

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.