我现在是在aix 操作系统上面oracle9。0。2。1。0操作,不小心把数据库中一个表通过PLSQL,运行创建表结构的SQL语句,把原来表中的数据和表空间,索引都覆盖了,请问有什么办法解决吗?(有一个7月10号的冷备份,有归档日志)
各位DBA高手,如果能够解决这个问题,不盛感激,有什么好的方法可以联系:
[email protected], 0752-2611998 曾铁环
各位DBA高手,如果能够解决这个问题,不盛感激,有什么好的方法可以联系:
[email protected], 0752-2611998 曾铁环
1、操作系统:Windows 2000 Server,机器内存128M
2、数据库: Oracle 8i R2 (8.1.6) for NT 企业版
3、安装路径:C:\ORACLE模拟现象: 先将数据库设置为归档模式SQL*Plus--创建实验表空间
create tablespace test datafile
'c:\test.ora' size 5M
AUTOEXTEND ON NEXT 1M MAXSIZE UNLIMITED
default storage (initial 128K next 1M pctincrease 0)
/--创建实验用户
drop user test cascade;
create user test identified by test default tablespace test;
grant connect,resource to test;
conn test/testcreate table a(a number);
insert into a values(1);
insert into a select * from a; --反复插入,达到10万条
commit;拷贝test.ora为test1.ora文件
insert into a select * from a; --20万条
commit;关闭数据库
shutdown
删除test.ora文件,把test1.ora拷贝为test.ora。重新启动数据库
这时,可以mount上,但无法打开,因为现在使用的数据文件是旧的
只有10万条记录,与控制文件中记载的log number不一样startup mount
需要recover database,使数据库记录重新恢复到当前的20万条C:\>svrmgrl
svrmgrl>connect internal
svrmgrl>shutdown
svrmgrl>startup mount
svrmgrl>set autorecovery on
svrmgrl>recover database;
svrmgrl>alter database open;conn test/test
select count(*) from a; --数据又恢复到20万条conn system/manager
--删除实验表空间
alter tablespace test offline;
drop tablespace test INCLUDING CONTENTS;
把7月10号数据库冷备份恢复
然后
sqlplus /nolog
sql>conn /as sysdba
sql>shutdown
sql>startup mount
sql>recover database until time '2004-07-15:17:50:50';
sql>alter database open resetlogs;
[email protected]