误删数据库所有文件后恢复
2012-07-23 08:50:14 来源:WEB开发网核心提示: 1.插入两行数据SQL> insert into t2 values (33,'cc');SQL> commit;SQL> alter system switch logfile;SQL> insert into t2 values(44,'dd');SQL&g
1.插入两行数据
SQL> insert into t2 values (33,'cc');
SQL> commit;
SQL> alter system switch logfile;
SQL> insert into t2 values(44,'dd');
SQL> commit;
2.正常关闭数据库
SQL>shutdown immediate
3.在操作系统下删除所有的控制文件 数据文件 联机日志等但是要保留归档日志,且之前做过完整备份
$rm –rf *.ctl
$rm –rf *.log
$rm –rf *.dbf
4.启动数据库到NOMOUNT状态
Sql>startup nomount
5.恢复控制文件
Rman>restore controlfile from autobackup;
6.启动数据库到MOUNT状态
Rman>alter database mount;
7.恢复数据库
Rman>restore database;
Rman>recover database;
Rman>alter database open resetlogs;