欢迎投稿

今日深度:

oracleflashback——oracle数据闪回实战,及恢复数据

oracleflashback——oracle数据闪回实战,及恢复数据到指定的时间戳——timestamp


Microsoft Windows [版本 6.1.7601]
版权所有 (c) 2009 Microsoft Corporation。保留所有权利。

C:\Users\ckz>sqlplus zzjd/zzjd@10.22.1.143/orcl as sysdba;

SQL*Plus: Release 11.2.0.1.0 Production on 星期三 5月 13 17:00:46 2015

Copyright (c) 1982, 2010, Oracle.  All rights reserved.


连接到:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> SHUTDOWN IMMEDIATE;
数据库已经关闭。
已经卸载数据库。
ORACLE 例程已经关闭。
SQL> startup MOUNT;
ORACLE 例程已经启动。

Total System Global Area 1071333376 bytes
Fixed Size                  1375792 bytes
Variable Size             713032144 bytes
Database Buffers          352321536 bytes
Redo Buffers                4603904 bytes
数据库装载完毕。
SQL> flashback database to scn 119272598;

闪回完成。

SQL> alter database open;
alter database open
*
第 1 行出现错误:
ORA-01589: 要打开数据库则必须使用 RESETLOGS 或 NORESETLOGS 选项


SQL> alter database open noresetlogs;
alter database open noresetlogs
*
第 1 行出现错误:
ORA-01610: 使用 BACKUP CONTROLFILE 选项的恢复必须已完成


SQL> alter database open resetlogs;

数据库已更改。

SQL>

查看可恢复的时间戳或SCN点,执行下列SQL语句:

select scn,to_char(time_dp,'yyyy-mm-dd hh24:mi:ss')from sys.smon_scn_time order by to_char(time_dp,'yyyy-mm-dd hh24:mi:ss') desc;

不推荐使用上述此方法恢复数据。

方法二:

在操作恢复数据表之前,先将要恢复的数据表清空,以免恢复时数据发生冲突

delete t_viradsl2 

insert into t_viradsl2 select * from t_viradsl2 as of timestamp to_Date('2011-01-19 15:28:00', 'yyyy-mm-dd hh24:mi:ss') 


www.htsjk.Com true http://www.htsjk.com/oracle/23319.html NewsArticle oracleflashback——oracle数据闪回实战,及恢复数据到指定的时间戳——timestamp Microsoft Windows [版本 6.1.7601]版权所有 (c) 2009 Microsoft Corporation。保留所有权利。C:\Users\ckzsqlplus zzjd/zzjd@10.22.1....
评论暂时关闭