this is a extra element for clear the floated element
如何使用归档日志进行完全恢复?
  • 12/31
  • 2008
备份恢复 | Oracle 850 次查看
  系统环境:

  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/test

  create 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;

  
您可能感兴趣的:

更多相关内容