执行备份:
run {
    allocate channel t1 type disk;    backup
        incremental level 0
        skip inaccessible
        filesperset 6
        format '/opt/oracle/tmp/dbback_132465454_%s_%p_%T_%d'
        AS COMPRESSED backupset
        (database);    sql 'alter system archive log current';    backup
        skip inaccessible
        filesperset 10
        format '/opt/oracle/tmp/arclogback_132465454_%s_%p_%T_%d'
        AS COMPRESSED backupset
        (archivelog all delete input);    crosscheck backup;    delete noprompt obsolete;    release CHANNEL t1;
}执行恢复:
run{
    restore database;
    restore archivelog all;
    recover database;
    sql "alter database open";
}在执行恢复的时候报错:
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00009 to /dev/raw/raw17
channel ORA_DISK_1: reading from backup piece /opt/oracle/tmp/dbback_132465454_33_1_20090918_MDSP
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 09/18/2009 12:57:50
ORA-19870: error while restoring backup piece /opt/oracle/tmp/dbback_132465454_33_1_20090918_MDSP
ORA-19573: cannot obtain exclusive enqueue for datafile 9请问一下出错的原因是什么,

解决方案 »

  1.   

    你不会是在open模式下作数据库恢复吧?
      

  2.   

    不在open下在什么模式下进行?
    难道要在mount模式才可以?去是刚学的
      

  3.   


    可是我改为mount模式恢复的时候,直接报, not connected to ORACLE
      

  4.   


    ORA-19870: error reading backup piece string 
    Cause: This error should be followed by other errors indicating the cause of the problem.
     
    Action: See other errors actions. Do not use message 19871; it is used by RMAN client for testing previous resync time when using backup/standby control file. ORA-19573: cannot obtain string enqueue for datafile string 
    Cause: The file access enqueue could not be obtained for a file specified in a backup, copy or restore operation. If the enqueue type shown is 'shared', then the file is the input file for a backup or copy. If the type is 'exclusive', then the file is the output file for a datafile copy or restore which is attempting to overwrite the currently active version of that file - in this case, the file must be offline or the database must be closed. If the type is 'read-only', then you are attempting to back up or copy this file while the database is in NOARCHIVELOG mode.
     
    Action: Wait until the conflicting operation is complete, then retry the copy or backup. If the database is in NOARCHIVELOG mode, then all files being backed up must be closed cleanly. 
      

  5.   

    执行如下命令:
    RMAN> restore archivelog all;Starting restore at 18-SEP-09
    using channel ORA_DISK_1RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of restore command at 09/18/2009 14:26:47
    RMAN-06026: some targets not found - aborting restore
    RMAN-06025: no backup of archived log for thread 1 with sequence 16 and starting SCN of 970287 found to restore
    RMAN-06025: no backup of archived log for thread 1 with sequence 15 and starting SCN of 969111 found to restore
    RMAN-06025: no backup of archived log for thread 1 with sequence 14 and starting SCN of 969103 found to restore
    RMAN-06025: no backup of archived log for thread 1 with sequence 13 and starting SCN of 966549 found to restore
    RMAN-06025: no backup of archived log for thread 1 with sequence 12 and starting SCN of 966541 found to restore
    请问一下这个错误是由什么引起的
    RMAN-06025: no backup of archived log for thread 1 with sequence 11 and starting SCN of 966401 found to restore
    RMAN-06025: no backup of archived log for thread 1 with sequence 10 and starting SCN of 966393 found to restore
    RMAN-06025: no backup of archived log for thread 1 with sequence 9 and starting SCN of 966253 found to restore
    RMAN-06025: no backup of archived log for thread 1 with sequence 8 and starting SCN of 966245 found to restore
    RMAN-06025: no backup of archived log for thread 1 with sequence 7 and starting SCN of 965971 found to restore
    RMAN-06025: no backup of archived log for thread 1 with sequence 6 and starting SCN of 965963 found to restore
    RMAN-06025: no backup of archived log for thread 1 with sequence 5 and starting SCN of 936423 found to restore
    RMAN-06025: no backup of archived log for thread 1 with sequence 4 and starting SCN of 909959 found to restore
      

  6.   

    当然不能使open了。
    你执行这个命令看看:
    list backupset of archivelog all;
      

  7.   

    ORA-19573: cannot obtain exclusive enqueue for datafil
    应该是和启动有关而第2个
    RMAN-06025: no backup of archived log for thread 1 with sequence 11 and starting SCN of 966401 found to restore ls说的,同意
      

  8.   

    mounted
    select sequence# from v$archived_log;list backup ; search to sequence#+1run{
    set until sequence#  integer_name  thread n;recover database;alter database open resetlogs;
    }