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

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

沒有備份、只有歸檔日志,如何恢復(fù)數(shù)據(jù)文件?

2024-07-21 02:08:56
字體:
供稿:網(wǎng)友
沒有備份、只有歸檔日志,如何恢復(fù)數(shù)據(jù)文件?
系統(tǒng)環(huán)境: 1、操作系統(tǒng):windows 2000 server,機(jī)器內(nèi)存128m
2、數(shù)據(jù)庫: oracle 8i r2 (8.1.6) for nt 企業(yè)版
3、安裝路徑:c:/oracle
模擬現(xiàn)象:
可通過重建數(shù)據(jù)文件來恢復(fù),前提是歸檔日志文件保存完整先將數(shù)據(jù)庫設(shè)置為歸檔模式sql*plusconn system/manager--創(chuàng)建實(shí)驗(yàn)表空間create tablespace test datafile'c:/test.ora' size 5mautoextend on next 1m maxsize unlimiteddefault storage (initial 128k next 1m pctincrease 0)/--創(chuàng)建實(shí)驗(yàn)用戶 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;--反復(fù)插入,達(dá)到100萬條commit;--關(guān)閉數(shù)據(jù)庫svrmgr> connect internalsvrmgr> alter system switch logfile;--強(qiáng)制歸檔svrmgr> alter system switch logfile;svrmgr> alter system switch logfile;svrmgr> shutdown--操作系統(tǒng)下刪除test.ora文件--重新啟動數(shù)據(jù)庫svrmgr> connect internalsvrmgr> startup這時,可以mount上,但無法打開,因?yàn)閿?shù)據(jù)文件test.ora不存在,顯示錯誤如下:ora-01157: ????/?????? 8 - ??? dbwr ????ora-01110: ???? 8: 'c:/test.ora'svrmgr> connect internalsvrmgr> startup mountsvrmgr> alter database create datafile 'c:/test.ora';svrmgr> set autorecovery onsvrmgr> recover datafile 'c:/test.ora';svrmgr> alter database open;conn test/testselect count(*) from a;--數(shù)據(jù)又恢復(fù)到100萬條--刪除實(shí)驗(yàn)表空間conn system/manageralter tablespace test offline;drop tablespace test including contents;drop user test;--如果是非歸檔模式,也可以運(yùn)用以上方法,--前提是:輸入記錄所占空間的大小不超過所有聯(lián)機(jī)日志文件的大小--即:用聯(lián)機(jī)日志文件來恢復(fù)
發(fā)表評論 共有條評論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 双辽市| 乐陵市| 千阳县| 当阳市| 红桥区| 南川市| 新巴尔虎右旗| 郑州市| 砀山县| 金门县| 晋宁县| 阳江市| 玉门市| 久治县| 锦屏县| 禄劝| 扬中市| 沧源| 屏山县| 武穴市| 富平县| 姜堰市| 聂荣县| 沙坪坝区| 上思县| 东乡| 凤台县| 昭苏县| 新宁县| 维西| 大同市| 泰宁县| 桂平市| 大埔县| 吉隆县| 利津县| 辽阳县| 正宁县| 大埔区| 格尔木市| 新竹县|