Oracle基於使用者管理的不完全恢複(五)誤刪除資料表空間

來源:互聯網
上載者:User

案例4——誤刪除資料表空間(有備份)

通過備份的控制檔案找到與資料表空間有關的資訊進行恢複,因為新的控制檔案裡面已經沒有該資料表空間的資訊了。實際上在整個恢複過程中還是利用歸檔日誌進行恢複,如果刪除資料表空間之前的操作有及時寫入到歸檔資訊,就會全部恢複出來。下面的案例分切換日誌和不切換日誌兩種。

1、基於backup control 的不完全恢複

SQL> select file_id,file_name,tablespace_name from dba_data_files;

FILE_ID FILE_NAME                                          TABLESPACE_NAME

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

5 /u01/app/oracle/oradata/anny/text01.dbf            TEXT

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

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

2 /u01/app/oracle/oradata/anny/lx02.dbf              LX02

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

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

7 /u01/app/oracle/oradata/anny/undotbs01.dbf         UNDOTBS

8 /u01/app/oracle/oradata/anny/lx03.dbf              LX03

9 /u01/app/oracle/oradata/anny/lx04.dbf              LX04

10 /u01/app/oracle/oradata/anny/index01.dbf           INDEXES

10 rows selected.

SQL> conn scott/tiger

SQL> select table_name,tablespace_name from user_tables;

TABLE_NAME                     TABLESPACE_NAME

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

DEPT                           USERS

EMP                            USERS

BONUS                          USERS

SALGRADE                       USERS

EMPLOYEES                      USERS

EMP2                           USERS

TB01                           TEXT

ADMIN_EXT_EMPLOYEES

EMP1                           USERS

9 rows selected.

SQL> select * from tb01;

ID

----------

1

2

3

SQL> insert into tb01 select * from tb01;

3 rows created.

SQL> select * from tb01;

ID

----------

1

2

3

1

2

3

6 rows selected.

SQL> commit;

Commit complete.

——產生控制檔案備份

SQL> conn /as sysdba

Connected.

SQL> alter database backup controlfile to '/disk1/backup/anny/anny_control.bak';

Database altered.

——不切換日誌

SQL> insert into scott.tb01 values(4);

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.