Description
The procedure to restore the Oracle control file using NetBackup, follow the steps below:
Note: In this example, the named of the master and Oracle source client are called:
Master Server = nbu_master
Oracle source client = ora_clnt
1. Browse the Oracle backups by running the bplist command either on the master or the Oracle destination client:
<install_path>/netbackup/bin/bplist -S nbu_master -C ora_clnt -t 4 -l -R /
By running the bplist command it will inform NetBackup to return all the Oracle backups for this, particularly Oracle client (ora_clnt). The return output will look something like:
-rw-rw---- oracle dba 7340032 Dec 16 02:42 /cntrl_624_1_770006541
-rw-rw---- oracle dba 266862592 Dec 16 02:39 /al_623_1_770006360
-rw-rw---- oracle dba 350486528 Dec 16 02:39 /al_622_1_770006360
-rw-rw---- oracle dba 262144 Dec 16 02:37 /bk_621_1_770006275
-rw-rw---- oracle dba 7340032 Dec 16 02:36 /bk_620_1_770006168
-rw-rw---- oracle dba 502530048 Dec 16 02:34 /bk_618_1_770006042
-rw-rw---- oracle dba 577765376 Dec 16 02:34 /bk_619_1_770006042
Note: If the return list is too long then you can:
i. Re-direct the output to a output file by running:
<install_path>/netbackup/bin/bplist -S nbu_master -C ora_clnt -t 4 -l -R / >ora_bplist.txt
OR
ii. Narrow the criteria so that Netbackup returns images for a certain date range i.e.
<install_path>/netbackup/bin/bplist -S nbu_master -C ora_clnt -t 4 -s 11/01/2023 -e 11/30/2023 -l -R / >ora_bplist.txt
NetBackup will return backup between 1st of November to 30th November 2023
From the above example output the name of the controlfile backup piece is called cntrl_624_1_770006541. Using this information, we can inform RMAN and NetBackup exactly which control file Netbackup needs to restore
2. Logged into RMAN using the following commands:
$ rman nocatalogRMAN> connect target
connected to target database: XYZ (not mounted)
This rman command will restore the control file to a temporary location without affecting your production location
run {
allocate channel c1 type 'sbt_tape';
send 'NB_ORA_SERV=nbu_master, NB_ORA_CLIENT=ora_clnt';
restore controlfile to '/tmp/cntrl.bak' from 'cntrl_624_1_770006541';
release channel c1;
}
3. Checked the /tmp directory and make sure the control file is restored (cntrl.bak)
4. Replicate the control file:
run {
replicate controlfile from '/tmp/cntrl.bak';
}