国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發(fā) > 綜合 > 正文

如何使用歸檔日志進行完全恢復

2024-07-21 02:35:41
字體:
供稿:網(wǎng)友

  系統(tǒng)環(huán)境:
  1、操作系統(tǒng):windows 2000 Server,機器內(nèi)存128M
  2、數(shù)據(jù)庫: Oracle 8i R2 (8.1.6) for NT 企業(yè)版
  3、安裝路徑:C:/ORACLE
  
  模擬現(xiàn)象:
  先將數(shù)據(jù)庫設置為歸檔模式
  
  SQL*Plus
  
  --創(chuàng)建實驗表空間
  create tablespace test datafile
  'c:/test.ora' size 5M
  AUTOEXTEND ON NEXT 1M MAXSIZE UNLIMITED
  default storage (initial 128K next 1M pctincrease 0)
  /
  
  --創(chuàng)建實驗用戶
  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;
  
  關閉數(shù)據(jù)庫
  shutdown
  刪除test.ora文件,把test1.ora拷貝為test.ora。
  
  重新啟動數(shù)據(jù)庫
  這時,可以mount上,但無法打開,因為現(xiàn)在使用的數(shù)據(jù)文件是舊的
  只有10萬條記錄,與控制文件中記載的log number不一樣
  
  startup mount
  需要recover database,使數(shù)據(jù)庫記錄重新恢復到當前的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; --數(shù)據(jù)又恢復到20萬條
  
  conn system/manager
  --刪除實驗表空間
  alter tablespace test offline;
  drop tablespace test INCLUDING CONTENTS;

發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 鹤壁市| 清水县| 壤塘县| 东阿县| 会理县| 仙游县| 浦江县| 仲巴县| 灵丘县| 昌江| 德化县| 铜川市| 水城县| 柳州市| 菏泽市| 故城县| 赤城县| 共和县| 萨迦县| 新平| 望都县| 岗巴县| 临猗县| 贵港市| 浮梁县| 方城县| 尉犁县| 北票市| 宁阳县| 广河县| 寿阳县| 台北县| 和顺县| 武功县| 岳阳市| 长丰县| 贡觉县| 长治县| 邢台县| 龙泉市| 清远市|