You opened an RMAN session for the database. To repair the failure, you executed the following Starting backup at 13-SEP-13
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=67 device type=DISK
truncated zip file怎么解决channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00004 name=/u01/app/oracle/oradata/test0910/users01.dbf channel ORA_DISK_1: starting piece 1 at 13-SEP-13
channel ORA_DISK_1: finished piece 1 at 13-SEP-13
piece
handle=/u01/app/oracle/fast_recovery_area/TEST0910/backupset/2013_09_13/o1_mf_nnndf_T AG2013
0913T111426_936byprm _.bkp tag=TAG20130913T111426 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15
Finished backup at 13-SEP-13
3、操作系统删除users.dbf文件
[oracle@rtest ~]$ rm -rf /u01/app/oracle/oradata/test0910/users01.dbf
[oracle@rtest ~]$ ls /u01/app/oracle/oradata/test0910/users01.dbf
ls: /u01/app/oracle/oradata/test0910/users01.dbf: No such file or directory
4、shutdown abort模拟数据库宕机并startup,发现错误与题目一样
sys@TEST0910> shutdown abort;
ORACLE instance shut down.
sys@TEST0910> startup
ORACLE instance started.
Total System Global Area 2505338880 bytes
Fixed Size                  2230952 bytes
Variable Size            553649496 bytes
Database Buffers        1929379840 bytes
Redo Buffers              20078592 bytes
Database mounted.
ORA-01157: cannot identify/lock data file 4 - see DBWR trace file
ORA-01110: data file 4: '/u01/app/oracle/oradata/test0910/users01.dbf'
5、进入rman,修复失败。
RMAN> repair failure ;
using target database control file instead of recovery catalog
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of repair command at 09/13/2013 11:20:04
RMAN-06954: REPAIR command must be preceded by ADVISE command in same session
在试图没有进行advise failure命令时使用repair failure,则报错。
主要原因为:在repair failure之前,要先运行advise failure,让rman给出修复的建议,并给出修复的脚本,之后再运行repair failure
6、按照提示,进行advise命令。
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of advise command at 09/13/2013 11:20:59
RMAN-07211: failure option not specified
为什么也报错呢?原因为在advise failure之前,要先运行list failure,列出所要修复的错误,所以先list failure。
7、运行LIST-->ADVISE-->REPAIR 命令
RMAN> list failure;
List of Database Failures
=========================
Failure ID Priority Status    Time Detected Summary
---------- -------- --------- ------------- -------
122        HIGH    OPEN      13-SEP-13    One or more non-system datafiles are missing
RMAN> advise failure;
List of Database Failures
=========================
Failure ID Priority Status    Time Detected Summary
---------- -------- --------- ------------- -------
122        HIGH    OPEN      13-SEP-13    One or more non-system datafiles are missing
analyzing automatic repair options; this may take some time
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=189 device type=DISK
analyzing automatic repair options complete
Mandatory Manual Actions
========================
no manual actions available
Optional Manual Actions
=======================
1. If file /u01/app/oracle/oradata/test0910/users01.dbf was unintentionally renamed or moved, restore it
Automated Repair Options
========================
Option Repair Description
------ ------------------
1      Restore and recover datafile 4
Strategy: The repair includes complete media recovery with no data loss
Repair script: /u01/app/oracle/diag/rdbms/test0910/test0910/hm/reco_3910127882.hm advise failure命令对记录在自动诊断信息库中的所有故障给出建议。默认时,此命令只列出具有critical或high优先级的那些故障。除了产生所有输入故障的摘要外,此命令还对每个故障提供一个建议修复选项。通常,advise failure命令同时给出自动和手动修复选项。在advisefailure命令输出结束时,RMAN生成一个脚本,列出建议的修复选项的细节。如果你想自己进行修复,可以直接使用这个脚本,或者对它进行修改。
Strategy: The repair includes complete media recovery with no data loss
Repair script: /u01/app/oracle/diag/rdbms/test0910/test0910/hm/reco_3910127882.hm contents of repair script:
# restore and recover datafile
restore datafile 4;
recover datafile 4;
sql 'alter database datafile 4 online';
Do you really want to execute the above repair (enter YES or NO)? Y
executing repair script
Starting restore at 13-SEP-13
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
直接路径加载与常规路径加载的比较
常规路径加载通过执行SQL INSERT语句,将表填充到Oracle DB 中。直接路径加载通过格式化Oracle 数据块并将其直接写入数据库文件,消除了大部分Oracle DB 开销。直接加载不与其他用户争用数据库资源,因此其数据加载速度通常与磁盘速度相差无几。

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。