Case 2:recover tablespace (recover tablespace (delete all datafile of tablespace))
When you delete a data file in Guanqu state, this restores: Dumps the datafile, makes the missing datafile offline, recover tablespace
(1) Simulation environment
Sql> Conn Scott/tiger
Connected.
Sql> Col tname for A30
Sql> select * from tab;
Tname Tabtype Clusterid
------------------------------ --------------------- ----------
DEPT TABLE
EMP TABLE
BONUS TABLE
Salgrade TABLE
EMP1 TABLE
Admin_ext_employees TABLE
EMPLOYEES TABLE
EMP2 TABLE
TB01 TABLE
9 rows selected.
Sql> select * from TB01;
Id
----------
1
2
3
sql> INSERT INTO TB01 values (4);
1 row created.
sql> INSERT into TB01 values (5);
1 row created.
sql> INSERT INTO TB01 values (6);
1 row created.
Sql> commit;
Commit complete.
Sql> select * from TB01;
Id
----------
1
2
3
4
5
6
6 rows selected.
sql> shutdown abort;
ORACLE instance shut down.
Sql>!
[ORACLE@SOLARIS10 ~] $rm/u01/app/oracle/oradata/anny/test*.dbf--Delete data file in Guanqu state
(2) Start the database
Sql> Startup
ORACLE instance started.
Total System Global area 314572800 bytes
Fixed Size 1279964 bytes
Variable Size 58722340 bytes
Database buffers 251658240 bytes
Redo buffers 2912256 bytes
Database mounted.
Ora-01157:cannot identify/lock data file 5-see DBWR trace file
Ora-01110:data file 5: '/U01/APP/ORACLE/ORADATA/ANNY/TEST01.DBF '
Sql> select File#,error from V$recover_file;
file# ERROR
---------- -----------------------------------------------------------------
5 FILE not FOUND
One FILE not FOUND
(3) Dump data files
[Oracle@solaris10 Cold_bak] $CP/disk1/backup/anny/cold_bak/test*.dbf/u01/app/oracle/oradata/anny/
(4) Data file offline
This article URL address: http://www.bianceng.cn/database/Oracle/201410/45393.htm