This discussion is archived
1 2 3 Previous Next 32 Replies Latest reply: Jun 19, 2009 10:20 AM by jgarry Go to original post RSS
  • 15. Re: backup with rman
    581585 Newbie
    Currently Being Moderated
    Ok, then I let this job for late, because in these days I don't shutdown my database.

    Yesterday, my database execute the incremental database backup script but the output of rman says me one block corrupt, again. I add the following line to my script:

    SET MAXCORRUPT FOR DATAFILE 1 to 2;

    So, my complete script for incremental backup is:

    +# Script para copia de seguridad Incremental Oracle (Junio 2009)+

    +# especificamos bloques corruptos para el datafile 1 (system)+
    SET MAXCORRUPT FOR DATAFILE 1 to 2;*

    +# Especificamos una politica de retencion de 5 dias+
    CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 5 DAYS;

    +# Copiamos el controlfile+
    CONFIGURE CONTROLFILE AUTOBACKUP ON;

    +# Creamos backup incrementales de tipo acumulativo+
    backup incremental level 1 cumulative device type disk tag '%TAG' database;

    +#Copiamos todos los archivelogs y los eliminamos de sus ubicaciones una vez copiado+
    backup device type disk tag '%TAG' archivelog all not backed up delete all input;

    +# Hacemos un crosscheck de las copias de seguridad, para comparar lo que tenemos en disco con lo del catalogo+
    CROSSCHECK BACKUP;

    +# Eliminamos los backups antiguos+
    DELETE NOPROMPT EXPIRED BACKUP;
    DELETE NOPROMPT OBSOLETE DEVICE TYPE DISK;

    +#Hacemos lo mismo para los archivelog (realmente lo deberia de haber hecho antes, pero asi nos aseguramos)+
    CROSSCHECK  ARCHIVELOG ALL;
    DELETE NOPROMPT EXPIRED ARCHIVELOG ALL;

    release channel;

    In the output I can see this:
    RMAN-03031: this option of set command needs to be used inside a run block

    I must include a run for SET MAXCORRUPT FOR DATAFILE 1 to 2 ?

    Can I include a run {} inside of my script?
    If yes it, my script will be this?


    +# Script para copia de seguridad Incremental Oracle (Junio 2009)+

    +# especificamos bloques corruptos para el datafile 1 (system)+
    *run {*
    SET MAXCORRUPT FOR DATAFILE 1 to 2;*
    *}*
    +# Especificamos una politica de retencion de 5 dias+
    CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 5 DAYS;

    +# Copiamos el controlfile+
    CONFIGURE CONTROLFILE AUTOBACKUP ON;

    +# Creamos backup incrementales de tipo acumulativo+
    backup incremental level 1 cumulative device type disk tag '%TAG' database;

    +#Copiamos todos los archivelogs y los eliminamos de sus ubicaciones una vez copiado+
    backup device type disk tag '%TAG' archivelog all not backed up delete all input;

    +# Hacemos un crosscheck de las copias de seguridad, para comparar lo que tenemos en disco con lo del catalogo+
    CROSSCHECK BACKUP;

    +# Eliminamos los backups antiguos+
    DELETE NOPROMPT EXPIRED BACKUP;
    DELETE NOPROMPT OBSOLETE DEVICE TYPE DISK;

    +#Hacemos lo mismo para los archivelog (realmente lo deberia de haber hecho antes, pero asi nos aseguramos)+
    CROSSCHECK  ARCHIVELOG ALL;
    DELETE NOPROMPT EXPIRED ARCHIVELOG ALL;

    release channel;


    Thanks you very much, again!!!
  • 16. Re: backup with rman
    FlorianW. Expert
    Currently Being Moderated
    Hi roberto1979es!

    the SET MAXCORRUPT FOR DATAFILE command has to used within a RUN block. That's right. But you have to know that every thing that you declare within a RUN block has a livecycle that ends with the ending of the RUN block. So your script should look like that:
    # Script para copia de seguridad Incremental Oracle (Junio 2009)
    
    # Especificamos una politica de retencion de 5 dias
    CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 5 DAYS;
    # Copiamos el controlfile
    CONFIGURE CONTROLFILE AUTOBACKUP ON;
    
    RUN {
    # especificamos bloques corruptos para el datafile 1 (system)
    SET MAXCORRUPT FOR DATAFILE 1 to 2;
    
    # Creamos backup incrementales de tipo acumulativo
    BACKUP INCREMENTAL LEVEL 1 CUMULATIVE
    DEVICE TYPE disk 
    TAG '%TAG' database;
    
    #Copiamos todos los archivelogs y los eliminamos de sus ubicaciones una vez copiado
    BACKUP 
    DEVICE TYPE disk 
    TAG '%TAG' 
    archivelog all NOT BACKED UP
    DELETE ALL INPUT;
    }
    
    # Hacemos un crosscheck de las copias de seguridad, para comparar lo que tenemos en disco con lo del catalogo
    CROSSCHECK BACKUP;
    
    # Eliminamos los backups antiguos
    DELETE NOPROMPT EXPIRED BACKUP;
    DELETE NOPROMPT OBSOLETE DEVICE TYPE DISK;
    
    #Hacemos lo mismo para los archivelog (realmente lo deberia de haber hecho antes, pero asi nos aseguramos)
    CROSSCHECK ARCHIVELOG ALL;
    DELETE NOPROMPT EXPIRED ARCHIVELOG ALL;
    If you don't include the BACKUP command in your RUN block then the SET MAXCORRUPT will have no effect on your backups.

    Another thing is the usage of the CONFIGURE commands. CONFIGURE is used to configure your RMAN environment. E. g. once you have enable CONTROLFILE AUTOBACKUP this option is saved within your controlfile (RMAN repository). You don't have to enable it again.

    Yours sincerely

    Florian W.

    P. S. Please include code and scripts in your further posts in
     tags for a better readability. One tag in front of the script and one behind your script.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
  • 17. Re: backup with rman
    26741 Oracle ACE
    Currently Being Moderated
    You shouldn't be ignoring the corrupt block in the SYSTEM datafile !

    Use MetaLink Note#28814.1 as a reference to handling Block Corruption.
  • 18. Re: backup with rman
    581585 Newbie
    Currently Being Moderated
    Ok, I read it. In that document say that is corrupt block belong to user sys, we have to ask to Oracle, so I do a SR to Oracle, but they don't answear it, yet. I'm waiting for an answear.

    Anyway, anyone can help me why my script for backup produce the warning
    rman-08591: WARNING: invalid archivelog deletion policy
    ??

    Edited by: roberto1979es on 15-jun-2009 8:17
  • 19. Re: backup with rman
    26741 Oracle ACE
    Currently Being Moderated
    Error
    RMAN-08591: WARNING: invalid archivelog deletion policy
    would occur if you have a Standby Database but have not defined any log_archive_dest as MANDATORY
  • 20. Re: backup with rman
    581585 Newbie
    Currently Being Moderated
    Yes, but I don't have any standby database. I multiplex in 3 locations archivelog destination, but NO standby database.
  • 21. Re: backup with rman
    26741 Oracle ACE
    Currently Being Moderated
    Do a "SHOW ALL" in RMAN to check what "ARCHIVELOG DELETION POLICY" has been configured.

    If you don't have a Standby, then this should be NONE.

    If it has been set, you can clear it with

    CONFIGURE ARCHIVELOG DELETION POLICY CLEAR;
  • 22. Re: backup with rman
    581585 Newbie
    Currently Being Moderated
    Ok, effectively I have
    CONFIGURE ARCHIVELOG DELETION POLICY TO APPLIED ON STANDBY;

    then I do
    CONFIGURE ARCHIVELOG DELETION POLICY CLEAR;

    and now I have
    CONFIGURE ARCHIVELOG DELETION POLICY TO NONE;

    Now I can not do my backup, so tomorro I'll see the output of my rman script.

    THANKS YOU VERY MUCH!!
  • 23. Re: backup with rman
    581585 Newbie
    Currently Being Moderated
    Ok, today I check the output of my rman script and it works fine, today none errors none warnings.

    Thanks you very muchh.
  • 24. Re: backup with rman
    26741 Oracle ACE
    Currently Being Moderated
    Good.

    Watch your backups over the next few days.
  • 25. Re: backup with rman
    581585 Newbie
    Currently Being Moderated
    Yes, i'm watching my backups every day.
    Now, my database is ok, except one block corrupt in tablespace system. I ask to Oracle, but they don't answer it yet.

    However, if my database crash, how can I do my recover and restore my database?

    In this thread are my two scripts (full and incremental), so, attendance to that script, Howto restore my database for minimal loss of data in case of a crash??
  • 26. Re: backup with rman
    26741 Oracle ACE
    Currently Being Moderated
    It would be a
    RESTORE SPFILE
    STARTUP NOMOUNT
    RESTORE CONTROLFILE
    ALTER DATABASE MOUNT
    RESTORE DATABASE
    RECOVER DATABASE
    It is the RESTORE DATABASE portion in RMAN that will figure out which are the latest full backups and restore them and then the latest incremental backups since then and restore them.

    Thus if you have Full Backups on Sunday and Daily Incremental Backups and you lose your Database on Thursday, Oracle would restore Sunday's Full Backup and then Wednesday's Incremental Backup. Thereafter, ArchiveLogs since Wednesday night would be restored and applied in the RECOVER.
  • 27. Re: backup with rman
    tychos Expert
    Currently Being Moderated
    Hi roberto1979es ,
    Just to know which object is effected by the corrupt block can you post the output of the following sql?
    < select * from dba_extents where FILE_ID =1 and block_id=12454; >

    Regards,

    Tycho
  • 28. Re: backup with rman
    jgarry Guru
    Currently Being Moderated
    What would happen with a recovery window of 5 days and a recovery on saturday?
  • 29. Re: backup with rman
    26741 Oracle ACE
    Currently Being Moderated
    The RECOVERY WINDOW is part of the RETENTION POLICY.

    If you have defined a RECOVERY WINDOW of 5 days and you do daily Full Backups or Full backups every 2/3 days, backups older than 5 days would be OBSOLETE.
    However, if you do only Weekly Full Backups, the Full Backup of last Sunday is not OBSOLETEd (even though it apparently is beyond the 5 days window). Oracle expects that backup to be available.
    However, if you have moved it off-disk then you need to manually restore that backup to disk first before the RESTORE DATABASE acts on it.

    Therefore, to answer your question : Even if the RECOVERY WINDOW is 5 days, if my last (or "latest") Full Backup is of 6 or 7 days ago, that backup is NOT Obsoleted by Oracle and is used for the the RESTORE. Of course, Oracle would then, in my example above, apply Friday's Incremental Backup and then roll-forward through ArchiveLogs from Friday onwards.

    (Similarly to the Full Backup being retained, ArchiveLogs are also retained by Oracle and not obsoleted as they are required for recovery from that Full Backup)

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points