ORACLE 9I 删除列以后怎么恢复数据

论坛上有位朋友提到:
“删除列以后怎么恢复数据

ora9i 数据库里面
有个朋友误操作,执行了
alter table xxx drop column xxx_col
被删除的列是有值的,
现在怎么才能找回来被删掉的列的值。

俺试了logmgr,可惜只能找到alter table的信息,
请大家看看有什么办法。”
===========================
下面我们就做个测试,呵呵
SQL> select * from v$version;

BANNER
----------------------------------------------------------------
Oracle9i Enterprise Edition Release 9.2.0.4.0 - 64bit Production
PL/SQL Release 9.2.0.4.0 - Production
CORE 9.2.0.3.0 Production
TNS for Linux: Version 9.2.0.4.0 - Production
NLSRTL Version 9.2.0.4.0 - Production

1.创建一张测试表
SQL> create table t (a number,b number);

Table created.

SQL> insert into t values (1,2);

1 row created.

SQL> /

1 row created.

SQL> /

1 row created.

SQL> commit;

Commit complete.

2。取得当前scn

SQL> col scn for 999999999999999999999
SQL> select dbms_flashback.get_system_change_Number scn from dual;

SCN
----------------------
306920
3.使用闪回查询
SQL> select * from t as of scn 306920;

A B
---------- ----------
1 2
1 2
1 2
可以看到在scn为306920有2列3行数据。
4。删除其中一列数据
SQL> alter table t drop column a;

Table altered.
5.再次使用闪回查询

SQL> select * from t as of scn 306920;
select * from t as of scn 306920
*
ERROR at line 1:
ORA-01466: unable to read data - table definition has changed
很显然,闪回查询不支持,因为此时表结构已经发生了变化。
发生这种情况,9i只能使用不完全恢复,恢复到306920,将数据库read only,然后导出表格T。10g碰到这种情况方便许多了,在闪回打开的情况下,只需要将数据库闪回到306920 read only打开即可。
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值