Oracle备份时发生断电的对策

SQL> alter database begin backup;    --开始备份数据库
 
Database altered. 

SQL> host cp /u01/Oracle/oradata/ORCL/*.dbf /u01/oracle/dump1/      --还没执行完毕就断电关机了,abort

在重启数据库的时候,出现的问题
 [root@station88 ~]# su - oracle
 [oracle@station88 ~]$ sqlplus /nolog
 
 SQL*Plus: Release 10.2.0.4.0 - Production on Sat Dec 15 07:51:29 2012
 
 Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.
 
 SQL> conn /as sysdba
 Connected to an idle instance.
 SQL> startup
 ORACLE instance started.
 
 Total System Global Area  373293056 bytes
 Fixed Size                  1267572 bytes
 Variable Size            104859788 bytes
 Database Buffers          264241152 bytes
 Redo Buffers                2924544 bytes
 Database mounted.
 ORA-01113: file 1 needs media recovery
 ORA-01110: data file 1: '/u01/oracle/oradata/ORCL/system01.dbf'
 
 解决方法是:恢复数据文件
 SQL> recover datafile '/u01/oracle/oradata/ORCL/system01.dbf'    --恢复数据文件
 Media recovery complete.
 SQL> alter database open;
 alter database open
 *
 ERROR at line 1:
 ORA-01113: file 2 needs media recovery
 ORA-01110: data file 2: '/u01/oracle/oradata/ORCL/undotbs01.dbf'
 
 
 SQL> recover datafile '/u01/oracle/oradata/ORCL/undotbs01.dbf'
 Media recovery complete.
 SQL> alter database open;
 alter database open
 *
 ERROR at line 1:
 ORA-01113: file 3 needs media recovery
 ORA-01110: data file 3: '/u01/oracle/oradata/ORCL/sysaux01.dbf'
 
 
 SQL> recover datafile '/u01/oracle/oradata/ORCL/sysaux01.dbf'
 Media recovery complete.
 SQL> alter database open;
 alter database open
 *
 ERROR at line 1:
 ORA-01113: file 4 needs media recovery
 ORA-01110: data file 4: '/u01/oracle/oradata/ORCL/users01.dbf'
 
 
 SQL> recover datafile '/u01/oracle/oradata/ORCL/users01.dbf'
 Media recovery complete.
 SQL> alter database open;
 alter database open
 *
 ERROR at line 1:
 ORA-01113: file 5 needs media recovery
 ORA-01110: data file 5: '/u01/oracle/oradata/ORCL/example01.dbf'
 
 
 SQL> recover datafile '/u01/oracle/oradata/ORCL/example01.dbf'
 Media recovery complete.
 SQL> alter database open;
 alter database open
 *
 ERROR at line 1:
 ORA-01113: file 6 needs media recovery
 ORA-01110: data file 6: '/u01/oracle/oradata/ORCL/plsql01.dbf'
 
 
 SQL> recover datafile '/u01/oracle/oradata/ORCL/plsql01.dbf'     
 Media recovery complete.
 SQL> recover datafile '/u01/oracle/oradata/ORCL/dmptest01.dbf'
 Media recovery complete.
 SQL> alter database open;
 
 Database altered.
 
数据库open来就可以了
 
说明:本实验oracle的版本是10.2.0.4.0

相关推荐