Restore script
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 5 of 5

Thread: Restore script

  1. #1
    Join Date
    Jul 2001
    Posts
    181

    Restore script

    connect rcvcat rman/jifVufs@RCATMR
    connect target internal/internal;
    run {
    allocate channel t1 type 'SBT_TAPE';
    allocate channel t2 type 'SBT_TAPE';
    backup
    format 'tbs_db_%d_%t_%s_%p'
    tablespace XOVOLT01X,XOVOLT02X,XOVOLT03X,xovolt04x,XOVOLT05X,XOVOLT06X;
    release channel t1;
    }

    Hi I have the above script whichg backups individual tablespaces in a database. What is the syntax to restore these in the event of a failure do I have to specify each individual one.

    Thanks in advance.

  2. #2
    Join Date
    Nov 2002
    Location
    New Delhi, INDIA
    Posts
    1,796
    for restoring the tablespace

    Code:
    run {
    allocate channel c1 type 'SBT_TAPE';
    recover tablespace "XOVOLT01X";
    release channel c1;
    }
    or

    Code:
    run {
    allocate channel c1 type 'SBT_TAPE';
    restore (datafile number);
    recover tablespace "XOVOLT01X";
    release channel c1;
    }
    well if you have a full database backup all you need to do is

    Code:
    run {
    allocate channel c1 type 'SBT_TAPE';
    recover databse;
    release channel c1;
    }
    RMAN will see what all you need to recover and all your headach is gone :-) (of course if you want to have full control then you can use the other options as well)


    in the event of a failure do I have to specify each individual one.
    depends on how many you loose together...
    what you can do is

    Code:
    run {
    allocate channel c1 type 'SBT_TAPE';
    recover tablespace "XOVOLT01X";
    recover tablespace "XOVOLT02X";
    recover tablespace "XOVOLT03X";
    recover tablespace "XOVOLT04X";
    release channel c1;
    }

    HTH
    Last edited by adewri; 02-25-2003 at 10:20 AM.
    Amar
    "There is a difference between knowing the path and walking the path."

    Amar's Blog  Get Firefox!

  3. #3
    Join Date
    Jul 2001
    Posts
    181
    I have been given this script from metalink it doesn not do a recover is this wrong?

    connect rcvcat rman/jifVufs@RCATMR
    connect target internal/internal;
    run {
    sql 'ALTER TABLESPACE XOVOLT01X OFFLINE TEMPORARY';
    sql 'ALTER TABLESPACE XOVOLT02X OFFLINE TEMPORARY';
    sql 'ALTER TABLESPACE XOVOLT03X OFFLINE TEMPORARY';
    sql 'ALTER TABLESPACE xovolt04x OFFLINE TEMPORARY';
    sql 'ALTER TABLESPACE XOVOLT05X OFFLINE TEMPORARY';
    sql 'ALTER TABLESPACE XOVOLT06X OFFLINE TEMPORARY';
    allocate channel t1 type 'SBT_TAPE';
    allocate channel t2 type 'SBT_TAPE';
    restore tablespace XOVOLT01X,XOVOLT02X,XOVOLT03X,xovolt04x,XOVOLT05X,XOVOLT06X;
    release channel t1;
    release channel t2;
    }

  4. #4
    Join Date
    Nov 2002
    Location
    New Delhi, INDIA
    Posts
    1,796
    Add the line recover tablespace.

    Code:
    run {
    sql 'ALTER TABLESPACE XOVOLT01X OFFLINE TEMPORARY';
    sql 'ALTER TABLESPACE XOVOLT02X OFFLINE TEMPORARY';
    sql 'ALTER TABLESPACE XOVOLT03X OFFLINE TEMPORARY';
    sql 'ALTER TABLESPACE xovolt04x OFFLINE TEMPORARY';
    sql 'ALTER TABLESPACE XOVOLT05X OFFLINE TEMPORARY';
    sql 'ALTER TABLESPACE XOVOLT06X OFFLINE TEMPORARY';
    allocate channel t1 type 'SBT_TAPE';
    allocate channel t2 type 'SBT_TAPE';
    restore tablespace XOVOLT01X,XOVOLT02X,XOVOLT03X,xovolt04x,XOVOLT05X,XOVOLT06X;
    recover tablespace XOVOLT01X,XOVOLT02X,XOVOLT03X,xovolt04x,XOVOLT05X,XOVOLT06X;
    release channel t1;
    release channel t2;
    }
    restore command just extracts the datafiles from the RMAN backup... you need to give a recover command to recover the tablespaces..

    HTH
    Last edited by adewri; 02-24-2003 at 09:37 AM.
    Amar
    "There is a difference between knowing the path and walking the path."

    Amar's Blog  Get Firefox!

  5. #5
    Join Date
    Jul 2001
    Posts
    181
    thanks!

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