RMAN - recovery
DBAsupport.com Forums - Powered by vBulletin
Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: RMAN - recovery

  1. #1
    Join Date
    Oct 2002
    Posts
    807

    RMAN - recovery

    Asked Tom the below question. I don't understand his response (I just don't get it - how?!). I don't wanna pest him anymore. Can someone enlighten this dim wit (me)?

    Thanks.

    Excerpt :
    "Just to replay the case - A single machine hosted the target and the catalog. The catalog was last backed up at 10pm last night. The target was backed up at 8am this morning (and at 8am yesterday, using the catalog). Target archivelogs were backed up every hour (using RMAN). The machine blew this afternoon at 4pm. I've lost EVERYTHING (including all controlfiles) concerning the target and the catalog. Unfortunately, I was then only able to restore the catalog as of a point in time - 10pm last night. Now, using this catalog - I can only restore an OLD target controlfile. No matter what, I would only be able to restore/recover the target database as of 10pm (or earlier) yesterday. Correct?" Note : Controlfile auto backup feature was NOT turned on for target


    His response :
    "you would get everything -- everything would be recoverable. The backed up data exists, it is out there. rman knows what it would have called it.

    See chapter 10 of the 9ir2 rman guide -- various scenario's are played out there. In particular:

    Performing Recovery with a Backup Control File and No Recovery Catalog"

    -------------------

    I've read the User guide. I've re-read the chapter 10 over and over again. I simply don't get it!! How would I be able to perform a complete recovery (excluding online logs ofcourse) with an outdated catalog and/or an old target controlfile?

    Here's the thread if you're interested

    http://asktom.oracle.com/pls/ask/f?p...:7145177199678

    The bottom few posts on Jun 08 are by me.

    PS : I won't be online Jun11 thru 14th. If you don't receive a reply to your response, you know why.

  2. #2
    Join Date
    Jun 2001
    Location
    Helsinki. Finland
    Posts
    3,938

    Re: RMAN - recovery

    I don't get it either. It's a bit messy :-))
    Oracle Certified Master
    Oracle Certified Professional 6i,8i,9i,10g,11g,12c
    email: ocp_9i@yahoo.com

  3. #3
    Join Date
    Jun 2001
    Location
    Helsinki. Finland
    Posts
    3,938

    Re: Re: RMAN - recovery

    OK: if the control file is old, you restore and roll forward to the last archive you have on disk. Even if the control file has no entries of this "new archives" created after the backups, it will allow you to roll past this point. "Recover using backup controlfile".

    If you have all the archivelogs on tape, you can restore them to disk, "catalog" them and you will be able to recover.
    Oracle Certified Master
    Oracle Certified Professional 6i,8i,9i,10g,11g,12c
    email: ocp_9i@yahoo.com

  4. #4
    Join Date
    Jan 2001
    Posts
    2,828
    Hi

    Tom Kyte is right.

    The reason being RMAN always includes the control file in a backup operation that includes file 1 (system data file),regardless of the autobackup setting.

    so u will be able to recover completely in your case.

    for extracting the controlfile from the backupset when not using a catalog you need to do this

    DECLARE
    l_type VARCHAR2(256);
    l_done BOOLEAN;
    BEGIN
    l_type := dbms_backup_restore.deviceallocate(type=>NULL,ident=>'d1');
    dbms_backup_restore.restoresetdatafile;
    dbms_backup_restore.restorecontrolfileto(cfname=>'/home/ora/new_control.ora');
    dbms_backup_restore.restorebackuppiece(handle=>'/home/ora/control5.rman',
    done=>l_done, params=>NULL);
    dbms_backup_restore.devicedeallocate;
    END;

    regards
    Hrishy
    Last edited by hrishy; 06-14-2004 at 11:55 PM.

  5. #5
    Join Date
    Jun 2001
    Location
    Helsinki. Finland
    Posts
    3,938
    Or like this:

    DECLARE
    v_dev varchar2(50); -- device type allocated for restore
    v_done boolean; -- has the controlfile been fully extracted yet
    type t_fileTable is table of varchar2(255)
    index by binary_integer;
    v_fileTable t_fileTable; -- Stores the backuppiece names
    v_maxPieces number:=1; -- Number of backuppieces in backupset
    BEGIN
    -- Initialise the filetable & number of backup pieces in the backupset
    -- This section of code MUST be edited to reflect the available
    -- backupset before the procedure is compiled and run.
    -- In this example, the backupset consists of 4 pieces:
    v_fileTable(1):='CCE_arfoc0fh_1_1';
    v_fileTable(2):='CCE_asfoc125_1_1';
    v_fileTable(3):='CCE_asfoch76_1_1';
    v_fileTable(4):='CCE_asfockkj_1_1';
    v_maxPieces:=4;
    -- Allocate a device. In this example, I have specified 'sbt_tape' as I am
    -- reading backuppieces from the media manager. If the backuppiece is on disk,
    -- specify type=>null
    v_dev:=sys.dbms_backup_restore.deviceAllocate(type=>'sbt_tape',ident=>'t1');
    -- Begin the restore conversation
    sys.dbms_backup_restore.restoreSetDatafile;
    -- Specify where the controlfile is to be recreated
    sys.dbms_backup_restore.restoreControlfileTo(cfname=>'/u02/oralog1/CCE/new_control.ora');
    -- Restore the controlfile
    FOR i IN 1..v_maxPieces LOOP
    sys.dbms_backup_restore.restoreBackupPiece(done=>v_done,handle=>v_fileTable(i),params=>null);
    IF v_done THEN
    GOTO all_done;
    END IF;
    END LOOP;
    <>
    -- Deallocate the device
    sys.dbms_backup_restore.deviceDeallocate;
    END;
    /
    Oracle Certified Master
    Oracle Certified Professional 6i,8i,9i,10g,11g,12c
    email: ocp_9i@yahoo.com

  6. #6
    Join Date
    Dec 2000
    Location
    Ljubljana, Slovenia
    Posts
    4,439
    Originally posted by julian
    Code:
    ....
    FOR i IN 1..v_maxPieces LOOP
      ....
      IF v_done THEN
        GOTO all_done;
      END IF;
    END LOOP;
    <<>>
    ....
    Ahem.... This kind of loop structure must have been copy-pasted from one of Feuerstein's examples of good programing pracztices.
    Jurij Modic
    ASCII a stupid question, get a stupid ANSI
    24 hours in a day .... 24 beer in a case .... coincidence?

  7. #7
    Join Date
    Jun 2001
    Location
    Helsinki. Finland
    Posts
    3,938
    Originally posted by jmodic
    Ahem.... This kind of loop structure must have been copy-pasted from one of Feuerstein's examples of good programing pracztices.
    No, from METALINK:

    Note:60545.1
    Oracle Certified Master
    Oracle Certified Professional 6i,8i,9i,10g,11g,12c
    email: ocp_9i@yahoo.com

  8. #8
    Join Date
    Jun 2001
    Location
    Helsinki. Finland
    Posts
    3,938
    Actually, the end is like that:

    END LOOP;
    << all_done >>
    -- Deallocate the device
    sys.dbms_backup_restore.deviceDeallocate;
    END;
    Oracle Certified Master
    Oracle Certified Professional 6i,8i,9i,10g,11g,12c
    email: ocp_9i@yahoo.com

  9. #9
    Join Date
    Dec 2000
    Location
    Ljubljana, Slovenia
    Posts
    4,439
    Heh heh heh heh ....
    Jurij Modic
    ASCII a stupid question, get a stupid ANSI
    24 hours in a day .... 24 beer in a case .... coincidence?

  10. #10
    Join Date
    Jun 2001
    Location
    Helsinki. Finland
    Posts
    3,938
    Originally posted by jmodic
    Heh heh heh heh ....
    So, what is funny?
    Oracle Certified Master
    Oracle Certified Professional 6i,8i,9i,10g,11g,12c
    email: ocp_9i@yahoo.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width