Environment: Windows 2008R2 64bit, backup located at Netbackup (Tape media), DB is RAC one with two nodes on ASM.
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- Review the the backup files on tape media using netbackup command.
C:\Program Files\Veritas\NetBackup\bin\bplist -B -C OR1 -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. Remember your Netbackup client already should have been configured with Netbackup
Server on the machine where you are running RMAN.
RUN{
ALLOCATE CHANNEL ch00 TYPE 'SBT_TAPE';
SEND 'NB_ORA_CLIENT=OR1, NB_ORA_SERV=nb1';
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. You should already know all the datafiles in the source DB. you can get the list by using following query;
select name from v$datafile;
or run the the statement in RMAN
RMAN> report schema;
run {
ALLOCATE CHANNEL ch00 TYPE 'SBT_TAPE';
SEND 'NB_ORA_CLIENT=OR1, NB_ORA_SERV=nb1';
set until time "to_date('2012-04-07:14:20:00','YYYY-MM-DD:HH24:MI:SS')";
set newname for datafile 1 to 'D:\app\inam\oradata\homedb\system.256.770482167';
set newname for datafile 2 to 'D:\app\inam\oradata\homedb\sysaux.257.770482167';
set newname for datafile 3 to 'D:\app\inam\oradata\homedb\undotbs1.258.770482167';
set newname for datafile 4 to 'D:\app\inam\oradata\homedb\users.259.770482167';
set newname for datafile 5 to 'D:\app\inam\oradata\homedb\example.264.770482273';
set newname for datafile 6 to 'D:\app\inam\oradata\homedb\undotbs2.265.770482381';
set newname for datafile 7 to 'D:\app\inam\oradata\homedb\homelog01.dbf';
set newname for datafile 8 to 'D:\app\inam\oradata\homedb\test_netbkup.dbf';
set newname for datafile 9 to 'D:\app\inam\oradata\homedb\recop1.dbf';
set newname for datafile 10 to 'D:\app\inam\oradata\homedb\homelog02.dbf';
set newname for datafile 11 to 'D:\app\inam\oradata\homedb\homets01.dbf';
set newname for datafile 12 to 'D:\app\inam\oradata\homedb\homets02.dbf';
set newname for datafile 13 to 'D:\app\inam\oradata\homedb\homets03.dbf';
set newname for datafile 14 to 'D:\app\inam\oradata\homedb\homets04.dbf';
set newname for datafile 15 to 'D:\app\inam\oradata\homedb\homets05.dbf';
set newname for datafile 16 to 'D:\app\inam\oradata\homedb\undotbs1.278.770746419';
set newname for datafile 17 to 'D:\app\inam\oradata\homedb\undotbs2.279.770746495';
restore database;
switch datafile all;
recover database;
alter database open resetlogs;
RELEASE CHANNEL ch00;
}
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- Review the the backup files on tape media using netbackup command.
C:\Program Files\Veritas\NetBackup\bin\bplist -B -C OR1 -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. Remember your Netbackup client already should have been configured with Netbackup
Server on the machine where you are running RMAN.
RUN{
ALLOCATE CHANNEL ch00 TYPE 'SBT_TAPE';
SEND 'NB_ORA_CLIENT=OR1, NB_ORA_SERV=nb1';
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. You should already know all the datafiles in the source DB. you can get the list by using following query;
select name from v$datafile;
or run the the statement in RMAN
RMAN> report schema;
run {
ALLOCATE CHANNEL ch00 TYPE 'SBT_TAPE';
SEND 'NB_ORA_CLIENT=OR1, NB_ORA_SERV=nb1';
set until time "to_date('2012-04-07:14:20:00','YYYY-MM-DD:HH24:MI:SS')";
set newname for datafile 1 to 'D:\app\inam\oradata\homedb\system.256.770482167';
set newname for datafile 2 to 'D:\app\inam\oradata\homedb\sysaux.257.770482167';
set newname for datafile 3 to 'D:\app\inam\oradata\homedb\undotbs1.258.770482167';
set newname for datafile 4 to 'D:\app\inam\oradata\homedb\users.259.770482167';
set newname for datafile 5 to 'D:\app\inam\oradata\homedb\example.264.770482273';
set newname for datafile 6 to 'D:\app\inam\oradata\homedb\undotbs2.265.770482381';
set newname for datafile 7 to 'D:\app\inam\oradata\homedb\homelog01.dbf';
set newname for datafile 8 to 'D:\app\inam\oradata\homedb\test_netbkup.dbf';
set newname for datafile 9 to 'D:\app\inam\oradata\homedb\recop1.dbf';
set newname for datafile 10 to 'D:\app\inam\oradata\homedb\homelog02.dbf';
set newname for datafile 11 to 'D:\app\inam\oradata\homedb\homets01.dbf';
set newname for datafile 12 to 'D:\app\inam\oradata\homedb\homets02.dbf';
set newname for datafile 13 to 'D:\app\inam\oradata\homedb\homets03.dbf';
set newname for datafile 14 to 'D:\app\inam\oradata\homedb\homets04.dbf';
set newname for datafile 15 to 'D:\app\inam\oradata\homedb\homets05.dbf';
set newname for datafile 16 to 'D:\app\inam\oradata\homedb\undotbs1.278.770746419';
set newname for datafile 17 to 'D:\app\inam\oradata\homedb\undotbs2.279.770746495';
restore database;
switch datafile all;
recover database;
alter database open resetlogs;
RELEASE CHANNEL ch00;
}
No comments:
Post a Comment