Database Refresh/rebuild from hot backup

Verify/calculate need for disk space and available disk space

  1. Stop the Destination database
  2. Clean up all destination database datafiles
  3. Ex: for i in 2 3 4 5 6 7 8

    >do

    >rm $/vol$i/oradata/DEST_SID/*

    >done

  4. Move the hot backup source database files to destination locations

Ex: From source machine, go to the hot backup files area.

$for iii in 2 3 4 5 6 7 8

  1. Control file creation
  2. Login to source database and issue the command

    Svrmgrl> alter database backup controlfile to trace;

    Copy the trace file of control file creation to destination database

  3. Modify the controlfile
  4. Change the oracle SID to DEST_SID from SRC_SID

    Modify all datafile locations

    CREATE controlfile SET database "DEST_DB" resetlogs NoArchivelogmode;

  5. If more archive log files are to be applied, then change log_archive_dest value to point to all old archive log locations.
  6. Set and verify ORACLE_HOME, ORACLE_SID or run "oraenv" script to set new DEST_SID database environments
  7. Run modified controlfile

Svrmgrl> connect internal

Svrmgrl> startup nomount;

Svrmgrl>@modified_control_file.sql

9) svrmgrl>RECOVER DATABASE USING BACKUP until cancel;

apply logs e until the time you want to refresh

CANCEL

  1. Svrmgrl> ALTER DATABASE OPEN RESETLOGS;
  2. svrmgrl> Alter database rename global_name to DEST_SID;
  3. shutdown and start database;
  4. change sys, system password.
  5. If the database is apps, then change profile options by login as APPS.

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

Example PROCEDURE

98) oracle@orion% ls

dbmod_devafus.sql

(99) oracle@orion% svrmgrl

Oracle Server Manager Release 2.3.4.0.0 - Production

Copyright (c) Oracle Corporation 1994, 1995. All rights reserved.

Oracle7 Server Release 7.3.4.5.0 - Production

With the distributed, replication and parallel query options

PL/SQL Release 2.3.4.5.0 - Production

SVRMGR> connect internal

Connected to an idle instance.

SVRMGR> startup nomount

ORACLE instance started.

Total System Global Area 37596460 bytes

Fixed Size 39816 bytes

Variable Size 21008804 bytes

Database Buffers 16384000 bytes

Redo Buffers 163840 bytes

SVRMGR> @dbmod_devafus.sql

Statement processed.

SVRMGR> recover database using backup controlfile until cancel;

ORA-00279: Change 640511289 generated at 05/06/00 01:00:15 needed for thread 1

ORA-00289: Suggestion : /export/home/oracle/admin/DMET/arch/DMET/0000001017_0001.ARC

ORA-00280: Change 640511289 for thread 1 is in sequence #1017

Specify log: {<RET>=suggested | filename | AUTO | CANCEL}

Log applied.

ORA-00279: Change 640512272 generated at 05/06/00 01:59:32 needed for thread 1

ORA-00289: Suggestion : /export/home/oracle/admin/DMET/arch/DMET/0000001018_0001.ARC

ORA-00280: Change 640512272 for thread 1 is in sequence #1018

ORA-00278: Logfile '/export/home/oracle/admin/DMET/arch/DMET/0000001017_0001.ARC' no longer needed for this recovery

Specify log: {<RET>=suggested | filename | AUTO | CANCEL}

CANCEL

Media recovery cancelled.

SVRMGR> alter database open resetlogs;

alter database open resetlogs

*

ORA-00344: unable to recreate online log '/vol02/vol1/oradata/DMET/redo03_m.log'

ORA-07352: sfccf: create error, unable to create file.

SVR4 Error: 2: No such file or directory

SVRMGR> shutdown abort;

ORACLE instance shut down.

SVRMGR> host

[ Removed created redo log files and control files ]

(51) oracle@orion% svrmgrl

Oracle Server Manager Release 2.3.4.0.0 - Production

Copyright (c) Oracle Corporation 1994, 1995. All rights reserved.

Oracle7 Server Release 7.3.4.5.0 - Production

With the distributed, replication and parallel query options

PL/SQL Release 2.3.4.5.0 - Production

SVRMGR> connect internal

Connected to an idle instance.

SVRMGR> startup nomount

ORACLE instance started.

Total System Global Area 37596460 bytes

Fixed Size 39816 bytes

Variable Size 21008804 bytes

Database Buffers 16384000 bytes

Redo Buffers 163840 bytes

SVRMGR> @dbmod_devafus.sql

Statement processed.

SVRMGR> alter database open resetlogs;

Statement processed.

SVRMGR> select * from global_name;

GLOBAL_NAME

--------------------------------------------------------------------------------

PAFZ.DNT.QUESTAM.COM

1 row selected.

SVRMGR> alter database rename global_name to DMET.DNT.QUESTAM.COM;

Statement processed.

SVRMGR> select * from global_name;

GLOBAL_NAME

--------------------------------------------------------------------------------

DMET.DNT.QUESTAM.COM

1 row selected.

SVRMGR>