ITPub博客

首页 > 数据库 > 数据库开发技术 > COLD BACKUP(二)

COLD BACKUP(二)

原创 数据库开发技术 作者:HuiYiSky 时间:2007-05-09 19:45:29 0 删除 编辑

还原整个数据库!

[@more@]
-- 还原整个数据库 Windows

-- 測試數据 SYS@HUIYI>create table t tablespace tbs01 as select sysdate col01 from dual; Table created. SYS@HUIYI>select * from t; COL01 ----------- 16-Apr-2007 -- 備份 SYS@HUIYI>@cold_backup -- 破坏 SYS@HUIYI>select name from v$datafile; NAME ------------------------------------------------------------------------------------------------------------------------ D:ORACLEORADATAHUIYISYSTEM01.DBF D:ORACLEORADATAHUIYIUNDOTBS01.DBF D:ORACLEORADATAHUIYIDRSYS01.DBF D:ORACLEORADATAHUIYIEXAMPLE01.DBF D:ORACLEORADATAHUIYIINDX01.DBF D:ORACLEORADATAHUIYIODM01.DBF D:ORACLEORADATAHUIYITOOLS01.DBF D:ORACLEORADATAHUIYIUSERS01.DBF D:ORACLEORADATAHUIYIXDB01.DBF D:ORACLEORADATAHUIYITBS01-01.DBF D:ORACLEORADATAHUIYITBS01-02.DBF D:ORACLEORADATAHUIYIPERFSTAT01.DBF 12 rows selected. SYS@HUIYI>shutdown immediate Database closed. Database dismounted. ORACLE instance shut down. SYS@HUIYI>host del D:ORACLEORADATAHUIYITBS01-01.DBF -- 啟動 SYS@HUIYI>startup ORACLE instance started. Total System Global Area 147921840 bytes Fixed Size 453552 bytes Variable Size 109051904 bytes Database Buffers 37748736 bytes Redo Buffers 667648 bytes Database mounted. ORA-01157: cannot identify/lock data file 10 - see DBWR trace file ORA-01110: data file 10: 'D:ORACLEORADATAHUIYITBS01-01.DBF' SYS@HUIYI>shutdown immediate ORA-01109: database not open Database dismounted. ORACLE instance shut down. -- 還原文件 SYS@HUIYI>host copy d:backupcold* d:oracleoradatahuiyi SYS@HUIYI>startup ORACLE instance started. Total System Global Area 147921840 bytes Fixed Size 453552 bytes Variable Size 109051904 bytes Database Buffers 37748736 bytes Redo Buffers 667648 bytes Database mounted. Database opened. SYS@HUIYI>select * from t; COL01 ----------- 16-Apr-2007
-- 还原整个数据库 Linux
-- 測試數据 SYS@huiyi>create table t tablespace tbs01 as select sysdate col01 from dual; Table created. SYS@huiyi>select * from t; COL01 --------- 16-APR-07 -- 備份 [huiyi.local@huiyi sh]$ sh cold_backup.sh -- 破坏 [huiyi.local@huiyi sh]$ rm -f $ORACLE_BASE/oradata/huiyi/tbs* -- 啟動 SYS@huiyi>startup force ORACLE instance started. Total System Global Area 236000356 bytes Fixed Size 451684 bytes Variable Size 201326592 bytes Database Buffers 33554432 bytes Redo Buffers 667648 bytes Database mounted. ORA-01157: cannot identify/lock data file 10 - see DBWR trace file ORA-01110: data file 10: '/opt/oracle/oradata/huiyi/tbs01-01.dbf' -- 還原文件 SYS@huiyi>shutdown immediate ORA-01109: database not open Database dismounted. ORACLE instance shut down. [huiyi.local@huiyi ~]$ cp -f /backup/cold/* $ORACLE_BASE/oradata/huiyi/ -- 啟動 SYS@huiyi>startup ORACLE instance started. Total System Global Area 236000356 bytes Fixed Size 451684 bytes Variable Size 201326592 bytes Database Buffers 33554432 bytes Redo Buffers 667648 bytes Database mounted. Database opened. SYS@huiyi>select * from t; COL01 --------- 16-APR-07

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/8799875/viewspace-914230/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: COLD BACKUP(一)
下一篇: COLD BACKUP(三)
请登录后发表评论 登录
全部评论

注册时间:2007-12-14

  • 博文量
    39
  • 访问量
    338055