案例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);