Differences between revisions 2 and 23 (spanning 21 versions)
Revision 2 as of 2018-09-13 06:17:28
Size: 10641
Editor: localhost
Comment:
Revision 23 as of 2018-09-28 07:03:11
Size: 12483
Editor: merlyn
Comment:
Deletions are marked like this. Additions are marked like this.
Line 2: Line 2:
@@ Message: Other users will be warned until 2018-09-13 06:21:37 that
@ you are editing this page.
@@ Comment: None
@@ Trivial: (x) Yes ( ) No
Describe désert/workarea/ayy/restore-PMSDB here.@@ Syntax: 1.5
@@ Message: Other users will be warned until 2018-09-13 06:20:34 that
@ you are editing this page.
@@ Comment: None
@@ Trivial: (x) Yes ( ) No
Describe désert/Netbackup/Restore here.
<<TableOfContents()>>

= Restore RAC database to different client =

= Restore SINGLE database to different client =
Line 16: Line 5:
  * Master Server: nbumaster (NBU Appliance 5230, 7.6.0.1)
  * RAC node1:   mls-rac01 (OEL6.7, Oracle database 11.2.0.4)
  * Destination Client: rac-restore (OEL6.7, Oracle database 11.2.0.4)
  * 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)
Line 20: Line 9:
  * DBID=920906249   * DBID=2147825860
Line 28: Line 17:
  I. Touch the file on the master server: => /usr/openv/netbackup/db/altnames/No.Restrictions
Line 37: Line 27:
SQL> select member from v$logfile;
Line 40: Line 32:
nbumaster:/home/maintenance # tail -5 /etc/hosts
{{{
192.168.24.73 it003 it003
192.168.17.161 mls-rac01
192.168.17.162 mls-rac02
192.168.17.168 eas-new
192.168.17.169 rac
-restore
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
Line 52: Line 44:
nbumaster:/home/maintenance # cat /usr/openv/netbackup/bp.conf
SERVER = nbumaster
SERVER = TEST_SEVER
SERVER = opscenter
CLIENT_NAME = nbumaster
USE_VXSS = PROHIBITED
VXSS_SERVICE_TYPE = INTEGRITYANDCONFIDENTIALITY
EMMSERVER = nbumaster
VXDBMS_NB_DATA = /usr/openv/db/data
ENABLE_ROBUST_LOGGING = YES
VERBOSE = 5
NETBACKUP_APPLIANCE_MODE = MANUAL_MASTER_APPLIANCE
IP_ADDRESS_FAMILY = AF_UNSPEC
VM_PROXY_SERVER = nbumaster
OPS_CENTER_SERVER_NAME = TEST_SEVER
OPS_CENTER_SERVER_NAME = opscenter
TELEMETRY_UPLOAD = YES
}}}

  * Source Client (mls-rac01)
{{{
[oracle@mls-rac01 ~]$ cat /usr/openv/netbackup/bp.conf
SERVER = nbumaster
CLIENT_NAME = mls-rac01
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
Line 79: Line 55:
  * Destination Client (rac-restore)
{{{
[root@rac-restore ~]# cat /usr/openv/netbackup/bp.conf
SERVER = nbumaster
CLIENT_NAME = rac-restore
  * Destination Client (MC-POSHIS-DB)
{{{
[root@MC-POSHIS-DB ~]# cat /usr/openv/netbackup/bp.conf
SERVER = Netbackup-master
CLIENT_NAME = MC-POSHIS-DB
Line 90: Line 66:
copy pfile from Source client mls-rac02 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'
copy pfile from Source client MC-PMS-DB OR create new one.

{{{
HDPMS.__db_cache_size=4160749568
HDPMS.__java_pool_size=16777216
HDPMS.__large_pool_size=33554432
HDPMS.__oracle_base='/oracle/app/oracle'#ORACLE_BASE set from environment
HDPMS.__pga_aggregate_target=894498816
HDPMS.__sga_target=3066719232
HDPMS.__shared_io_pool_size=0
HDPMS.__shared_pool_size=805306368
HDPMS.__streams_pool_size=16777216
*.audit_file_dest='/oracle/app/oracle/admin/HDPMS/adump'
Line 104: Line 81:
*.control_files='/rac-restore/PMSDB/controlfile/ctrl_dPMSDB.ctl' *.control_files='/oracle/app/oracle/oradata/HDPMS/control01.ctl','/oracle/app/oracle/oradata/HDPMS/control02.ctl'
Line 106: Line 83:
*.db_create_file_dest='/rac-restore'
Line 108: Line 84:
*.db_name='PMSDB'
*.diagnostic_dest='/u01/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=PMSDBXDB)'
*.log_archive_dest_1='LOCATION=/rac-restore/PMSDB/arch'
*.
log_archive_format='arch_%t_%s_%r.arc'
*.db_name='HDPMS'
*.diagnostic_dest='/oracle/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=HDPMSXDB)'
*.log_archive_dest_1='LOCATION=/oradata/HDPMS/archlog'
Line 114: Line 89:
*.pga_aggregate_target=3221225472
*.processes=300
*.remote_login_passwordfile='exclusive'
*.sessions=335
*.sga_target=7516192768
*.pga_aggregate_target=1684013056
*.processes=1500
*.remote_login_passwordfile='EXCLUSIVE'
*.sessions=1655
*.sga_target=5052039168
*.undo_retention=7
200
Line 122: Line 98:

{{{
[oracle@rac-restore dbs]$ orapwd password=Systec36 file=orapwPMSDB

[oracle@rac-restore dbs]$ ls
hc_PMSDB.dat initPMSDB.ora initPMSDB.ora.old init.ora orapwPMSDB
  * option
{{{
[oracle@MC-POSHIS-DB dbs]$ orapwd password=Systec36 file=orapwPMSDB
Line 132: Line 105:
[root@rac-restore ]# mkdir -pv /rac-restore/PMSDB/{controlfile,arch}
[root@rac-restore ]# chown -Rv oracle:oinstall /rac-restore/PMSDB/


[oracle@rac-restore dbs]$ mkdir -pv /u01/app/oracle/admin/PMSDB/{adump,bdump,cdump,ddump,udump,pfile}
mkdir: created directory `/u01/app/oracle/admin/PMSDB'
mkdir: created directory `/u01/app/oracle/admin/PMSDB/adump'
mkdir: created directory `/u01/app/oracle/admin/PMSDB/bdump'
mkdir: created directory `/u01/app/oracle/admin/PMSDB/cdump'
mkdir: created directory `/u01/app/oracle/admin/PMSDB/ddump'
mkdir: created directory `/u01/app/oracle/admin/PMSDB/udump'
mkdir: created directory `/u01/app/oracle/admin/PMSDB/pfile'
mkdir -pv /oracle/app/oracle/admin/HDPMS/adump
mkdir -pv /oracle/app/oracle/oradata/HDPMS
mkdir -pv /oradata/HDPMS/archlog
mkdir -pv /oradata/HDPMS/datafiles/
Line 148: Line 113:
/usr/openv/netbackup/bin/bplist -S nbumaster -C mls-rac02 -t 4 -l -R / | tee nbu_backups20170704_mls-rac02.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=920906249
/usr/openv/netbackup/bin/bplist -S Netbackup-master -C MC-PMS-DB -t 4 -l -R / | tee nbu_backups`date +%F`_MC-PMS-DB.txt

{{{
$ export ORACLE_SID=HDPMS
$
rman target / catalog rman/rman@orcl

RMAN> startup nomount;

RMAN> set DBID=2147825860
Line 160: Line 125:

restore controlfile;
restore controlfile from '/cntrl_HDPMS_set11_piece1_20180913_0btd0ica_1_1';
Line 168: Line 132:
  * output

RMAN> startup mount;

database is already started
database mounted
  * Output
{{{
 ~$ rman target / catalog rman/rman@orcl

Recovery Manager: Release 11.2.0.4.0 - Production on Thu Sep 13 15:50:24 2018

Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.

connected to target database (not started)
connected to recovery catalog database

RMAN> startup nomount;

Oracle instance started

Total System Global Area 5044088832 bytes

Fixed Size 2261928 bytes
Variable Size 1442843736 bytes
Database Buffers 3590324224 bytes
Redo Buffers 8658944 bytes

RMAN> set DBID=2147825860

executing command: SET DBID
database name is "HDPMS" and DBID is 2147825860


RMAN> 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;
}
2> 3> 4> 5> 6>
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

Starting restore at 2018-09-13 15:52:16

channel ch00: restoring control file
channel ch00: restore complete, elapsed time: 00:00:07
output file name=/oracle/app/oracle/oradata/HDPMS/control01.ctl
output file name=/oracle/app/oracle/oradata/HDPMS/control02.ctl
Finished restore at 2018-09-13 15:52:23

released channel: ch00

RMAN>
Line 177: Line 188:
=== restore database by UNTIL TIME === === restore database ===
Line 193: Line 204:
 restore database preview;
 restore database validate;
crosscheck backupset of database;
restore database preview;
restore database validate;
Line 205: Line 217:
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';
Line 208: Line 218:
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';
Line 209: Line 223:
restore archivelog all;
Line 210: Line 225:
RELEASE CHANNEL ch00;
}
spool log off
}}}

=== recover database by UNTIL TIME ===
{{{
RMAN >
spool log to rman_recover-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=nbumaster, NB_ORA_CLIENT=mls-rac02';
set UNTIL TIME "to_date('2017-06-29 18:00:00','YYYY-MM-DD HH24:MI:SS')";
recover database;
RELEASE CHANNEL ch00;
}
spool log off
}}}

{{{
run {
ALLOCATE CHANNEL ch00 TYPE 'SBT_TAPE' PARMS 'SBT_LIBRARY=/usr/openv/netbackup/bin/libobk.so64';
SEND 'NB_ORA_SERV=nbumaster, NB_ORA_CLIENT=mls-rac02';
#set UNTIL TIME "to_date('2017-07-01 17:00:00','YYYY-MM-DD HH24:MI:SS')";
restore datafile 2;
RELEASE CHANNEL ch00;
}
}}}

==== restore archivelog by UNTIL TIME ====
{{{
RMAN >
   list backup of archivelog time between "to_date('2017-06-29 17:00:00','YYYY-MM-DD HH24:MI:SS')" and "to_date('2017-07-01 17:00:00','YYYY-MM-DD HH24:MI:SS')";
}}}
{{{
spool log to rman_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=nbumaster, NB_ORA_CLIENT=mls-rac01';
ALLOCATE CHANNEL ch01 TYPE 'SBT_TAPE' PARMS 'SBT_LIBRARY=/usr/openv/netbackup/bin/libobk.so64';
SEND 'NB_ORA_SERV=nbumaster, NB_ORA_CLIENT=mls-rac02';

#set UNTIL TIME "to_date('2017-07-01 17:00:00','YYYY-MM-DD HH24:MI:SS')";
#restore validate database archivelog from sequence 33171;
#RESTORE VALIDATE CHECK LOGICAL ARCHIVELOG from sequence 33171;

restore archivelog from logseq 30013 until logseq 30019 thread=1;
restore archivelog from logseq 33161 until logseq 33169 thread=2;
Line 268: Line 232:

{{{
spool log to rman_v1.log
set echo on
  * Output
{{{
Spooling started in log file: rman_restore-PMSDB-v1.log

Recovery Manager11.2.0.4.0

RMAN> set echo on

echo set on
Line 273: Line 243:
ALLOCATE CHANNEL ch00 TYPE 'SBT_TAPE' PARMS 'SBT_LIBRARY=/usr/openv/netbackup/bin/libobk.so64';
SEND 'NB_ORA_SERV=nbumaster, NB_ORA_CLIENT=mls-rac02';
set UNTIL TIME "to_date('2017-07-01 17:00:00','YYYY-MM-DD HH24:MI:SS')";
set until sequence 30024 thread 1;
recover database;

#restore validate database archivelog all;
#restore validate archivelog all;
#restore archivelog from time "TRUNC(sysdate)" until time "sysdate";
#restore validate archivelog from scn 31231 until scn 33225;
#restore validate archivelog from scn 31178 until scn 33171;
RELEASE CHANNEL ch00;
}
spool log off

}}}
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: ch01



RMAN> 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';2> 3>
4> recover database;
5> RELEASE CHANNEL ch00;
6> }

allocated channel: ch00
channel ch00: SID=1994 device type=SBT_TAPE
channel ch00: Veritas NetBackup for Oracle - Release 7.7.3 (2016051915)

sent command to channel: ch00

Starting recover at 2018-09-13 16:29:39

starting media recovery

archived log for thread 1 with sequence 3 is already on disk as file /oradata/HDPMS/archlog/1_3_984912390.dbf
archived log for thread 1 with sequence 4 is already on disk as file /oradata/HDPMS/archlog/1_4_984912390.dbf
archived log file name=/oradata/HDPMS/archlog/1_3_984912390.dbf thread=1 sequence=3
archived log file name=/oradata/HDPMS/archlog/1_4_984912390.dbf thread=1 sequence=4
unable to find archived log
archived log thread=1 sequence=5
released channel: ch00
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 09/13/2018 16:29:40
RMAN-06054: media recovery requesting unknown archived log for thread 1 with sequence 5 and starting SCN of 1817651

}}}

{{{
$ export 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.

}}}

* Output v2
{{{

SQL> recover database until cancel using backup controlfile;
ORA-00279: change 1817378 generated at 09/13/2018 11:18:50 needed for thread 1
ORA-00289: suggestion : /oradata/HDPMS/archlog/1_3_984912390.dbf
ORA-00280: change 1817378 for thread 1 is in sequence #3


Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
CANCEL
ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below
ORA-01152: file 1 was not restored from a sufficiently old backup
ORA-01110: data file 1: '/oradata/HDPMS/system01.dbf'


ORA-01112: media recovery not started


}}}
Line 292: Line 378:

== NBU restore script ==

 * recovery catalog (if used). At the rman command prompt, enter the following:
{{{
crosscheck backupset of database;
}}}

Use restore ... validate when you want RMAN to choose the backups to test.

NetBackup 7.7.1 AdministratorGuide => 131 to 138 pages


https://www.veritas.com/support/en_US/article.HOWTO64200
 1. Make sure you have installed Oracle with the same user as used on the original source client machine
 2. Install NetBackup Client and Oracle agent
 3. Patch if needed
 4. Touch the file on the master server: => /usr/openv/netbackup/db/altnames/No.Restrictions
 5. Browse the Oracle backups by running /usr/openv/netbackup/bin/bplist -S <master server> - C <Oracle source client name> -t 4 -l -R /
   => Make sure you can browse the backups
 6. Restore the control file (in NOMOUNT mode) - See exact steps for this procedure in technote HOWTO63971
   {{{
   => SQL> STARTUP NOMOUNT pfile='/u01/xxx.ora'
  rman nocatalog
   => RMAN> connect target
   => RMAN> SET DBID=XXXXXX
      RMAN> restore controlfile from '/tmp/xxx';
   }}}
 7. Restore the database (in MOUNT mode)
 {{{
 RMAN> mount database
 

 8. Restore the database using the script in /usr/openv/netbackup/ext/db_ext/oracle/samples/rman/database_restore.sh
{{{
 SQL> ALTER DATABASE BACKUP CONTROLFILE TO TRACE RESETLOGS;
 ALTER DATABASE RENAME FILE '/old/location' TO '/new/location';

 SQL> select log_mode from v$database;
 SQL> select name from v$datafile;
 SQL> select member from v$logfile;
 SQL> select name from v$tempfile;
 SQL> select name from v$controlfile;
}}}


 * SQL> SELECT NAME,FILE#,STATUS FROM V$DATAFILE;
{{{
RUN {
  ALLOCATE CHANNEL ch00 TYPE 'SBT_TAPE';
  ALLOCATE CHANNEL ch01 TYPE 'SBT_TAPE';
  SEND 'NB_ORA_SERV=<master server>, NB_ORA_CLIENT=<Oracle source client name>’;
  set newname for datafile 1 to '/data/lsdb/datafile/system01.dbf'
  set newname for datafile 2 to '/data/lsdb/datafile/sysaux01.dbf'
  RESTORE DATABASE;
  RECOVER DATABASE;
  sql 'alter database open resetlogs';
  RELEASE CHANNEL ch00;
  RELEASE CHANNEL ch01;
}
{{{
SQL> alter database open resetlogs;
Database altered.
}}}
  * Output
{{{
SQL> alter database open resetlogs;
alter database open resetlogs
*
ERROR at line 1:
ORA-01152: file 1 was not restored from a sufficiently old backup
ORA-01110: data file 1: '/oradata/HDPMS/system01.dbf'

Restore SINGLE 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

  1. Successful Netbackup backup of set.
  2. Same version of database.
  3. Record Source DBID/DATAFILE/TABLESPACE.
  4. Install database software only on Destination client.
  5. Install Netbackup client software on Destination client.
  6. 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;

SQL> select member from v$logfile;

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.

HDPMS.__db_cache_size=4160749568
HDPMS.__java_pool_size=16777216
HDPMS.__large_pool_size=33554432
HDPMS.__oracle_base='/oracle/app/oracle'#ORACLE_BASE set from environment
HDPMS.__pga_aggregate_target=894498816
HDPMS.__sga_target=3066719232
HDPMS.__shared_io_pool_size=0
HDPMS.__shared_pool_size=805306368
HDPMS.__streams_pool_size=16777216
*.audit_file_dest='/oracle/app/oracle/admin/HDPMS/adump'
*.audit_trail='db'
*.compatible='11.2.0.4.0'
*.control_files='/oracle/app/oracle/oradata/HDPMS/control01.ctl','/oracle/app/oracle/oradata/HDPMS/control02.ctl'
*.db_block_size=8192
*.db_domain=''
*.db_name='HDPMS'
*.diagnostic_dest='/oracle/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=HDPMSXDB)'
*.log_archive_dest_1='LOCATION=/oradata/HDPMS/archlog'
*.open_cursors=300
*.pga_aggregate_target=1684013056
*.processes=1500
*.remote_login_passwordfile='EXCLUSIVE'
*.sessions=1655
*.sga_target=5052039168
*.undo_retention=7200
*.undo_tablespace='UNDOTBS1'
  • option

[oracle@MC-POSHIS-DB dbs]$ orapwd password=Systec36 file=orapwPMSDB

create directories

mkdir -pv /oracle/app/oracle/admin/HDPMS/adump
mkdir -pv /oracle/app/oracle/oradata/HDPMS
mkdir -pv /oradata/HDPMS/archlog
mkdir -pv /oradata/HDPMS/datafiles/

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_backupsdate +%F_MC-PMS-DB.txt

$ export ORACLE_SID=HDPMS
$ rman target / catalog rman/rman@orcl

RMAN> startup nomount;

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 target / catalog rman/rman@orcl

Recovery Manager: Release 11.2.0.4.0 - Production on Thu Sep 13 15:50:24 2018

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

connected to target database (not started)
connected to recovery catalog database

RMAN> startup nomount;

Oracle instance started

Total System Global Area    5044088832 bytes

Fixed Size                     2261928 bytes
Variable Size               1442843736 bytes
Database Buffers            3590324224 bytes
Redo Buffers                   8658944 bytes

RMAN> set DBID=2147825860

executing command: SET DBID
database name is "HDPMS" and DBID is 2147825860


RMAN> 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;
}
2> 3> 4> 5> 6>
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

Starting restore at 2018-09-13 15:52:16

channel ch00: restoring control file
channel ch00: restore complete, elapsed time: 00:00:07
output file name=/oracle/app/oracle/oradata/HDPMS/control01.ctl
output file name=/oracle/app/oracle/oradata/HDPMS/control02.ctl
Finished restore at 2018-09-13 15:52:23

released channel: ch00

RMAN>

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 off

RMAN> 
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;
recover database;
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: ch01



RMAN> 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';2> 3>
4> recover database;
5> RELEASE CHANNEL ch00;
6> }

allocated channel: ch00
channel ch00: SID=1994 device type=SBT_TAPE
channel ch00: Veritas NetBackup for Oracle - Release 7.7.3 (2016051915)

sent command to channel: ch00

Starting recover at 2018-09-13 16:29:39

starting media recovery

archived log for thread 1 with sequence 3 is already on disk as file /oradata/HDPMS/archlog/1_3_984912390.dbf
archived log for thread 1 with sequence 4 is already on disk as file /oradata/HDPMS/archlog/1_4_984912390.dbf
archived log file name=/oradata/HDPMS/archlog/1_3_984912390.dbf thread=1 sequence=3
archived log file name=/oradata/HDPMS/archlog/1_4_984912390.dbf thread=1 sequence=4
unable to find archived log
archived log thread=1 sequence=5
released channel: ch00
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 09/13/2018 16:29:40
RMAN-06054: media recovery requesting unknown archived log for thread 1 with sequence 5 and starting SCN of 1817651

$ export 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.

* Output v2

SQL> recover database until cancel using backup controlfile;
ORA-00279: change 1817378 generated at 09/13/2018 11:18:50 needed for thread 1
ORA-00289: suggestion : /oradata/HDPMS/archlog/1_3_984912390.dbf
ORA-00280: change 1817378 for thread 1 is in sequence #3


Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
CANCEL
ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below
ORA-01152: file 1 was not restored from a sufficiently old backup
ORA-01110: data file 1: '/oradata/HDPMS/system01.dbf'


ORA-01112: media recovery not started

Open database

SQL> alter database open resetlogs;
Database altered.
  • Output

SQL> alter database open resetlogs;
alter database open resetlogs
*
ERROR at line 1:
ORA-01152: file 1 was not restored from a sufficiently old backup
ORA-01110: data file 1: '/oradata/HDPMS/system01.dbf'

Troubleshooting

désert/workarea/ayy/restore-PMSDB (last edited 2018-09-28 07:03:11 by merlyn)