|
Size: 10641
Comment:
|
Size: 10218
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. |
Restore RAC database to different client
Envirenment
- 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)
- DBID=920906249
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.
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
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
Client/Media Server
Master&Media
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 CONNECT_OPTIONS = localhost 1 0 2
- Destination Client (rac-restore)
[root@rac-restore ~]# cat /usr/openv/netbackup/bp.conf SERVER = nbumaster CLIENT_NAME = rac-restore CONNECT_OPTIONS = localhost 1 0 2
Excute restore
Create initPMSDB.ora & orapwd file
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' *.audit_trail='db' *.compatible='11.2.0.4.0' *.control_files='/rac-restore/PMSDB/controlfile/ctrl_dPMSDB.ctl' *.db_block_size=8192 *.db_create_file_dest='/rac-restore' *.db_domain='' *.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' *.open_cursors=300 *.pga_aggregate_target=3221225472 *.processes=300 *.remote_login_passwordfile='exclusive' *.sessions=335 *.sga_target=7516192768 *.undo_tablespace='UNDOTBS1'
[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
create directories
[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'
restore controlfile
- find out correct controlfile in Netbackup
/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
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;
RELEASE CHANNEL ch00;
}
RMAN> startup mount- output
RMAN> startup mount;
database is already started database mounted
}}}
restore database by UNTIL TIME
- 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';
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
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';
run {
restore database;
recover database;
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 offrun {
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;
RELEASE CHANNEL ch00;
RELEASE CHANNEL ch01;
}
spool log offspool log to rman_v1.log
set echo on
RMAN> 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')";
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
Open database
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
- Make sure you have installed Oracle with the same user as used on the original source client machine
Install NetBackup Client and Oracle agent
- Patch if needed
Touch the file on the master server: => /usr/openv/netbackup/db/altnames/No.Restrictions
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
- 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';
- 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;
}
