Restore RAC database to different client
Envirenment
- Master Server: Netbackup-master (NBU 7.7.3)
- Source node: MC-PMS-DB(OEL6.7, Oracle database 11.2.0.4)
- Destination Client: MC-POSHIS-DB (OEL6.7, Oracle database 11.2.0.4)
- DBID=2147825860
requirements
- Successful Netbackup backup of set.
- Same version of database.
- Record Source DBID/DATAFILE/TABLESPACE.
- Install database software only on Destination client.
- Install Netbackup client software on Destination client.
Touch the file on the master server: => /usr/openv/netbackup/db/altnames/No.Restrictions
SQL> select name from v$datafile; Press Return to Continue SQL> select name from v$tempfile; SQL> select name from v$controlfile;
Master Server hosts file
Netbackup-master:/home/maintenance # tail -5 /etc/hosts
192.168.74.151 MC-PMS-DB 192.168.80.155 Netbackup-master 192.168.80.152 oem 192.168.80.162 MC-POSHIS-DB
Client/Media Server
Master&Media
Netbackup-master: ~# cat /usr/openv/netbackup/bp.conf
- Source Client (MC-PMS-DB)
[oracle@MC-PMS-DB ~]$ cat /usr/openv/netbackup/bp.conf SERVER = Netbackup-master CLIENT_NAME = MC-PMS-DB CONNECT_OPTIONS = localhost 1 0 2
- Destination Client (MC-POSHIS-DB)
[root@MC-POSHIS-DB ~]# cat /usr/openv/netbackup/bp.conf SERVER = Netbackup-master CLIENT_NAME = MC-POSHIS-DB CONNECT_OPTIONS = localhost 1 0 2
Excute restore
Create initPMSDB.ora & orapwd file
copy pfile from Source client MC-PMS-DB OR create new one.
PMSDB.__db_cache_size=5737807872 PMSDB.__java_pool_size=117440512 PMSDB.__large_pool_size=134217728 PMSDB.__pga_aggregate_target=3221225472 PMSDB.__sga_target=7516192768 PMSDB.__shared_io_pool_size=0 PMSDB.__shared_pool_size=1308622848 PMSDB.__streams_pool_size=0 *.audit_file_dest='/u01/app/oracle/admin/PMSDB/adump' *.audit_trail='db' *.compatible='11.2.0.4.0' *.control_files='/MC-POSHIS-DB/PMSDB/controlfile/ctrl_dPMSDB.ctl' *.db_block_size=8192 *.db_create_file_dest='/MC-POSHIS-DB' *.db_domain='' *.db_name='PMSDB' *.diagnostic_dest='/u01/app/oracle' *.dispatchers='(PROTOCOL=TCP) (SERVICE=PMSDBXDB)' *.log_archive_dest_1='LOCATION=/MC-POSHIS-DB/PMSDB/arch' *.log_archive_format='arch_%t_%s_%r.arc' *.open_cursors=300 *.pga_aggregate_target=3221225472 *.processes=300 *.remote_login_passwordfile='exclusive' *.sessions=335 *.sga_target=7516192768 *.undo_tablespace='UNDOTBS1'
[oracle@MC-POSHIS-DB dbs]$ orapwd password=Systec36 file=orapwPMSDB [oracle@MC-POSHIS-DB dbs]$ ls hc_PMSDB.dat initPMSDB.ora initPMSDB.ora.old init.ora orapwPMSDB
create directories
[root@MC-POSHIS-DB ]# mkdir -pv /MC-POSHIS-DB/PMSDB/{controlfile,arch}
[root@MC-POSHIS-DB ]# chown -Rv oracle:oinstall /MC-POSHIS-DB/PMSDB/
restore controlfile
- find out correct controlfile in Netbackup
/usr/openv/netbackup/bin/bplist -S Netbackup-master -C MC-PMS-DB -t 4 -l -R / | tee nbu_backups20170704_MC-PMS-DB.txt
export ORACLE_SID=PMSDB
rman target / nocatalog
RMAN> startup nomount pfile='/u01/app/oracle/product/11.2.0/dbhome_1/dbs/initPMSDB.ora';
RMAN> set DBID=2147825860
run {
ALLOCATE CHANNEL ch00 TYPE 'SBT_TAPE' PARMS 'SBT_LIBRARY=/usr/openv/netbackup/bin/libobk.so64';
SEND 'NB_ORA_SERV=Netbackup-master, NB_ORA_CLIENT=MC-PMS-DB';
restore controlfile from '/cntrl_HDPMS_set11_piece1_20180913_0btd0ica_1_1';
RELEASE CHANNEL ch00;
}
RMAN> startup mount- output
RMAN> startup mount;
}}}
restore database
- Following is the very important script that one can use to check the recoverability of the DB.
spool log to rman_restore-PMSDB-preview.log
set echo on
show all;
report schema;
list backup summary;
list backup;
list copy;
run {
ALLOCATE CHANNEL ch00 TYPE 'SBT_TAPE' PARMS 'SBT_LIBRARY=/usr/openv/netbackup/bin/libobk.so64';
SEND 'NB_ORA_SERV=Netbackup-master, NB_ORA_CLIENT=MC-PMS-DB';
ALLOCATE CHANNEL ch01 TYPE 'SBT_TAPE' PARMS 'SBT_LIBRARY=/usr/openv/netbackup/bin/libobk.so64';
SEND 'NB_ORA_SERV=Netbackup-master, NB_ORA_CLIENT=MC-PMS-DB';
crosscheck backupset of database;
restore database preview;
restore database validate;
RELEASE CHANNEL ch00;
RELEASE CHANNEL ch01;
}
spool log offRMAN>
spool log to rman_restore-PMSDB-v1.log
set echo on
run {
ALLOCATE CHANNEL ch00 TYPE 'SBT_TAPE' PARMS 'SBT_LIBRARY=/usr/openv/netbackup/bin/libobk.so64';
SEND 'NB_ORA_SERV=Netbackup-master, NB_ORA_CLIENT=MC-PMS-DB';
ALLOCATE CHANNEL ch01 TYPE 'SBT_TAPE' PARMS 'SBT_LIBRARY=/usr/openv/netbackup/bin/libobk.so64';
SEND 'NB_ORA_SERV=Netbackup-master, NB_ORA_CLIENT=MC-PMS-DB';
restore database;
restore archivelog all;
RELEASE CHANNEL ch00;
RELEASE CHANNEL ch01;
}
spool log off
* Output
{{{
Spooling started in log file: rman_restore-PMSDB-v1.log
Recovery Manager11.2.0.4.0
RMAN> set echo on
echo set on
RMAN> run {
2> ALLOCATE CHANNEL ch00 TYPE 'SBT_TAPE' PARMS 'SBT_LIBRARY=/usr/openv/netbackup/bin/libobk.so64';
3> SEND 'NB_ORA_SERV=Netbackup-master, NB_ORA_CLIENT=MC-PMS-DB';
4> ALLOCATE CHANNEL ch01 TYPE 'SBT_TAPE' PARMS 'SBT_LIBRARY=/usr/openv/netbackup/bin/libobk.so64';
5> SEND 'NB_ORA_SERV=Netbackup-master, NB_ORA_CLIENT=MC-PMS-DB';
6> restore database;
7> restore archivelog all;
8> RELEASE CHANNEL ch00;
9> RELEASE CHANNEL ch01;
10> }
allocated channel: ch00
channel ch00: SID=1423 device type=SBT_TAPE
channel ch00: Veritas NetBackup for Oracle - Release 7.7.3 (2016051915)
sent command to channel: ch00
allocated channel: ch01
channel ch01: SID=1707 device type=SBT_TAPE
channel ch01: Veritas NetBackup for Oracle - Release 7.7.3 (2016051915)
sent command to channel: ch00
sent command to channel: ch01
Starting restore at 2018-09-13 14:45:18
skipping datafile 1; already restored to file /oradata/HDPMS/system01.dbf
skipping datafile 2; already restored to file /oradata/HDPMS/sysaux01.dbf
skipping datafile 3; already restored to file /oradata/HDPMS/undotbs01.dbf
skipping datafile 4; already restored to file /oradata/HDPMS/users01.dbf
channel ch00: starting datafile backup set restore
channel ch00: specifying datafile(s) to restore from backup set
channel ch00: restoring datafile 00006 to /oradata/HDPMS/datafiles/HDPMS02.dbf
channel ch00: reading from backup piece HDPMS_set2_piece1_20180913_02td0i8q_1_1
channel ch01: starting datafile backup set restore
channel ch01: specifying datafile(s) to restore from backup set
channel ch01: restoring datafile 00005 to /oradata/HDPMS/datafiles/HDPMS01.dbf
channel ch01: reading from backup piece HDPMS_set1_piece1_20180913_01td0i8q_1_1
channel ch00: piece handle=HDPMS_set2_piece1_20180913_02td0i8q_1_1 tag=TAG20180913T111849
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:04:25
channel ch01: piece handle=HDPMS_set1_piece1_20180913_01td0i8q_1_1 tag=TAG20180913T111849
channel ch01: restored backup piece 1
channel ch01: restore complete, elapsed time: 00:05:45
Finished restore at 2018-09-13 14:51:04
Starting restore at 2018-09-13 14:51:04
channel ch00: starting archived log restore to default destination
channel ch00: restoring archived log
archived log thread=1 sequence=3
channel ch00: reading from backup piece arch_HDPMS_set9_piece1_20180913_09td0ic2_1_1
channel ch01: starting archived log restore to default destination
channel ch01: restoring archived log
archived log thread=1 sequence=4
channel ch01: reading from backup piece arch_HDPMS_set10_piece1_20180913_0atd0ic2_1_1
channel ch00: piece handle=arch_HDPMS_set9_piece1_20180913_09td0ic2_1_1 tag=TAG20180913T112034
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:00:07
channel ch01: piece handle=arch_HDPMS_set10_piece1_20180913_0atd0ic2_1_1 tag=TAG20180913T112034
channel ch01: restored backup piece 1
channel ch01: restore complete, elapsed time: 00:00:07
Finished restore at 2018-09-13 14:51:12
released channel: ch00
released channel: ch01export ORACLE_SID=HDPMS; sqlplus / as sysdba
SQL> recover database until cancel using backup controlfile; ORA-00279: change 1817651 generated at 09/13/2018 11:20:33 needed for thread 1 ORA-00289: suggestion : /oradata/HDPMS/archlog/1_5_984912390.dbf ORA-00280: change 1817651 for thread 1 is in sequence #5 Specify log: {<RET>=suggested | filename | AUTO | CANCEL} ==> CANCEL Media recovery cancelled.
Open database
SQL> alter database open resetlogs; Database altered.
}}}
Open database
