WEB开发网
开发学院数据库Oracle ORACLE备份&恢复案例 阅读

ORACLE备份&恢复案例

 2008-09-09 12:52:46 来源:WEB开发网   
核心提示: 2、备份数据库SQL> @hotbak.sql 或在DOS下 svrmgrl @hotbak.sql3、继续在测试表中插入记录SQL> insert into test values(2);1 row insertedSQL> commit;Commit complete

2、备份数据库

SQL> @hotbak.sql 或在DOS下 svrmgrl @hotbak.sql

3、继续在测试表中插入记录

SQL> insert into test values(2);
1 row inserted
SQL> commit;
Commit complete
SQL> select * from test;
A
---------------------------------------
1
2
SQL> alter system switch logfile;
System altered.
SQL> alter system switch logfile;
System altered.

4、关闭数据库,模拟丢失数据文件

SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down
C:>del D:ORACLEORADATATESTUSERS01.DBF

模拟媒体毁坏

5、启动数据库错误,脱机该数据文件

SQL> startup
ORACLE instance started.
Total System Global Area 102020364 bytes
Fixed Size 70924 bytes
Variable Size 85487616 bytes
Database Buffers 16384000 bytes
Redo Buffers 77824 bytes
Database mounted.
ORA-01157: cannot identify/lock data file 3 - see DBWR trace file
ORA-01110: data file 3: 'D:ORACLEORADATATESTUSERS01.DBF'

还可以查看报警文件(见上一个恢复案例)或动态视图v$recover_file

如SQL> select * from v$recover_file;

FILE# ONLINE ERROR CHANGE# TIME

---------- ------- ------------------ ---------- -----------

3 ONLINE 1013500 2003-05-07

脱机数据文件

SQL> alter database datafile 3 offline drop;
Database altered.

上一页  3 4 5 6 7 8 9 10  下一页

Tags:ORACLE 备份 amp

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接