This discussion is archived
13 Replies Latest reply: Sep 13, 2012 1:26 PM by Levi-Pereira RSS

RMAN to both ASM and Network File system

Neo-b Newbie
Currently Being Moderated
Hello All,

I am using Oracle RAC 11g R2 + ASM.
I am new to RMAN but I am trying to build daily jobs to do the below:

1. Backup my database to the FRA which is on ASM diskgroup +FRA.
2. At the same time I want to backup my database to a Network File System (NFS) in order to be taken by system admins to an archive location that I cannot access it. Since as per my knowledge I cannot copy files from ASM to outside... so for that I am planing to use the format command to the NFS mount point.
3. On daily basis the file in the NFS will be taken by a job (that i am not responsible of) to the Archive, and then it will be purged from this location.
4. I am planing to have my retention policy to windows of 15 days .
5. On daily basis I am planing to cross check my backup and then delete the expired so the one taken from NFS to the archive log will be deleted.

Below is the RMAN that I am planing to run it on daily basis:
backup incremental level 0 cumulative device type disk tag 'FULL_DB_INCR_LV0' database; -- this will be to the default location (+FRA)
backup incremental level 0 cumulative device type disk tag 'FULL_DB_INCR_LV0' database format 'NFS/oracle/backup%U';--another copy to be taken to the archive location
crosscheck backupset;
delete expired backupset; -- this will delete the backups taken to the Archive location
Now my questions:

1. Is it good solutions ? taken into consideration that I need to backup to OS file system in order for the system admins jobs to take the backup to their archive.
2. If any backup is needed, I will use CATALOG START WITH to get it back and then recover.
3. Since My retention period is 15 days, and the backup files in NFS will be removed on daily basis, so this retention will be applied to the backups in ASM, is that an issue?
  • 1. Re: RMAN to both ASM and Network File system
    damorgan Oracle ACE Director
    Currently Being Moderated
    Could you post the entire script? I expect you are opening multiple channels, etc.

    I'd also advise reconsidering the use of CUMULATIVE. One error can corrupt everything.
  • 2. Re: RMAN to both ASM and Network File system
    Neo-b Newbie
    Currently Being Moderated
    Below is the script for the full database backup that will be run once per week:
    I inserted some notes
    rman target / << EOF
    backup incremental level 0 cumulative device type disk tag 'FULL_DB_INCR_LV0' database;
    backup incremental level 0 cumulative device type disk tag 'FULL_DB_INCR_LV0' database format '/NFS/backup%U';
    crosscheck backupset;
    list expired backupset;
    delete expired backupset; -- this will delete the backup of yesterday from that was purged from NFS
    allocate channel for maintenance type disk;
    delete noprompt obsolete device type disk;
    release channel;
    exit;
    EOF
    and below is the one of the incremental level database backup that will run on daily basis:
    rman target / << EOF
    backup incremental level 1 device type disk tag 'FULL_DB_INCR_LV1_DF' database;
    backup incremental level 1 device type disk tag 'FULL_DB_INCR_LV1_DF' database format '/NFS/backup%U';
    crosscheck backupset;
    list expired backupset;
    delete expired backupset; -- this will delete the backup of yesterday from that was purged from NFS
    allocate channel for maintenance type disk;
    delete noprompt obsolete device type disk;
    release channel;
    exit;
    EOF
    Please let me know you feedback based on the points that I mentioned in my first thread.
  • 3. Re: RMAN to both ASM and Network File system
    mseberg Guru
    Currently Being Moderated
    Hello;

    You have an issue. You cannot make duplex backups in recovery area.

    "When you configure an explicit format for disk channels, RMAN does not create backups by default in the fast recovery area."

    http://docs.oracle.com/cd/E11882_01/backup.112/e10642/rcmconfb.htm#i1017890


    "The FORMAT parameter of the BACKUP command specifies the destinations for duplexed backups. "

    http://docs.oracle.com/cd/E11882_01/backup.112/e10642/rcmcncpt.htm#i1025065

    Best Regards

    mseberg
  • 4. Re: RMAN to both ASM and Network File system
    Neo-b Newbie
    Currently Being Moderated
    Hello, and thanks for the remark.
    since I am new to RMAN allow me to ask some basic questions:
    "When you configure an explicit format for disk channels, RMAN does not create backups by default in the fast recovery area."
    That is what i am doing first backup below will backup to +FRA (flash recovery area disk group):
    backup incremental level 1 device type disk tag 'FULL_DB_INCR_LV1_DF' database;
    second backup will backup to /NFS where i explicitly set the format parameter as below:
    backup incremental level 1 device type disk tag 'FULL_DB_INCR_LV1_DF' database format '/NFS/backup%U';
    What is the wrong and how I can fix it ? knowing that I did not configure any channel and below are my RMAN configuration
    CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 8 DAYS;
    CONFIGURE BACKUP OPTIMIZATION OFF; # default
    CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
    CONFIGURE CONTROLFILE AUTOBACKUP ON;
    CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
    CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
    CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
    CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
    CONFIGURE MAXSETSIZE TO UNLIMITED; # default
    CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
    CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
    CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE ; # default
    CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
    CONFIGURE SNAPSHOT CONTROLFILE NAME TO '+FRA/ISTPPRD/AUTOBACKUP/snapcf_ISTPPRD.f';
    Now If I want to use duplex RMAN backups, when manually purging the backup of one of the locations (the one on the NFS) does that affect the other one in FRA ? when cross check and delete expired ?
    Since I read the below in the link you provided:
    RMAN places the first copy of each backup piece in /disk1, the second in ?/oradata, and the third in the Oracle home. RMAN does not produce three backup sets, each with a different unique backup set key. Rather, RMAN produces one backup set with a unique key, and generates three identical copies of each backup piece in the set.
    Please can you provide me from your experience how my script should look like taken into consideration my requirements mentioned in the initial thread?
  • 5. Re: RMAN to both ASM and Network File system
    Shivananda Rao Guru
    Currently Being Moderated
    NB wrote:
    That is what i am doing first backup below will backup to +FRA (flash recovery area disk group):
    backup incremental level 1 device type disk tag 'FULL_DB_INCR_LV1_DF' database;
    second backup will backup to /NFS where i explicitly set the format parameter as below:
    backup incremental level 1 device type disk tag 'FULL_DB_INCR_LV1_DF' database format '/NFS/backup%U';
    What is the wrong and how I can fix it ? knowing that I did not configure any channel and below are my RMAN configuration

    Now If I want to use duplex RMAN backups, when manually purging the backup of one of the locations (the one on the NFS) does that affect the other one in FRA ? when cross check and delete expired ?
    Since I read the below in the link you provided:
    RMAN places the first copy of each backup piece in /disk1, the second in ?/oradata, and the third in the Oracle home. RMAN does not produce three backup sets, each with a different unique backup set key. Rather, RMAN produces one backup set with a unique key, and generates three identical copies of each backup piece in the set.
    Please can you provide me from your experience how my script should look like taken into consideration my requirements mentioned in the initial thread?
    Nothing wrong. You should be able to take the backup to 2 different locations 'Flash Recovery Area' and also the desired NFS location.


    An example shown below. Here Flash Recovery Area is 'C:\bkp' and I am taking backup to both FRA and also to my desired location 'C:\app\bkp' using format keyword.

    Also, I have set CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default to 1 which is same as your case. So no issue would occur.
    C:\Documents and Settings\Administrator>rman target /
    
    Recovery Manager: Release 10.2.0.5.0 - Production on Tue Sep 11 16:54:51 2012
    
    Copyright (c) 1982, 2007, Oracle.  All rights reserved.
    
    connected to target database: STD (DBID=788819623)
    
    RMAN> show all;
    
    using target database control file instead of recovery catalog
    RMAN configuration parameters are:
    CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
    CONFIGURE BACKUP OPTIMIZATION OFF; # default
    CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
    CONFIGURE CONTROLFILE AUTOBACKUP OFF; # default
    CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
    CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
    CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
    CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
    CONFIGURE MAXSETSIZE TO UNLIMITED; # default
    CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
    CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
    CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
    CONFIGURE SNAPSHOT CONTROLFILE NAME TO 'C:\ORACLE\PRODUCT\10.2.0\DB_1\DATABASE\S
    NCFSTD.ORA'; # default
    
    RMAN>
    
    RMAN>
    
    RMAN> run
    2> {
    3> backup incremental level 0 device type disk tag 'FULL_DB' database;
    4> backup incremental level 0 device type disk tag 'FULL_DB_DISK' database forma
    t 'C:\app\bkp\%U.bak';
    5> }
    
    Starting backup at 11-SEP-12
    allocated channel: ORA_DISK_1
    channel ORA_DISK_1: sid=136 devtype=DISK
    channel ORA_DISK_1: starting incremental level 0 datafile backupset
    channel ORA_DISK_1: specifying datafile(s) in backupset
    input datafile fno=00001 name=C:\ORACLE\PRODUCT\10.2.0\ORADATA\STD\SYSTEM01.DBF
    input datafile fno=00003 name=C:\ORACLE\PRODUCT\10.2.0\ORADATA\STD\SYSAUX01.DBF
    input datafile fno=00002 name=C:\ORACLE\PRODUCT\10.2.0\ORADATA\STD\UNDOTBS01.DBF
    input datafile fno=00004 name=C:\ORACLE\PRODUCT\10.2.0\ORADATA\STD\USERS01.DBF
    channel ORA_DISK_1: starting piece 1 at 11-SEP-12
    channel ORA_DISK_1: finished piece 1 at 11-SEP-12
    piece handle=C:\BKP\STD\BACKUPSET\2012_09_11\O1_MF_NNND0_FULL_DB_84Y81D2X_.BKP t
    ag=FULL_DB comment=NONE
    channel ORA_DISK_1: backup set complete, elapsed time: 00:01:18
    channel ORA_DISK_1: starting incremental level 0 datafile backupset
    channel ORA_DISK_1: specifying datafile(s) in backupset
    including current control file in backupset
    including current SPFILE in backupset
    channel ORA_DISK_1: starting piece 1 at 11-SEP-12
    channel ORA_DISK_1: finished piece 1 at 11-SEP-12
    piece handle=C:\BKP\STD\BACKUPSET\2012_09_11\O1_MF_NCSN0_FULL_DB_84Y83SKL_.BKP t
    ag=FULL_DB comment=NONE
    channel ORA_DISK_1: backup set complete, elapsed time: 00:00:11
    Finished backup at 11-SEP-12
    
    Starting backup at 11-SEP-12
    using channel ORA_DISK_1
    channel ORA_DISK_1: starting incremental level 0 datafile backupset
    channel ORA_DISK_1: specifying datafile(s) in backupset
    input datafile fno=00001 name=C:\ORACLE\PRODUCT\10.2.0\ORADATA\STD\SYSTEM01.DBF
    input datafile fno=00003 name=C:\ORACLE\PRODUCT\10.2.0\ORADATA\STD\SYSAUX01.DBF
    input datafile fno=00002 name=C:\ORACLE\PRODUCT\10.2.0\ORADATA\STD\UNDOTBS01.DBF
    input datafile fno=00004 name=C:\ORACLE\PRODUCT\10.2.0\ORADATA\STD\USERS01.DBF
    channel ORA_DISK_1: starting piece 1 at 11-SEP-12
    channel ORA_DISK_1: finished piece 1 at 11-SEP-12
    piece handle=C:\APP\BKP\0INKUOF9_1_1.BAK tag=FULL_DB_DISK comment=NONE
    channel ORA_DISK_1: backup set complete, elapsed time: 00:00:57
    channel ORA_DISK_1: starting incremental level 0 datafile backupset
    channel ORA_DISK_1: specifying datafile(s) in backupset
    including current control file in backupset
    including current SPFILE in backupset
    channel ORA_DISK_1: starting piece 1 at 11-SEP-12
    channel ORA_DISK_1: finished piece 1 at 11-SEP-12
    piece handle=C:\APP\BKP\0JNKUOH2_1_1.BAK tag=FULL_DB_DISK comment=NONE
    channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
    Finished backup at 11-SEP-12
    The only concern here is that the backup would be taken twice as you can see. One to the FRA location and to the NFS location.
  • 6. Re: RMAN to both ASM and Network File system
    mseberg Guru
    Currently Being Moderated
    Depending upon how many backup sets you have you could use This command is to backup the backupsets from ASM to the Network File system.


    Change as needed :
       
        
     backup backupset 1,2,3,4 format 'NFS/oracle/backup%U'; 
     
     
    Best Regards

    mseberg
  • 7. Re: RMAN to both ASM and Network File system
    Neo-b Newbie
    Currently Being Moderated
    Hello,

    Thank your for your feedback.

    One more question, does the retention period cover the backups in the NFS?
    So old backups will be automatically purged from NFS as in the flash recovery area ?

    Regards,
  • 8. Re: RMAN to both ASM and Network File system
    mseberg Guru
    Currently Being Moderated
    Hello;



    Yes. Not really automatically. If you want to delete obsolete RMAN Backups Based on Retention Policies :
    DELETE OBSOLETE;
    If you add to the script its fairly automatic. If you want it work work like FRA then, No.

    For additional information see :

    Deleting Obsolete RMAN Backups Based on Retention Policies in Oracle document E10642-03.


    The exact point is covered in :

    http://docs.oracle.com/cd/B19306_01/backup.102/b14192/setup005.htm

    ( Setting Up a Flash Recovery Area for RMAN )

    "Using a flash recovery area simplifies the ongoing administration of your database by automatically naming recovery-related files, retaining them as long as they are needed for restore and recovery activities, and deleting them when they are no longer needed to restore your database and space is needed for some other backup and recovery-related purpose."


    Best Regards

    mseberg
  • 9. Re: RMAN to both ASM and Network File system
    Levi-Pereira Guru
    Currently Being Moderated
    Hi NB,

    This way you will create two different backups. When you try restore your database oracle will not differentiate backups from one location to another.

    I recommend you create "Copies of RMAN Backups". I believe this is right way to perform this work. Because on NFS you will have only copy of backupset and will not increase the Load on database performing 2 backups.

    See this example:
    {message:id=9971108}


    http://docs.oracle.com/cd/E11882_01/backup.112/e10642/rcmcncpt.htm#i1025065

    http://docs.oracle.com/cd/E25178_01/backup.1111/e10642/rcmbckad.htm#i1006180


    Regards,
    Levi Pereira
  • 10. Re: RMAN to both ASM and Network File system
    Neo-b Newbie
    Currently Being Moderated
    Hi Levi,
    Levi Pereira wrote:
    This way you will create two different backups. When you try restore your database oracle will not differentiate backups from one location to another.
    What that mean? I did not get the point, does that mean that I will not be able to restore my database?
    When restoring database cannot I specify the location ?
    I want to restore from NFS only if I lost the data in ASM in any way. So?

    I recommend you create "Copies of RMAN Backups". I believe this is right way to perform this work. Because on NFS you will have only copy of backupset and will not increase the Load on database performing 2 backups.

    See this example:
    {message:id=9971108}
    Ok but how could I know the numbers of my backup sets that I need to backup ? I have automatic jobs.
    So I cannot use
    backup backupset 42;
    I dont think also I can use the below:
    backup backupset all delete input; # It will move all files in ASM to Filesystem
    backup backuset all; # It will keep backup data in both location.
    Since in ASM I will be having backups that are already backed up to NFS in previous time and I do not want to delete it from ASM since it did not reach the retention policy, can I in any way backup only the backups that I took it now to ASM?

    What is the difference from restore perspective between my script:
    backup incremental level 0 cumulative device type disk tag 'FULL_DB_INCR_LV0' database; -- this will be to the default location (+FRA)
    backup incremental level 0 cumulative device type disk tag 'FULL_DB_INCR_LV0' database format 'NFS/oracle/backup%U';--another copy to be taken to the archive location
    and what you suggested
    backup incremental level 0 cumulative device type disk tag 'FULL_DB_INCR_LV0' database; -- this will be to the default location (+FRA)
    backup backupset all; -- this just an example I do not know how I can only specify the backup that I took it in previous command
    My idea to store on NFS is only to take it to tape library, and once it is in the tape library I will delete the file and delele expired from RMAN repository
  • 11. Re: RMAN to both ASM and Network File system
    Levi-Pereira Guru
    Currently Being Moderated
    Hi,

    Far as I understood you want to guarantee the backup in two different location to prevent failure of one location or send your backup to tape.

    My point is: You don't need make two different backups because it's can be a problem during restore.

    backup incremental level 0 cumulative device type disk tag 'FULL_DB_INCR_LV0' database; -- this will be to the default location (+FRA)
    backup incremental level 0 cumulative device type disk tag 'FULL_DB_INCR_LV0' database format 'NFS/oracle/backup%U';--another copy to be taken to the archive location
    Your strategy of Backup:
    E.g:
    1° Backup to FRA incremental level 0 cumulative start at 10:00 and finished at 12:00. (backupset 100)
    2° Backup to NFS incremental level 0 cumulative start at 12:00 and finished at 14:00. (backupset 101)


    Incremental backup that backs up all the blocks changed since the most recent backup at level 0. So in this case, If you take backup incremental level 1 the most recent backup is backup on NFS (backupset 101).

    Restore based on time:

    If FRA fails or backup is not available on FRA and you need restore database '12:00' (backupset 100) the restore will fails. (You will not have copy of backupset 100 on NFS)

    If NFS fails or backup is not available on NFS and you need restore any backup incremental level 1 (stored on FRA) that was taken after last incremental level 0 on NFS, your restore will fail. ( You wil not have copy of backupset 101 on FRA)

    So, because that I suggest you make copies of BackupSet instead make new backups.

    My recommendation:

    Backup:
    1° Backup to FRA incremental level 0 cumulative and archivelog start at 10:00 and finished at 12:00. (backupset 100)
    2° Make a copy of Backupset 100 on NFS.

    If you make new backups incremental level 1 the start point of these backup will be (backuset 100).


    Restore:
    If FRA fails or backup is not available on FRA and I need restore database '12:00' (backupset 100) you can use backupset copy stored on NFS or restore it from TAPE.
    If NFS fails or backup copy is not available on NFS you will have the backup available on FRA or TAPE.


    PS: The previous post were only examples of the possibilities to make this work, but you need to use right commands to perform this backup copy and delete it.

    Little example:
    ## Backup your database to FRA
    
    RMAN > backup as compressed backupset 
               incremental level 0 cumulative tag 'backup_incr_lvl_0_12_09_2012' database;
     
    RMAN > backup archivelog all tag 'archivelog_12_09_2012_15h' delete input;
    
    ## Backup backupset to NFS
    
    RMAN > backup backupset from tag 'backup_incr_lvl_0_12_09_2012' format '/NFS/DBTST_COPY_%U.bak';
    
    RMAN > backup backupset from tag  'archivelog_12_09_2012_15h' format '/NFS/DBTST_COPY_%U.bak';
    You will need unique tag for each backup, the easy way to do that is to use "Substitution Variables in Command Files" on RMAN.

    Therefore you will have your centralized backup in FRA and the Backup Copies on NFS and/or Tape. You will not mix backup at both locations. If you mix your backup on both location I still believe it is a bad choice.


    Regards,
    Levi Pereira
  • 12. Re: RMAN to both ASM and Network File system
    Neo-b Newbie
    Currently Being Moderated
    Thanks levi, i got your point, your totally right.

    Is there any way easier to identify the backup set number of my last backup ? instead of using the TAG or you think the TAG is the simplest way ?

    Regards,
  • 13. Re: RMAN to both ASM and Network File system
    Levi-Pereira Guru
    Currently Being Moderated
    Hi,

    Easy way is to use TAG. Find the number of backupset is a hard task.

    Create a pattern for your tag using date.


    How to use Substitution Variables in RMAN commands [ID 427229.1]

    How to use RMAN TAG name with different attributes or variables. [ID 580283.1]


    You can check what backup does not have copy on NFS using query below:
    SELECT   BS.RECID BSKEY, 
      BP.RECID KEY,
      BP.RECID RECID,
      BS.PIECES PIECECOUNT,
      BP.HANDLE FILENAME,
      BP.TAG TAG,
      BP.COPY# COPYNUMBER,
      BP.STATUS STATUS,
      BP.PIECE# PIECENUMBER
    FROM V$BACKUP_PIECE BP,
      V$BACKUP_SET BS
    WHERE (BP.SET_COUNT = BS.SET_COUNT
    AND BP.SET_STAMP    = BS.SET_STAMP)
    order by  bskey,copynumber

Legend

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