This discussion is archived
9 Replies Latest reply: Jan 22, 2013 1:13 AM by Mihael RSS

Is this script taking Image copies ?

BlueSkies Newbie
Currently Being Moderated
RDBMS version: 11.2.0.3
Platform : AIX 6.1

Is the below mentioned backup script taking image copy ? What is the backup type used in this script ?
recover copy of database with tag daily1 until time 'sysdate - 1';
backup  incremental level 1 for recover of copy with tag daily1 database;
backup as compressed backupset archivelog all not backed up;
allocate channel for maintenance type disk;
delete noprompt obsolete device type disk;
release channel;
-- One more question on the above script
If a datafile is lost , would I be able to quickly restore,recover using the following commands If I use the above backup script ?
RMAN>sql ‘alter database datafile 7 offline’;
RMAN>switch datafile 7 to copy;
RMAN>recover datafile 7;
RMAN>sql ‘alter database datafile 7 online’;
  • 1. Re: Is this script taking Image copies ?
    vlethakula Expert
    Currently Being Moderated
    Yes, the script takes updated RMAN incrementla image copies.

    We need to use switch command which will make the controlfile to point to the backup of datafiles present on disk.
    For eg: You have lost user datafile 7

    rman>switch datafile 7 to copy;
    rman>recover datafile 7;
    rman>alter database datafile 7 online;

    The problem with incremental updated backups is that, after any failure like above, if we restore them it will alter the name and the location of datafile. After restoration you have to manual rename them to original location.

    Incase of database failure

    rman>switch database to copy;
    rman>recover database;
    rman>alter database open

    Edited by: vlethakula on Jan 21, 2013 7:35 AM
  • 2. Re: Is this script taking Image copies ?
    Mihael Pro
    Currently Being Moderated
    The problem with incremental updated backups is that, after any failure like above, if we restore them it will alter the name and the location of datafile. After restoration you have to manual rename them to original location.
    Can you, please, explain what will the problem? What is the difference in restoring and switching usual image copies and updatable ?
  • 3. Re: Is this script taking Image copies ?
    vlethakula Expert
    Currently Being Moderated
    For eg:
    Your datafile 6 is located in

    /u01/oradata/test/test06.dbf

    Now you have lost datafile 6, when you restore from backup using rman restore command

    resotre datafile 6 -------------> It resotres into same location /u01/oradata/test/test06.dbf


    If you want to use incrementally updated image copy, the image copy is located in /u02/imagecopy

    After switch datafile 6 to copy ------------> The new location of datafile would be /u02/imagecopy/bk_6


    Check this demo:

    http://gavinsoorma.com/2009/07/rman-recovery-using-the-switch-database-to-copy-command/
  • 4. Re: Is this script taking Image copies ?
    Pinela Journeyer
    Currently Being Moderated
    Basically,

    when you restore a datafile (with no additional information) you restore it to the location of the datafile indicated in the CF. From location A (the backup piece) to location B (in the CF).

    when you switch a datafile to a datafile copy you tell the CF to update the location it contains of datafile Y. So if you took a backup file copy to location A, when you switch, you tell the CF to update its location from location B, to location A.

    which means that the datafile may be in a strange place.

    br,
    jpinela.
  • 5. Re: Is this script taking Image copies ?
    Mihael Pro
    Currently Being Moderated
    If you want to use incrementally updated image copy, the image copy is located in /u02/imagecopy

    After switch datafile 6 to copy ------------> The new location of datafile would be /u02/imagecopy/bk_6
    Thank you for answer. But I think that it is the same if we use usual image copies, created by "backup as copy".
  • 6. Re: Is this script taking Image copies ?
    Hemant K Chitale Oracle ACE
    Currently Being Moderated
    This is the "Incrementally Updated Backups" strategy which Oracle documents but some of us are not comfortable with.

    See http://docs.oracle.com/cd/E11882_01/backup.112/e10642/rcmbckba.htm#CHDEHBFF

    Why I am not comfortable ?
    (1) It causes the backup to be local to the database server -- i.e. on the same SAN as the target database ! (unless you really connect two different SANs to the database server)
    (2) It provides for only 1 backup of the database to be available at any time (unless you religiously make backups from this location to tape every day)
    (3) It provides the ability to switch to the latest backup but not older backups (unless you make backups to tape and thus ensure that you have image backups of different days on different tapes).

    It is too easy for a DBA / SA to not follow the three "unless" recommendations that I've added.


    Hemant K Chitale
  • 7. Re: Is this script taking Image copies ?
    BlueSkies Newbie
    Currently Being Moderated
    Thanks everyone.

    With Incrementally Updated Backups , If my DB's combined datafile size ie. SUM(DBA_DATA_FILES.BYTES) is 2TB , then I need a disk based backup location of 2TB in size for storing Image copies. Right ?
  • 8. Re: Is this script taking Image copies ?
    Hemant K Chitale Oracle ACE
    Currently Being Moderated
    If my DB's combined datafile size ie. SUM(DBA_DATA_FILES.BYTES) is 2TB , then I need a disk based backup location of 2TB in size for storing Image copies
    Yes, precisely.

    RMAN BackupSets may be smaller. Compressed Backupsets are even smaller. But Image Copy backups are exactly the same size as the datafiles.

    Hemant K Chitale
  • 9. Re: Is this script taking Image copies ?
    Mihael Pro
    Currently Being Moderated
    Why I am not comfortable ?
    (1) It causes the backup to be local to the database server -- i.e. on the same SAN as the target database ! (unless you really connect two different SANs to the database server)
    (2) It provides for only 1 backup of the database to be available at any time (unless you religiously make backups from this location to tape every day)
    (3) It provides the ability to switch to the latest backup but not older backups (unless you make backups to tape and thus ensure that you have image backups of different days on different tapes).
    I think that these backups are convenient. We use two backups with different tag, one of them is current, and the second has lag of several days. Both are located on remote storage mounted by nfs. We can recover database using any of them and also use "switch" because switch command has "tag" option.

Legend

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