注意:虽然现在Flashback到一个旧的版本,但是由于并没有发生读写操作(Read Only)。所以原有数据库的归档日志依然是可用的,当前数据库依然是在一个原有的运行路径上。所以,才存在通过“应用”archive redo log,将数据恢复到原有状态的机会。
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.
Total System Global Area 372449280 bytes
Fixed Size 1364732 bytes
Variable Size 289410308 bytes
Database Buffers 75497472 bytes
Redo Buffers 6176768 bytes
Database mounted.
SQL> recover database;
Media recovery complete.
SQL> alter database open;
Database altered.
将exp导出的文件数据表,导入到数据库中。
[oracle@SimpleLinux ~]$export NLS_LANG=american_america.al32utf8
[oracle@SimpleLinux ~]$ imp \"/ as sysdba\" file=scott_part.dmp fromuser=test touser=test
Import: Release 11.2.0.4.0 - Production on Fri Jun 19 14:27:49 2015
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - Production
With the Partitioning, Oracle Label Security, OLAP, Data Mining
and Real Application Testing options
Export file created by EXPORT:V11.02.00 via conventional path
import done in AL32UTF8 character set and AL16UTF16 NCHAR character set
. importing TEST's objects into TEST
. . importing table "EMP" 14 rows imported
. . importing table "DEPT" 4 rows imported
About to enable constraints...
Import terminated successfully without warnings.
[oracle@SimpleLinux ~]$
确认数据情况。
SQL> select owner, tablespace_name, segment_name from dba_segments where owner='TEST';
OWNER TABLESPACE_NAME SEGMENT_NAME
------------------------------ ------------------------------ -------------------------------
TEST TESTTBL PK_DEPT
TEST TESTTBL PK_EMP
TEST TESTTBL BIN$GNiF1FvbCgngVQAAAAAAAQ==$0
TEST TESTTBL BIN$GNiF1FveCgngVQAAAAAAAQ==$0
TEST TESTTBL DEPT
TEST TESTTBL EMP
TEST TESTTBL BIN$GNiF1FvcCgngVQAAAAAAAQ==$0
TEST TESTTBL BIN$GNiF1FvfCgngVQAAAAAAAQ==$0
TEST TESTTBL SALGRADE
9 rows selected
SQL> purge dba_recyclebin;
Done
SQL> select owner, tablespace_name, segment_name from dba_segments where owner='TEST';
OWNER TABLESPACE_NAME SEGMENT_NAME
------------------------------ ------------------------------ ------------------------
TEST TESTTBL PK_DEPT
TEST TESTTBL PK_EMP
TEST TESTTBL DEPT
TEST TESTTBL EMP
TEST TESTTBL SALGRADE
恢复成功。
5、结论