Please see my other blog for Oracle EBusiness Suite Posts - EBMentors

Search This Blog

Note: All the posts are based on practical approach avoiding lengthy theory. All have been tested on some development servers. Please don’t test any post on production servers until you are sure.

Saturday, November 03, 2012

Incomplete Recovery by RMAN from TAPE (ASM) to Single Instance.

-- Incomplete Recovery by RMAN from TAPE (ASM) to Single Instance.
Env. Windows 2008R2 64bit, backup is located at Netbackup (Tape media)
1-  first set ORACLE_SID and the DBID of the source DB
C:\> set ORACLE_SID=HOMEDB
RMAN> set dbid=1547250382

executing command: SET DBID


2- Create the dummy pfile
large_pool_size=100m
shared_pool_size=1024m
db_cache_size=300m
audit_file_dest='D:\app\inam\admin\HOMEDB\adump'
audit_trail='db'
compatible='11.2.0.0.0'
control_files='D:\app\Inam\oradata\HOMEdb\CONTROL1.CTL'
db_block_size=8192
db_domain=''
db_name='HOMEDB'
db_recovery_file_dest='D:\app\Inam\fast_recovery_area'
db_recovery_file_dest_size=572354723840
diagnostic_dest='D:\app\inam'
remote_login_passwordfile='exclusive'




3- Start the instance with duumy pfile

RMAN> startup nomount pfile='c:\temp\recotest\pfileHOMEdb.ora'

connected to target database (not started)
Oracle instance started

Total System Global Area    1553379328 bytes

Fixed Size                     2255464 bytes
Variable Size               1224738200 bytes
Database Buffers             318767104 bytes
Redo Buffers                   7618560 bytes

4- reveiw the the backup files on tape media using netbackup command.
C:\Program Files\Veritas\NetBackup\bin\bplist -B -C P-HQ-CL-OR-21 -l -R -t 4  / > c:\temp\recoTest\bplist24092012.txt

-rw------- SYSTEM    SYSTEM       32768000 Oct 28 07:23 cf_c-1547250382-20121028-01:\
-rw------- SYSTEM    SYSTEM      235929600 Oct 28 07:22 HOMEDB_arcSq_23481_20121028_4084_1:\
-rw------- SYSTEM    SYSTEM      258473984 Oct 28 07:21 HOMEDB_arcSq_20985_20121028_4083_1:\
-rw------- SYSTEM    SYSTEM      261095424 Oct 28 07:20 HOMEDB_arcSq_20976_20121028_4082_1:\
-rw------- SYSTEM    SYSTEM       32768000 Oct 28 07:19 cf_c-1547250382-20121028-00:\
-rw------- SYSTEM    SYSTEM       32505856 Oct 28 07:18 HOMEDB_TP_1547250382_20121028_4080_1:\
-rw------- SYSTEM    SYSTEM      17184768K Oct 28 07:12 HOMEDB_TP_1547250382_20121028_4079_1:\
-rw------- SYSTEM    SYSTEM      19543296K Oct 28 07:10 HOMEDB_TP_1547250382_20121028_4078_1:\
-rw------- SYSTEM    SYSTEM      24145152K Oct 28 07:00 HOMEDB_TP_1547250382_20121028_4076_1:\
-rw------- SYSTEM    SYSTEM      19546112K Oct 28 07:00 HOMEDB_TP_1547250382_20121028_4077_1:\
observe the control file backup piece ie; cf_c-1547250382-20121028-01

5- Restore the control file from the backup piece to the location specified in dummy pfile.

RUN{
      ALLOCATE CHANNEL ch00 TYPE 'SBT_TAPE';
        SEND 'NB_ORA_CLIENT=P-HQ-CL-OR-21, NB_ORA_SERV=mg-20';
       restore controlfile to 'D:\app\Inam\oradata\HOMEdb\CONTROL01.CTL' from 'cf_c-1547250382-20121028-01';
        RELEASE CHANNEL ch00;
  }


  then mount the database.
    Alter database mount;
  
6- Restore/recover the database untill desired time.

run {
ALLOCATE CHANNEL ch00 TYPE 'SBT_TAPE';
SEND 'NB_ORA_CLIENT=P-HQ-CL-OR-21, NB_ORA_SERV=p-hq-sp-mg-20';
set until time "to_date('2012-10-28:06:00:00','YYYY-MM-DD:HH24:MI:SS')";
set newname for file '+HOMEDBDATA/HOMEdb/datafile/system.256.770482167'    to 'D:\app\Inam\oradata\HOMEdb\system.256.770482167'    ;
set newname for file '+HOMEDBDATA/HOMEdb/datafile/sysaux.257.770482167'    to 'D:\app\Inam\oradata\sysaux.257.770482167'    ;
set newname for file '+HOMEDBDATA/HOMEdb/datafile/undotbs1.258.770482167' to 'D:\app\Inam\oradata\undotbs1.258.770482167'    ;
set newname for file '+HOMEDBDATA/HOMEdb/datafile/users.259.770482167'    to 'D:\app\Inam\oradata\users.259.770482167'    ;
set newname for file '+HOMEDBDATA/HOMEdb/datafile/example.264.770482273' to 'D:\app\Inam\oradata\example.264.770482273'    ;
set newname for file '+HOMEDBDATA/HOMEdb/datafile/undotbs2.265.770482381' to 'D:\app\Inam\oradata\undotbs2.265.770482381'    ;
set newname for file '+HOMEDBDATA/HOMEdb/datafile/HOMElog01.dbf' to 'D:\app\Inam\oradata\HOMElog01.dbf'    ;
set newname for file '+HOMEDBDATA/HOMEdb/datafile/test_netbkup.dbf' to 'D:\app\Inam\oradata\test_netbkup.dbf'    ;
set newname for file '+HOMEDBDATA/HOMEdb/datafile/recop1.dbf' to 'D:\app\Inam\oradata\recop1.dbf'    ;
set newname for file '+HOMEDBDATA/HOMEdb/datafile/HOMElog02.dbf' to 'D:\app\Inam\oradata\HOMElog02.dbf'    ;
set newname for file '+HOMEDBDATA/HOMEdb/datafile/HOME_ts01.dbf' to 'D:\app\Inam\oradata\HOME_ts01.dbf'    ;
set newname for file '+HOMEDBDATA/HOMEdb/datafile/HOME_ts02.dbf' to 'D:\app\Inam\oradata\HOME_ts02.dbf'    ;
set newname for file '+HOMEDBDATA/HOMEdb/datafile/HOME_ts03.dbf' to 'D:\app\Inam\oradata\HOME_ts03.dbf'    ;
set newname for file '+HOMEDBDATA/HOMEdb/datafile/HOME_ts04.dbf' to 'D:\app\Inam\oradata\HOME_ts04.dbf'    ;
set newname for file '+HOMEDBDATA/HOMEdb/datafile/HOME_ts05.dbf' to 'D:\app\Inam\oradata\HOME_ts05.dbf'    ;
set newname for file '+HOMEDBDATA/HOMEdb/datafile/undotbs1.278.770746419' to 'D:\app\Inam\oradata\undotbs1.278.770746419'    ;
set newname for file '+HOMEDBDATA/HOMEdb/datafile/undotbs2.279.770746495' to 'D:\app\Inam\oradata\undotbs2.279.770746495'    ;
restore database;
switch datafile all;
recover database;
alter database open resetlogs;
 RELEASE CHANNEL ch00;
}

No comments: