Rechercher dans ce blog

mercredi 9 novembre 2011

RMAN : restore TDP de prod en qa

Procédure   restore  sur un  autre serveur    de  BDO



1         Introduction :

Serveur  source  mtlunt06
Serveur  cible :mtlunt41
BD  source : BDO
BD  cible : BDOQA
On souhaite   faire une restore  au 8 novembre 2011.


On  aurait  pu faire  un  duplicate mais sur la base  source mais   on a  le parametre
Remote_login_password=none  donc on ne   peut  pas  faire de   connexion RMAN  directement   sur cette  bd.

L alternative   et de  faire   un backup du  controlfile   sur  mtlunt06  le  copier  via  ftp/scp  sur  mtlunt41  en lieu  et  place des  comtrolfile d  origine.
Puis  on doit  monter  la bd   et faire une  restore  via  les  commandes  RMAN set newname.

2           Config  TSM     sur   mtlunt41 :

Les  fichiers   clefs   sont  

2.1      /usr/bin/ dsm.opt

oracle@mtlunt41@BDOQA (/usr/bin)$ cat  dsm.opt
************************************************************************
* IBM Tivoli Storage Manager                                           *
*                                                                      *
* Sample Client User Options file for UNIX (dsm.opt.smp)               *
************************************************************************

*  This file contains an option you can use to specify the TSM
*  server to contact if more than one is defined in your client
*  system options file (dsm.sys).  Copy dsm.opt.smp to dsm.opt.
*  If you enter a server name for the option below, remove the
*  leading asterisk (*).

************************************************************************

* SErvername       A server name defined in the dsm.sys file
SERVERNAME TSM_HQ
PASSWORD MTLUNT06
*SERVERNAME TSM_DEV
* PASSWORD MTLUNT41
QUIET
DOMAIN /
DOMAIN /appl
DOMAIN /db/arch
DOMAIN /db/redo
DOMAIN /db/undo

2.2        /us/bin/dsm.sys

************************************************************************
* IBM Tivoli Storage Manager                                           *
*                                                                      *
* Sample Client System Options file for UNIX (dsm.sys.smp)             *
************************************************************************

*  This file contains the minimum options required to get started
*  using TSM.  Copy dsm.sys.smp to dsm.sys.  In the dsm.sys file,
*  enter the appropriate values for each option listed below and
*  remove the leading asterisk (*) for each one.

*  If your client node communicates with multiple TSM servers, be
*  sure to add a stanza, beginning with the SERVERNAME option, for
*  each additional server.

************************************************************************
SErvername  tsm_hq
EXCLUDE.DIR "/tmp"
NODEname mtlunt06
EXCLUDE.DIR "/var/tmp"
EXCLUDE.DIR "/export/home/Qa/api/Queue"
MANAGEDSERVICES SCHEDULE
SCHEDLOGNAME "/var/tmp/dsmsched.log"
SCHEDMODE PROMPTED
ERRORLOGNAME "/var/tmp/dsmerror.log"
   COMMMethod         TCPip
   TCPPort            1500
   TCPWindowsize      48
   TCPServeraddress   tsm_hq.noam.transat.local
* PASSWORDACCESS GENERATE

SErvername MTLUNT06_ORA
COMMMethod TCPip
TCPServeraddress 10.80.1.73
passwordaccess generate
passworddir /appl/home/app/oracle
nodename MTLUNT06_ORA
inclexcl /usr/bin/include.def

Faudrait   modifier ces parametres  pour tester :

TCPWindowsize    63
TXNBytelimit 2097152
largecommbuffers no

Les  parties en  gras sont  a  rajouter  ou  modifier  par  le  root..

2.3      /opt/tivoli/tsm/client/oracle/bin64/dsm.opt

************************************************************************
* IBM Tivoli Storage Manager                                           *
*                                                                      *
* Sample Client User Options file for UNIX (dsm.opt.smp)               *
************************************************************************

*  This file contains an option you can use to specify the TSM
*  server to contact if more than one is defined in your client
*  system options file (dsm.sys).  Copy dsm.opt.smp to dsm.opt.
*  If you enter a server name for the option below, remove the
*  leading asterisk (*).

************************************************************************

* SErvername       A server name defined in the dsm.sys file
SERVERNAME MTLUNT06_ORA

2.4      /opt/tivoli/tsm/client/oracle/bin64/dsm.opt

************************************************************************
* IBM Tivoli Storage Manager                                           *
*                                                                      *
* Sample Client User Options file for UNIX (dsm.opt.smp)               *
************************************************************************

*  This file contains an option you can use to specify the TSM
*  server to contact if more than one is defined in your client
*  system options file (dsm.sys).  Copy dsm.opt.smp to dsm.opt.
*  If you enter a server name for the option below, remove the
*  leading asterisk (*).

************************************************************************

* SErvername       A server name defined in the dsm.sys file
SERVERNAME MTLUNT06_ORA
oracle@mtlunt41@BDOQA (/usr/bin)$ cat  /opt/tivoli/tsm/client/oracle/bin64/tdpo.opt
***************************************************************************
* IBM Tivoli Storage Manager for Databases
* Data Protection for Oracle
*
* Sample tdpo.opt for the Solaris 64bit Data Protection for Oracle
*********************************************************************

DSMI_ORC_CONFIG    /opt/tivoli/tsm/client/oracle/bin64/dsm.opt
DSMI_LOG           /var/tmp/

TDPO_FS            BDO
*TDPO_NODE         MTLUNT06_ORA
*TDPO_OWNER        oradba
*TDPO_PSWDPATH     /home/oracle

TDPO_DATE_FMT      4
TDPO_NUM_FMT       4
TDPO_TIME_FMT      1

*TDPO_MGMT_CLASS_2   mgmtclass2
*TDPO_MGMT_CLASS_3   mgmtclass3
*TDPO_MGMT_CLASS_4   mgmtclass4
Ces commandes  peuvent  servir :

TDPOCONF  showenv
Tdpoconf password

Les  droits  sur  les 2  fichiers :
-rwxr-xr-x   1 root     other        805 Sep 15  2009 dsm.opt
-rwxr-xr-x   1 root     other        656 Sep 15  2009 tdpo.opt

3         Au  niveau  BD 

3.1      Sur  le  serveur   source (mtlunt06)

Backup  du  controlfile

alter  database  backup  controlfile  to  '/appl/home/app/oracle/mg/ctl_bck.ctl';
 « puis   transfert   en  lieu  et  place  des controlfile.

Construction  des  set newname :
sur la base source  via sqlplus : 

col CMD for a120
set line 200
set pages 0
select 'set newname for datafile ' ||file#||' to ''/db/data/BDOQA/'||substr(name,14) ||''';' CMD from v$datafile_header  where name like '%/data/%';

select 'set newname for datafile ' ||file#||' to ''/db/index/BDOQA/'||substr(name,15) ||''';' CMD from v$datafile_header  where name like '%/index/%';

output  suivante
set newname for datafile 21 to '/db/index/BDOQA/ODS_PNR_SMALL_I01_01.dbf';
set newname for datafile 22 to '/db/index/BDOQA/ODS_WRKPNR_SMALL_I01_01.dbf';
set newname for datafile 23 to '/db/index/BDOQA/ODS_REF_SMALL_I01_01.dbf';

3.2      Sur  le  serveur   cible (mtlunt41) :

3.2.1      Modification  du   db_name

Dans  l init  il faut  modifier le db_name de BDOQA a BDO  pou  etre en pahse avec le  conntrolfile qu  on va restaurer.

3.2.2      Interrogation   rman pour cibler le SCN

Suite    a  la copie  du  controlfile  on  est en  mesure de  monter  la base et  d interroger  le  controlfile   via  RMAN  pour avoir  le  scn .

Rman  target /

list  backup   of database  summary;

using target database controlfile instead of recovery catalog

List of Backups
===============
Key     TY LV S Device Type Completion Time #Pieces #Copies Tag
------- -- -- - ----------- --------------- ------- ------- ---
17641   B  F  A SBT_TAPE    13-OCT-11       1       1       BACKUP_BDO_101211110000
17642   B  F  A SBT_TAPE    13-OCT-11       1       1       BACKUP_BDO_101211110000
17643   B  F  A SBT_TAPE    13-OCT-11       1       1       BACKUP_BDO_101211110000
17644   B  F  A SBT_TAPE    13-OCT-11       1       1       BACKUP_BDO_101211110000
….
18372   B  F  A SBT_TAPE    08-NOV-11       1       1       BACKUP_BDO_110711110005
18373   B  F  A SBT_TAPE    08-NOV-11       1       1       BACKUP_BDO_110711110005
18374   B  F  A SBT_TAPE    08-NOV-11       1       1       BACKUP_BDO_110711110005
18375   B  F  A SBT_TAPE    08-NOV-11       1       1       BACKUP_BDO_110711110005
18376   B  F  A SBT_TAPE    08-NOV-11       1       1       BACKUP_BDO_110711110005
18377   B  F  A SBT_TAPE    08-NOV-11       1       1       BACKUP_BDO_110711110005
18378   B  F  A SBT_TAPE    08-NOV-11       1       1       BACKUP_BDO_110711110005
18379   B  F  A SBT_TAPE    08-NOV-11       1       1       BACKUP_BDO_110711110005
18380   B  F  A SBT_TAPE    08-NOV-11       1       1       BACKUP_BDO_110711110005
18381   B  F  A SBT_TAPE    08-NOV-11       1       1       BACKUP_BDO_110711110005
18382   B  F  A SBT_TAPE    08-NOV-11       1       1       BACKUP_BDO_110711110005
18383   B  F  A SBT_TAPE    08-NOV-11       1       1       BACKUP_BDO_110711110005
18384   B  F  A SBT_TAPE    08-NOV-11       1       1       BACKUP_BDO_110711110005
18385   B  F  A SBT_TAPE    08-NOV-11       1       1       BACKUP_BDO_110711110005
18386   B  F  A SBT_TAPE    08-NOV-11       1       1       BACKUP_BDO_110711110005
18387   B  F  A SBT_TAPE    08-NOV-11       1       1       BACKUP_BDO_110711110005
18388   B  F  A SBT_TAPE    08-NOV-11       1       1       BACKUP_BDO_110711110005
18389   B  F  A SBT_TAPE    08-NOV-11       1       1       BACKUP_BDO_110711110005
18390   B  F  A SBT_TAPE    08-NOV-11       1       1       BACKUP_BDO_110711110005
18391   B  F  A SBT_TAPE    08-NOV-11       1       1       BACKUP_BDO_110711110005
18392   B  F  A SBT_TAPE    08-NOV-11       1       1       BACKUP_BDO_110711110005
18393   B  F  A SBT_TAPE    08-NOV-11       1       1       BACKUP_BDO_110711110005
18394   B  F  A SBT_TAPE    08-NOV-11       1       1       BACKUP_BDO_110711110005
18395   B  F  A SBT_TAPE    08-NOV-11       1       1       BACKUP_BDO_110711110005
18396   B  F  A SBT_TAPE    08-NOV-11       1       1       BACKUP_BDO_110711110005
18397   B  F  A SBT_TAPE    08-NOV-11       1       1       BACKUP_BDO_110711110005
18398   B  F  A SBT_TAPE    08-NOV-11       1       1       BACKUP_BDO_110711110005
18399   B  F  A SBT_TAPE    08-NOV-11       1       1       BACKUP_BDO_110711110005
18400   B  F  A SBT_TAPE    08-NOV-11       1       1       BACKUP_BDO_110711110005
18401   B  F  A SBT_TAPE    08-NOV-11       1       1       BACKUP_BDO_110711110005
18402   B  F  A SBT_TAPE    08-NOV-11       1       1       BACKUP_BDO_110711110005
18403   B  F  A SBT_TAPE    08-NOV-11       1       1       BACKUP_BDO_110711110005
18404   B  F  A SBT_TAPE    08-NOV-11       1       1       BACKUP_BDO_110711110005
18405   B  F  A SBT_TAPE    08-NOV-11       1       1       BACKUP_BDO_110711110005
18406   B  F  A SBT_TAPE    08-NOV-11       1       1       BACKUP_BDO_110711110005
18410   B  F  A SBT_TAPE    08-NOV-11       1       1       BACKUP_BDO_110811110002

RMAN> list backupset  18410;


List of Backup Sets
===================

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
18410   Full    35G        SBT_TAPE    00:50:09     08-NOV-11
        BP Key: 18410   Status: AVAILABLE   Tag: BACKUP_BDO_110811110002
        Piece Name: 0jmr6484_1_1
  List of Datafiles in backup set 18410
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  6       Full 9611298080 08-NOV-11 /db/data/BDO/ODS_WRKPNR_SMALL_D01_01.dbf
  8       Full 9611298080 08-NOV-11 /db/data/BDO/ODS_HDV_SMALL_D01_01.dbf
  18      Full 9611298080 08-NOV-11 /db/data/BDO/ODS_PNR_LARGE_D01_01.dbf
  37      Full 9611298080 08-NOV-11 /db/index/BDO/ODS_PNR_LARGE_I01_02.dbf
  39      Full 9611298080 08-NOV-11 /db/data/BDO/ODS_PIL_LARGE_D011.dbf
  44      Full 9611298080 08-NOV-11 /db/index/BDO/ODS_PNR_LARGE_I01_01.dbf
  125     Full 9611298080 08-NOV-11 /db/undo/BDO/undorbs.dbf

Voila   le  scn 9611298080 qui   nous  interesse  pour   revenir  au  8 Novembre au  matin.

3.2.3      Le  script  de  restore :

Il  resulte des commandes set  newname et   de l interrogation RMAN  ci-dessus.
run {
set until   scn 9611298081;
set newname for datafile 21 to '/db/index/BDOQA/ODS_PNR_SMALL_I01_01.dbf';
set newname for datafile 22 to '/db/index/BDOQA/ODS_WRKPNR_SMALL_I01_01.dbf';
set newname for datafile 23 to '/db/index/BDOQA/ODS_REF_SMALL_I01_01.dbf';
set newname for datafile 24 to '/db/index/BDOQA/ODS_HDV_SMALL_I01_01.dbf';
set newname for datafile 25 to '/db/index/BDOQA/ODS_WRKHDV_SMALL_I01_01.dbf';
set newname for datafile 26 to '/db/index/BDOQA/ODS_PIL_SMALL_I01_01.dbf';
set newname for datafile 27 to '/db/index/BDOQA/ODS_WRKODS_SMALL_I01_01.dbf';
set newname for datafile 28 to '/db/index/BDOQA/ODS_PNR_MED_I01_01.dbf';
set newname for datafile 29 to '/db/index/BDOQA/ODS_PNR_MED_I01_02.dbf';
set newname for datafile 30 to '/db/index/BDOQA/ODS_WRKPNR_MED_I01_02.dbf';
set newname for datafile 31 to '/db/index/BDOQA/ODS_WRKPNR_MED_I01_01.dbf';
set newname for datafile 32 to '/db/index/BDOQA/ODS_REF_MED_I01_01.dbf';
set newname for datafile 33 to '/db/index/BDOQA/ODS_HDV_MED_I01_01.dbf';
set newname for datafile 34 to '/db/index/BDOQA/ODS_PIL_MED_I01_01.dbf';
set newname for datafile 35 to '/db/index/BDOQA/ODS_PNR_LARGE_I01_04.dbf';
set newname for datafile 36 to '/db/index/BDOQA/ODS_PNR_LARGE_I01_03.dbf';
set newname for datafile 37 to '/db/index/BDOQA/ODS_PNR_LARGE_I01_02.dbf';
set newname for datafile 40 to '/db/index/BDOQA/ODS_PIL_LARGE_I011.dbf';
set newname for datafile 42 to '/db/index/BDOQA/RFO_SMALL_I01_01.dbf';
set newname for datafile 43 to '/db/index/BDOQA/ODS_PNR_MED_I01_03.dbf';
set newname for datafile 44 to '/db/index/BDOQA/ODS_PNR_LARGE_I01_01.dbf';
set newname for datafile 47 to '/db/index/BDOQA/KPIPNT_I01_01.dbf';
set newname for datafile 49 to '/db/index/BDOQA/ODS_HDV_LARGE_I01_01.dbf';
set newname for datafile 51 to '/db/index/BDOQA/ODS_WRKHVT_LARGE_I01_01.dbf';
set newname for datafile 54 to '/db/index/BDOQA/ODS_HAN_SMALL_I01_01.dbf';
set newname for datafile 56 to '/db/index/BDOQA/ODS_HAN_MED_I01_01.dbf';
set newname for datafile 60 to '/db/index/BDOQA/ODS_WRKHDV_MED_I01_01.dbf';
set newname for datafile 62 to '/db/index/BDOQA/ODS_HVT_LARGE_I01_11.dbf';
set newname for datafile 64 to '/db/index/BDOQA/pnl_small_i01_01.dbf';
set newname for datafile 69 to '/db/index/BDOQA/ODS_PNR_MED_I01_08.dbf';
set newname for datafile 70 to '/db/index/BDOQA/ODS_PNR_MED_I01_04.dbf';
set newname for datafile 72 to '/db/index/BDOQA/ODS_PGM_SMALL_I01_01.dbf';
set newname for datafile 73 to '/db/index/BDOQA/ODS_HVT_LARGE_I01_08.dbf';
set newname for datafile 74 to '/db/index/BDOQA/ODS_HVT_LARGE_I01_09.dbf';
set newname for datafile 76 to '/db/index/BDOQA/ODS_TRF_SMALL_I01_01.dbf';
set newname for datafile 78 to '/db/index/BDOQA/ODS_TRF_MED_I01_01.dbf';
set newname for datafile 82 to '/db/index/BDOQA/ODS_HVT_SMALL_I01_01.dbf';
set newname for datafile 84 to '/db/index/BDOQA/ODS_HVT_MED_I01_01.dbf';
set newname for datafile 86 to '/db/index/BDOQA/ODS_HVT_LARGE_I01_01.dbf';
set newname for datafile 90 to '/db/index/BDOQA/ODS_WRKHVT_SMALL_I01_01.dbf';
set newname for datafile 92 to '/db/index/BDOQA/ODS_WRKHVT_MED_I01_01.dbf';
set newname for datafile 94 to '/db/index/BDOQA/ODS_WRKPNR_LARGE_I01_01.dbf';
set newname for datafile 95 to '/db/index/BDOQA/ODS_HVT_LARGE_I01_02.dbf';
set newname for datafile 96 to '/db/index/BDOQA/ODS_HVT_LARGE_I01_06.dbf';
set newname for datafile 98 to '/db/index/BDOQA/ODS_PNR_MED_I01_09.dbf';
set newname for datafile 99 to '/db/index/BDOQA/ODS_PNR_MED_I01_05.dbf';
set newname for datafile 101 to '/db/index/BDOQA/ODS_HVT_LARGE_I01_03.dbf';
set newname for datafile 103 to '/db/index/BDOQA/ODS_HVT_MED_I01_02.dbf';
set newname for datafile 104 to '/db/index/BDOQA/ODS_HVT_MED_I01_03.dbf';
set newname for datafile 107 to '/db/index/BDOQA/ODS_HVT_MED_I01_04.dbf';
set newname for datafile 108 to '/db/index/BDOQA/ODS_HVT_SMALL_I01_02.dbf';
set newname for datafile 111 to '/db/index/BDOQA/ODS_PIL_LARGE_I02.dbf';
set newname for datafile 113 to '/db/index/BDOQA/ODS_PNR_MED_I01_06.dbf';
set newname for datafile 114 to '/db/index/BDOQA/ODS_HVT_LARGE_I01_10.dbf';
set newname for datafile 118 to '/db/index/BDOQA/ODS_HVT_LARGE_I01_04.dbf';
set newname for datafile 119 to '/db/index/BDOQA/ODS_HVT_LARGE_I01_05.dbf';
set newname for datafile 121 to '/db/index/BDOQA/ODS_PNR_LARGE_I01_05.dbf';
set newname for datafile 124 to '/db/index/BDOQA/ODS_PNR_MED_I01_10.dbf';
set newname for datafile 130 to '/db/index/BDOQA/ODS_HVT_LARGE_I01_07.dbf';
set newname for datafile 131 to '/db/index/BDOQA/ODS_PNR_MED_I01_07.dbf';
set newname for datafile 133 to '/db/index/BDOQA/ODS_TRF_MED_I01_02.dbf';
set newname for datafile 134 to '/db/index/BDOQA/ODS_PNR_MED_I01_11.dbf';
set newname for datafile 1 to '/db/data/BDOQA/system01.dbf';
set newname for datafile 2 to '/db/data/BDOQA/ODS_PNR_LARGE_D01_06.dbf';
set newname for datafile 3 to '/db/data/BDOQA/ODS_PNR_LARGE_D01_09.dbf';
set newname for datafile 4 to '/db/data/BDOQA/users01.dbf';
set newname for datafile 5 to '/db/data/BDOQA/ODS_PNR_SMALL_D01_01.dbf';
set newname for datafile 6 to '/db/data/BDOQA/ODS_WRKPNR_SMALL_D01_01.dbf';
set newname for datafile 7 to '/db/data/BDOQA/ODS_REF_SMALL_D01_01.dbf';
set newname for datafile 8 to '/db/data/BDOQA/ODS_HDV_SMALL_D01_01.dbf';
set newname for datafile 9 to '/db/data/BDOQA/ODS_WRKHDV_SMALL_D01_01.dbf';
set newname for datafile 10 to '/db/data/BDOQA/ODS_PIL_SMALL_D01_01.dbf';
set newname for datafile 11 to '/db/data/BDOQA/ODS_WRKODS_SMALL_D01_01.dbf';
set newname for datafile 12 to '/db/data/BDOQA/ODS_WRKPNR_MED_D01_01.dbf';
set newname for datafile 13 to '/db/data/BDOQA/ODS_PNR_MED_D01_01.dbf';
set newname for datafile 14 to '/db/data/BDOQA/ODS_PNR_MED_D01_02.dbf';
set newname for datafile 15 to '/db/data/BDOQA/ODS_REF_MED_D01_01.dbf';
set newname for datafile 16 to '/db/data/BDOQA/ODS_HDV_MED_D01_01.dbf';
set newname for datafile 17 to '/db/data/BDOQA/ODS_PIL_MED_D01_01.dbf';
set newname for datafile 18 to '/db/data/BDOQA/ODS_PNR_LARGE_D01_01.dbf';
set newname for datafile 19 to '/db/data/BDOQA/ODS_PNR_LARGE_D01_02.dbf';
set newname for datafile 20 to '/db/data/BDOQA/ODS_PNR_LARGE_D01_03.dbf';
set newname for datafile 38 to '/db/data/BDOQA/DBA_TOOLS.dbf';
set newname for datafile 39 to '/db/data/BDOQA/ODS_PIL_LARGE_D011.dbf';
set newname for datafile 41 to '/db/data/BDOQA/RFO_SMALL_D01_01.dbf';
set newname for datafile 45 to '/db/data/BDOQA/ODS_WRKPNR_MED_DO1_02.dbf';
set newname for datafile 46 to '/db/data/BDOQA/KPIPNT_D01_01.dbf';
set newname for datafile 48 to '/db/data/BDOQA/ODS_HDV_LARGE_D01_01.dbf';
set newname for datafile 50 to '/db/data/BDOQA/ODS_WRKPNR_MED_D01_03.dbf';
set newname for datafile 52 to '/db/data/BDOQA/ODS_PNR_LARGE_D01_04.dbf';
set newname for datafile 53 to '/db/data/BDOQA/ODS_HAN_SMALL_D01_01.dbf';
set newname for datafile 55 to '/db/data/BDOQA/ODS_HAN_MED_D01_01.dbf';
set newname for datafile 57 to '/db/data/BDOQA/ODS_WRKPNR_LARGE_D01_01.dbf';
set newname for datafile 58 to '/db/data/BDOQA/ODS_WRKPNR_LARGE_D01_02.dbf';
set newname for datafile 59 to '/db/data/BDOQA/ODS_WRKHDV_MED_D01_01.dbf';
set newname for datafile 61 to '/db/data/BDOQA/ODS_PNR_LARGE_D01_05.dbf';
set newname for datafile 63 to '/db/data/BDOQA/pnl_small_d01_01.dbf';
set newname for datafile 65 to '/db/data/BDOQA/ODS_PNR_LARGE_D01_17.dbf';
set newname for datafile 66 to '/db/data/BDOQA/ODS_WRKPNR_LARGE_D01_03.dbf';
set newname for datafile 67 to '/db/data/BDOQA/ODS_PNR_LARGE_D01_18.dbf';
set newname for datafile 68 to '/db/data/BDOQA/ODS_PNR_LARGE_D01_07.dbf';
set newname for datafile 71 to '/db/data/BDOQA/ODS_PGM_SMALL_D01_01.dbf';
set newname for datafile 75 to '/db/data/BDOQA/ODS_TRF_SMALL_D01_01.dbf';
set newname for datafile 77 to '/db/data/BDOQA/ODS_TRF_MED_D01_01.dbf';
set newname for datafile 79 to '/db/data/BDOQA/ODS_HVT_LARGE_D01_04.dbf';
set newname for datafile 80 to '/db/data/BDOQA/ODS_TRF_MED_D01_02.dbf';
set newname for datafile 81 to '/db/data/BDOQA/ODS_HVT_SMALL_D01_01.dbf';
set newname for datafile 83 to '/db/data/BDOQA/ODS_HVT_MED_D01_01.dbf';
set newname for datafile 85 to '/db/data/BDOQA/ODS_HVT_LARGE_D01_01.dbf';
set newname for datafile 87 to '/db/data/BDOQA/ODS_HVT_LARGE_D01_02.dbf';
set newname for datafile 88 to '/db/data/BDOQA/ODS_HVT_LARGE_D01_03.dbf';
set newname for datafile 89 to '/db/data/BDOQA/ODS_WRKHVT_SMALL_D01_01.dbf';
set newname for datafile 91 to '/db/data/BDOQA/ODS_WRKHVT_MED_D01_01.dbf';
set newname for datafile 93 to '/db/data/BDOQA/ODS_WRKHVT_LARGE_D01_01.dbf';
set newname for datafile 97 to '/db/data/BDOQA/ODS_PNR_LARGE_D01_08.dbf';
set newname for datafile 100 to '/db/data/BDOQA/ODS_WRKPNR_LARGE_D01_04.dbf';
set newname for datafile 102 to '/db/data/BDOQA/ODS_PNR_LARGE_D01_15.dbf';
set newname for datafile 105 to '/db/data/BDOQA/ODS_PIL_LARGE_D012.dbf';
set newname for datafile 106 to '/db/data/BDOQA/ODS_PNR_MED_D01_03.dbf';
set newname for datafile 109 to '/db/data/BDOQA/ODS_PNR_MED_D01_08.dbf';
set newname for datafile 110 to '/db/data/BDOQA/ODS_PNR_LARGE_D01_10.dbf';
set newname for datafile 112 to '/db/data/BDOQA/ODS_PNR_LARGE_D01_19.dbf';
set newname for datafile 115 to '/db/data/BDOQA/ODS_PNR_LARGE_D01_11.dbf';
set newname for datafile 116 to '/db/data/BDOQA/ODS_WRKPNR_LARGE_D01_06.dbf';
set newname for datafile 117 to '/db/data/BDOQA/ODS_WRKPNR_LARGE_D01_05.dbf';
set newname for datafile 120 to '/db/data/BDOQA/ODS_PNR_LARGE_D01_14.dbf';
set newname for datafile 122 to '/db/data/BDOQA/ODS_PNR_MED_D01_04.dbf';
set newname for datafile 123 to '/db/data/BDOQA/ODS_PNR_LARGE_D01_12.dbf';
set newname for datafile 126 to '/db/data/BDOQA/ODS_PNR_LARGE_D01_13.dbf';
set newname for datafile 127 to '/db/data/BDOQA/ODS_PNR_MED_D01_06.dbf';
set newname for datafile 128 to '/db/data/BDOQA/ODS_PNR_MED_D01_05.dbf';
set newname for datafile 129 to '/db/data/BDOQA/ODS_PNR_LARGE_D01_16.dbf';
set newname for datafile 132 to '/db/data/BDOQA/ODS_PNR_MED_D01_07.dbf';
allocate channel t1 type 'SBT_TAPE' parms 'ENV=(TDPO_OPTFILE=/opt/tivoli/tsm/client/oracle/bin64/tdpo.opt)';
allocate channel t2 type 'SBT_TAPE' parms 'ENV=(TDPO_OPTFILE=/opt/tivoli/tsm/client/oracle/bin64/tdpo.opt)';
allocate channel t3 type 'SBT_TAPE' parms 'ENV=(TDPO_OPTFILE=/opt/tivoli/tsm/client/oracle/bin64/tdpo.opt)';
restore database;
switch  datafiles  all;
recover database;
release channel t1;
release channel t2;
release channel t3;
}

 Vitesse = 10G/h

3.2.4      Rename  des redo

En  production  on a des Raw devices  alors  qu   QA  on   a   fichiers  redo .
On doit   donc  faire  rename   pour  passer de
/dev/zvol/rdsk/bdoredoraw/redobdo3 a  /db/redo/BDOQA/redobdo3.

  • Sur  le  serveur  source (mtlunt06)
Avec cette  requete  on  construit le script
 select  'alter database  rename  file  '''||MEMBER||''' to  ''/db/redo/BDOQA/'||substr(member,27)||''';'  from v$logfile;

alter database  rename  file  '/dev/zvol/rdsk/bdoredoraw/redobdo3' to  '/db/redo/BDOQA/redobdo3';
alter database  rename  file  '/dev/zvol/rdsk/bdoredoraw/redobdo1' to  '/db/redo/BDOQA/redobdo1';
alter database  rename  file  '/dev/zvol/rdsk/bdoredoraw/redobdo2' to  '/db/redo/BDOQA/redobdo2';

3.2.5      Ouverture de la  bd :

En  resetlogs.