Refreshing BOT Preprod Database with Production Data The BOT database in production (ORBBOTP1) uses a link directory

where each data file has been defined to Oracle to be in a link directory /pac/bbotppm0/app/oracle/admin/ORBBOTP1/links However, in this link directory there is a Unix link pointing to the file system/directory where the data files actually are. The development databases may have a slightly different location for the link directory and this location can be found by querying dba_data_files. Please note that to do restores from the production database to the preprod database, an id will be required with sysdba authority. Example: Load ORBBOTP1 into ORBBOTT3 Target database: ORBBOTP1 (source of the data to load into another database) Auxiliary database: ORBBOTT3 (database to be refreshed with the target data)

1) Take an RMAN backup of the target database ORBBOTP1. A good way to take this backup is to use the entry in CRON for the RMAN daily hot backup: /export/home/oracle/tools/RMAN/bin/rman_ORBBOTP1_hotbkup To find the log, ps –ef | grep –i rman while the backup is running. The backup will produce the following files in the RMAN backup directory /opt/data/oracle/orabkup01/ORBBOTP1/RMAN Below is the correct path /pac/bbotppm0/data/orabkup01/ORBBOTP1/RMAN/pool1 And the files will be: rman_hotbkup_ORBBOTP1_%i_04142010716286532_22lb3ai4_1_1 rman_hotbkup_ORBBOTP1_%i_04142010716286628_23lb3al4_1_1 rman_hotbkup_ORBBOTP1_%i_04142010716286532_21lb3ai4_1_1 rman_archbkup_ORBBOTP1_04142010716286720_25lb3ao0_1_1 rman_archbkup_ORBBOTP1_04142010716286720_24lb3ao0_1_1

Select member from v$logfile.rman_cntrbkup_ORBBOTP1_04142010716286723_26lb3ao3_1_1 rman_cntrbkupc-3587329784-20100414-00 2) Ftp the files to the ORBBOTT3 machine into the directory: /opt/data/oracle/orabkup01/ORBBOTP1/RMAN The above mentioned path is not correct for preprod. We now need to remove all the data files (after we shut down the database) – data files. You do not need to remove the files. use the following queries in the ORBBOTT3 database before shutting it down: Select file_name from from dba_data_files. each will need to be touched. touch each datafile: Ex: touch /opt/data/oracle/oracle03/ORBBOTT3/data/tools01. Show parameter control. RMAN can use the link directory but after the files have been removed. /pac/bbotppm0/data/orabkup01/ORBBOTP1/RMAN/pool1 3) You do not need to run this step. redo logs. control files – the only file we need to leave is the temp data file so we can just reuse that one when we recreate temp. On the ORBBOTT3 machine. First of all login to the Application Server and go to path . To find all the data files to remove. Below is the correct path. DO NOT RUN STEP 3.dbf 4) Now shut down the ORBBOTT3 database Actual process starts from here. The refresh will overwrite the files. After removing the actual files.

You will have to log into the Database Server. Now below are the steps for shutting down the databse. DO NOT REMOVE the FILES. Connect geneva_admin as sysdba . Shutdown immediate . ( Steps : sqlplus geneva_admin@ORBBOTT3 .ksh’ . /export/home/oracle/RMAN/ORBBOTT3_RMAN_rm_files.‘/pac/bbotqpm1/home’ and look for ‘freezecluster.ora in T6 : /bto/sys/oracle/product/10. Execute it and after the refresh is done then we have to unfreeze it by executing ‘unfreezecluster.dbf 6) Start the auxiliary database (ORBBOTT3) Sqlplus ‘/ as sysdba’ Startup force nomount exit 7) Verify you can get into the target database ORBBOTP1 from the ORBBOTT3 machine – sqlplus sys/<password>@ORBBOTP1 If you can’t get in and you know the database and listener are up for ORBBOTP1. Path of tnsnames. This step may not be necessary but I haven’t tested not removing the data files.0/network/admin .ksh’ . ) 5) Do NOT RUN THIS STEP.2. then update the tnsnames on the ORBBOTT3 machine for the ORBBOTP1 database.ksh And then touch each file that was removed: Ex: touch /opt/data/oracle/oracle03/ORBBOTT3/data/tools01. There is a script in /export/home/oracle/RMAN that will remove the data files. Remove the files. These files are hard-coded into the script so you will need to verify this script contains all the database files in ORBBOTT3.

First we’ll go into RMAN and list the backup file list to verify the files that need to be input to the RMAN restore and their corresponding file number. There is another script in /export/home/oracle/RMAN with the format and file names for this ORBBOTP1 database . rman target userid/password@ORBBOTP1 auxiliary userid/password@ORBBOTT3 8) To do the refresh using RMAN. The T3 link directory can be used.---. You just need to verify all the file names are in the script and are correct.dbf BS Key Type LV Size Device Type Elapsed Time Completion Time ------. the ORBBOTT3_RMAN_input.--------. To log into RMAN and list the backup information: Rman> target sys/<password>/@ORBBOTP1 auxiliary sys/<password>@ORBBOTT3 rman target userid/password@ORBBOTP1 auxiliary userid/password@ORBBOTT3 Rman> list backup. we will use the RMAN DB_FILE_NAME_CONVERT approach.---.Again an id can be used with sysdba authority.----------.---3 4 Full 52768123 13-APR-10 /opt/data/oracle/oracle01/ORBBOTP1/admin/link/sysaux01.-.dbf Full 52768123 13-APR-10 /opt/data/oracle/oracle01/ORBBOTP1/admin/link/users01. ORBBOTT3_RMAN_input.--------------58 Full 814M DISK 00:03:05 13-APR-10 BP Key: 58 Status: AVAILABLE Compressed: YES Tag: DAILY_HOTBKUP .---------. This file will be used as a CMD file to RMAN to do the refresh.cmd file will have the mapping from the P1 file name to the T3 file name.-.cmd Using the DB_FILE_NAME_CONVERT method.-----------.---------. List of Datafiles in backup set 57 File LV Type Ckp SCN Ckp Time Name ---.

use the higher SCN number.--------------65 37K DISK 00:00:01 14-APR-10 BP Key: 65 Status: AVAILABLE Compressed: YES Tag: DAILY_HOTBKUP Piece Name: /opt/data/oracle/orabkup01/ORBBOTP1/RMAN/rman_archbkup_ORBBOTP1_04142010716286720_24lb3ao0_1_1 List of Archived Logs in backup set 65 Thrd Seq Low SCN Low Time Next SCN Next Time ---. Ex: Rman> list backup.-.---.dbf You will also need to update the SCN number in this script – you get this number from the RMAN> list backup.---------.dbf Full 52768090 13-APR-10 /opt/data/oracle/oracle01/ORBBOTP1/admin/link/cygent_dat01.--------. If there are two archbackup files.--------.dbf Full 52768090 13-APR-10 /opt/data/oracle/oracle01/ORBBOTP1/admin/link/geneva_dat01.----------.Piece Name: /opt/data/oracle/orabkup01/ORBBOTP1/RMAN/rman_hotbkup_ORBBOTP1_%i_04132010716228407_1rlb1hpn_1_1 List of Datafiles in backup set 58 File LV Type Ckp SCN Ckp Time Name ---.------.--------1 1830 52797102 14-APR-10 52797269 14-APR-10 . Command – the SCN number will be for the archbackup file. You will need to subtract 1 from this number and update the script above.---------.---------.---------.dbf Full 52768090 13-APR-10 /opt/data/oracle/oracle01/ORBBOTP1/admin/link/undotbs01.---1 2 6 7 Full 52768090 13-APR-10 /opt/data/oracle/oracle01/ORBBOTP1/admin/link/system01. BS Key Size Device Type Elapsed Time Completion Time ------.-----------.

---------.---------.----------. We subtract 1 from the number and update the cmd script with 52797268.--------------66 1K DISK 00:00:01 14-APR-10 BP Key: 66 Status: AVAILABLE Compressed: YES Tag: DAILY_HOTBKUP Piece Name: /opt/data/oracle/orabkup01/ORBBOTP1/RMAN/rman_archbkup_ORBBOTP1_04142010716286720_25lb3ao0_1_1 List of Archived Logs in backup set 66 Thrd Seq Low SCN Low Time Next SCN Next Time ---.BS Key Size Device Type Elapsed Time Completion Time ------. We are already in RMAN so we can run our script: Rman> @@/export/home/oracle/RMAN/ ORBBOTT3_RMAN_input.--------1 1829 52797094 14-APR-10 52797102 14-APR-10 In this case the SCN number we are interested in is 52797269.cmd For bbotqpm0 id : @@/pac/bbotqpm0/home/RMAN/ORBBOTT3_RMAN_input. we need to perform the following: a) Add a tempfile to the temp tablespace .--------.------.cmd 10) After the restore is finished.cmd ( If you are already in RMAN then give this way : For bbotqpm1 id : @@/pac/bbotqpm1/home/RMAN/ORBBOTT3_RMAN_input.cmd For U1 : @@/export/home/oracle/RMAN/ORBBOTU1_RMAN_input_new.---------.cmd For T6 : @@/export/home/oracle/RMAN/ORBBOTT6_RMAN_input_using_links.-----------. 9) Now we can kick off the refresh.

First you need to check whether tempfile is there or not by giving the following commands: Log in to SQL and then give the commands : SQL> desc dba_temp_file SQL>select file_name. 11) tablespace may not have a tempfile and if so.sh script. This script has to be run as Oracle User in Dev/Test and as ‘bbotqpm0’ in Preprod. one will have to be added: If the temp tablespace already has a temp file you don’t need to do this.U1: /export/home/oracle/tools/etas_scripts/bin We no longer need to run the post_cloning. we The script I need you guys to run after an RMAN duplicate activity is called rman_<SID>_setup. 12) need to run the RMAN setup script for the database we are loading: To finish. Path Preprod : /pac/bbotqpm0/home/tools/etas_scripts/bin Path T6 . status from dba_temp_files.dbf' SIZE 100M.b) Rename the global name c) Run the password regeneration file d) Run the EDS script setup and reports We can do all this by running the script post_RMAN_Clone. .sh in the bbs directory. tablespace_name. The temp If its not present then give the below commands: ALTER TABLESPACE temp ADD TEMPFILE '/oradata/temp01.

SQL> commit .The file is located in the /pac/<PACID>/app/oracle/admin/<SID>/rman for production and preprod and in the /opt/data/oracle/oracle01/<SID>/admin/rman directory for the other environments. Path for T3 with bbotqpm0 id : /pac/bbotqpm0/app/oracle/admin/ORBBOTT3/rman Path Of this Script in T6: /opt/data/oracle/oracle01/ORBBOTT6/admin/rman Path for U1 : /opt/data/oracle/oracle01/ORBBOTU1/admin/rman Script Name : rman_ORBBOTT6_setup 13) There is quite a probability that an account would have been locked . EXAMPLE of the ORBBOTT3_RMAN_input. so please execute thsese queries before starting the server : SQL> alter user unif_admin account unlock .cmd: bos67528:SID=ORBBOTT3=>cat ORBBOTT3_RMAN_input.cmd run .

duplicate target database to ORBBOTT3 PFILE = /pac/bbotqpm0/app/oracle/product/10.log'.0/dbs/initORBBOTT3.log') size 128M.1. GROUP 3 ('/pac/bbotqpm0/app/oracle/admin/ORBBOTT3/links/redo3_a.log') size 128M. GROUP 2 ('/pac/bbotqpm0/app/oracle/admin/ORBBOTT3/links/redo2_a. '/pac/bbotqpm0/app/oracle/admin/ORBBOTT3/links/redo1_b. GROUP 4 ('/pac/bbotqpm0/app/oracle/admin/ORBBOTT3/links/redo4_a.log') size 128M.log'.{ set until scn 526091539. '/pac/bbotqpm0/app/oracle/admin/ORBBOTT3/links/redo2_b.ora DB_FILE_NAME_CONVERT=('/pac/bbotppm0/app/oracle/admin/ORBBOTP1'.log') size 128M. } Path of backup file in preprod : /pac/bbotppm0/data/orabkup01/ORBBOTP1/RMAN/pool1 Example List of Archived Logs in backup set 831 Thrd Seq Low SCN Low Time Next SCN Next Time .log'. '/pac/bbotqpm0/app/oracle/admin/ORBBOTT3') LOGFILE GROUP 1 ('/pac/bbotqpm0/app/oracle/admin/ORBBOTT3/links/redo1_a. '/pac/bbotqpm0/app/oracle/admin/ORBBOTT3/links/redo3_b.log'. '/pac/bbotqpm0/app/oracle/admin/ORBBOTT3/links/redo4_b.

--------.---.------.---------.---------. } executing Memory Script database opened Finished Duplicate Db at 01-OCT-10 RMAN> **end-of-file** .--------1 174 541820291 29-AUG-10 541937617 30-AUG-10 _______________________________________________________ Success message after running Rman script for refresh : contents of Memory Script: { Alter clone database open resetlogs.

#$½fn$ ½¯$¯ #f° €#€  n¾  ¾#  n f° f€    € ¾¾ °  ° f °€     n°–#°€  n¾  ¾# - f  ¾ ½¾€¾°– °  ff ¾ f –°  ff f¾     % ½¾ ¾½¾– ° f%f ¯°' @@  .

I    ¯  € ¾ @  ¾f¾n½°$ ½$¯ $fn $.°° n– ° f%f ¯°f¾¾¾ f   °¯¯ f  %  % -@D-@@9  @¾¾ ½¯f° ° n ¾¾f f °# ¾ ° ¯°–  ff€ ¾   -@.-f ¯   ff€ ¾ @ ¾ € ¾f f n ° ¾n½¾°  €¾¾n½ n°f°¾f  ff f¾ € ¾° @@  $ ½$¯ $fn $.-%¯%€ ¾ ¾ °  °n fn€ ff¾ ¯    n$½$ ff$fn $fn $ @@$ ff$¾ €  % f ff ff f¾ % @@% ½¾#$f¾¾¾ f# f½€n °¯°   % I €nf°– ° f–  ff f¾  @9€¯  @@¯fn°   ¾½¾¾¾$ ½f¾¾ ' @9 €nf°#– °f° °  ff f¾ f° ¾ ° f ½€ @9  ° ½ f  °¾°f¯ ¾°  @@¯fn° €  @9 ff f¾  9f€°¾°f¯ ¾ f°@  $ $¾¾$fn $½ n$  $° $f ¯° .-$ @@%.

%.–f°f° nf° ¾ ¾¾ ff  ¯f°f– ¾  $½f¾¾ ' @9ff¾  $½f¾¾ ' @@ % @   € ¾¾°–.. ¾  .- %%-.

- ¾ f°  n ¾½° °–€ °¯    @  ¾f° ¾n½°$ ½$¯ $fn $.- €¯ff° € °f¯ ¾ €¾ @9 ff f¾  ©¾°  €f € °f¯ ¾f ° ¾n½ f° f n n @¾€  ¾ f¾f.-f° ¾  fn½€ ¾ € € ¾f °  °½ .-I@ f½½fn ¾ #–°.

-   € ¾   @@%..%.€ .-%°½ n¯  D¾°–  %%-.

-%°½ n¯ €  f  ¯f½½°–€¯ 9€ °f¯  @€ °f¯ @ @°  nnf° ¾  @–°.-I@¯    @@%.-f° ¾  fn½°€¯f°  ¯f° f– ¾¾$ ½f¾¾ $' @9ff¾¾$ ½f¾¾ ' @@ ¯f°f– ¾  $½f¾¾ ' @9ff¾  $½f¾¾ ' @@ ¯f° ¾ fn½   ¾€ff€ ¾° fn½¾   I@½ .

½.

-.

½@¯ -f¯          9 $½$ ff$fn $fn $ @9$f ¯°$°$¾¾f €  9 $½$ ff$fn $fn $ @9$f ¯°$°$¾ ¾ €   @½ I  n @½ f½¾ @¯ .

   9   9  f¾ I .¯½ °@¯         .

¯½ ¾¾ @f– %@ D9 .

-$¯f°% ½% @9% %% ½°%% ¾€ff€ ¾° fn½¾   I@½ .9 n -f¯  $½$ ff$fn $f ½$ @9$.

½.

-.

½@¯ -f¯          9 $½$ ff$fn $fn $ @9$f ¯°$°$¾¾ ¯ €  9 $½$ ff$fn $fn $ @9$f ¯°$°$°  ¾ €  9 $½$ ff$fn $fn $ @9$f ¯°$°$– ° f% f €  9 $½$ ff$fn $fn $ @9$f ¯°$°$n– °% f €  f¾° ½ f  .

.¾ fn½  .-°¯ °¾¾n½ – ¾°¯ €¯   .

¯¯f°   .

-°¯  € fn fn½€ €  f  fn fn½€ ¾ ¾  – .

-°¯   ° ¾ fn€¯¾°¯ f° ½ f  ¾n½f     ¯f° ¾ fn½     n @½ f½¾ @¯ .

¯½ °@¯          9   9  f¾ I .

-$¯f°%fn ½% @9%% f%%  ¾€n –¾° fn½¾  @  .¯½ ¾¾ @f– %@ D9 9 n -f¯  $½$ ff$fn $f ½$ @9$.

-@¯ - .

-- @¯          9  9  .

    n @½ f½¾ @¯ .

¯½ °@¯          9   9  f¾ I .

¯½ ¾¾ @f– %@ D9 9 n -f¯  $½$ ff$fn $f ½$ @9$.-$¯f°%fn ½% @9%% f%%  ¾€n –¾° fn½¾  @  .

-@¯ - .

-- @¯          9  9   °¾nf¾  .

-$ @@%.-%°½%°  n¯   %€   ¾ ¾€°¾  ° ½ €¯ €°–  f%  f ¯½€   ¯½f  ¾½fn  .-%°½ n¯  @ ''$ ½$¯ $fn $.-$ @@%.-%°½ n¯  %€f f f °.-¾ nf°°¾n½  ¯f° ''$ ½$¯ $fn $.-$ @@%.-°¯  f °  ¾ °¾  J ¾ fn€¯ °¯ f° ½ f  n¯ ¾n½    % - nf°n€€  € ¾ J f f f °.-%°½%¾°–%°¾ n¯  D ''$ ½$¯ $fn $.- °– ¾f   ½¯  ''$½fn$ ½¯$¯ $.-$ @@%.-$ @D%.-%°½ n¯   ½¯  ''$½fn$ ½¯$¯ $.

-%. %  °f¯  – f°f¯  n% ° ½f¾¾  – ° f°€  % ° ¾n½¾ ½f°  ½¾   J nf° f¾ °°°– ¾n½½¾%.

 ¾  n€ %°f¯ f  ¾½fn %°f¯ ¾f¾€¯ f% ¯½%€ ¾   €¾°½ ¾ ° °–   n¯¯f° ¾  %#%$!9025%! .° ¾°  ¾  n @¾¾n½ f¾ °f¾fn D¾ ° $@ ¾f° f¾# ½¯#°9 ½  9f9 ½  $½fn$ ½¯$¯ $¾$ f¾%¾n½¾$ ° 9f@ D $ ½$¯ $fn $¾$ f¾%¾n½¾$ °  J °°– ° ° ½¾%n°°– ¾¾n½  % @  ¯½ f  ¾½fn ¯f°f f ¯½€ f° €¾ ° f  f  €  ¯½f  ¾½fn f f f¾f ¯½€  °#°  ¾  ¾° n n   ¯½€ ¾  ° –°– €°– n¯¯f° ¾ –°.f°  °–  n¯¯f° ¾  .  ¾n f% ¯½%€  .

47.9./.

- ½nf fn¾nf ¯f°%  %¾ ½   .9025  /-1  $  % ° ° .-¾ ½¾n½€  ff f¾  f f °–  @€°¾    @ ¾n½° –¾°f€ f°.

@ € ¾nf ° $½fn$ 9.

 $f½½$fn $f ¯°$  $¯f°€½ n°f°  ½ ½ f° ° $½$ ff$fn $fn $  $f ¯°$¯f°  n€   °°¯ °¾   9f€@ ½¯  $½fn$ ½¯$f½½$fn $f ¯°$ @@$¯f° 9f€¾n½°@ $½$ ff$fn $fn $ @@$f ¯°$¯f° 9f€D $½$ ff$fn $fn $ @D$f ¯°$¯f° n½-f¯  ¯f°% @@%¾ ½  %@  ¾ f½ f ff°fnn° f  °n  ¾½ f¾   n ¾ ¾    ¾ € ¾f°– ¾     .9€  @@%. n¯¯            O.-%°½ n¯   ¾   @@ nf @@%. f ¾ °€%f ¯°fnn°°n  .-%°½ n¯  ° .

 ¾ °¾n°  ½nf f–  ff f¾  @@ 9 $½fn$ ½¯$f½½$fn $½ n$  $ ¾$° @@ f  %%-.%.

 D9% $½fn$ ½¯$f½½$fn $f ¯°$ @@$°¾$ %f –  $½fn$ ½¯$f½½$fn $f ¯°$ @@$°¾$ % – %¾ .     9f€ fn½€ °½ ½   $½fn$ ½½¯$ ff$f ½$ @9$.  D9% $½fn$ ½¯$f½½$fn $f ¯°$ @@$°¾$ %f –  $½fn$ ½¯$f½½$fn $f ¯°$ @@$°¾$ % – %¾ .-I@ % $½fn$ ½½¯$f½½$fn $f ¯°$ @9  $½fn$ ½¯$f½½$fn $f ¯°$ @@ %  D9% $½fn$ ½¯$f½½$fn $f ¯°$ @@$°¾$ %f –  $½fn$ ½¯$f½½$fn $f ¯°$ @@$°¾$ % – %¾ .-$½  f¯½  ¾€n –¾° fn½¾  @  .  D9% $½fn$ ½¯$f½½$fn $f ¯°$ @@$°¾$ %f –  $½fn$ ½¯$f½½$fn $f ¯°$ @@$°¾$ % – %¾ .

-@¯ - .

-- @¯  .

¯n½  ff f¾ ½ °  °¾ ½nf  f .        D  D  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   nn ¾¾¯ ¾¾f– f€ °°°–¯f°¾n½€ € ¾  n° °¾€. ¯n½    n°  ff f¾ ½ ° ¾ –¾    n°–.

.&& ° € € &&          .@   .

   .

Sign up to vote on this title
UsefulNot useful