• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 418
  • Last Modified:

Oracle restore

I am backuping up oracle database to server A.  I need to test  restore the database to PC B on regular basis.  Just installed developer suite  Oracle 10G on my PC B.  Can someone tell me step by step how to do this...I am new to Oracle.  Do I have to copy all the backup files to PC and issue the restore command?
0
Nana Hemaa
Asked:
Nana Hemaa
  • 6
  • 3
  • 3
  • +1
2 Solutions
 
slightwv (䄆 Netminder) Commented:
Are you backing up the developer suite or a database?

For backup/restore of a database I sugest RMAN.  The online docs have all the information.
0
 
sventhanCommented:
Are you doing this on Windows? What kind of server is this? Can you give more details about Servers?
0
 
sventhanCommented:
Here is the steps for Linux/Unix

http://www.dba-oracle.com/oracle_tips_db_copy.htm
0
Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

 
sventhanCommented:
if you using RMAN to duplicate the DB here is the link

http://download.oracle.com/docs/cd/B19306_01/backup.102/b14191/rcmdupdb.htm
0
 
Nana HemaaAuthor Commented:
It is windows server 2003 .  The backups now reside in flash recovery area on server A where the database also reside. I need to test restore to a different windows server  B so as not to override the current production database
0
 
Nana HemaaAuthor Commented:
Are you backing up the developer suite or a database?--I am backing up a database

0
 
Praveen Kumar ChandrashekatrDatabase Analysist Senior Commented:
yes you need to copy all the backup files to the Server B then use restore.

if it is RMAN backup

1) copy all rman backup files from server A  to server B are in the same location(s) in the server B as in the server A(same path names)
2) Copy the initSID.ora file to the new ${Oracle Home}/dbs location and:
a) change the name to init<SID>.ora
b) Add the db_file_name_convert and log_file_name_convert to translate the file locations to new locations.
c) DO NOT yet change the db_name
3) Set ORACLE_SID to <New_SID>
4) Statup RMAN and execute these commands

CONNECT TARGET /
STARTUP NOMOUNT
### This is the prod db-id:
SET DBID=123456789;
RESTORE CONTROLFILE FROM '/backup/c-nnnnn-mmmm-00';
ALTER DATABASE MOUNT;
RUN {
        ALLOCATE CHANNEL C1 DEVICE TYPE DISK;
        ALLOCATE CHANNEL C2 DEVICE TYPE DISK;
        ALLOCATE CHANNEL C3 DEVICE TYPE DISK;
        ALLOCATE CHANNEL C4 DEVICE TYPE DISK;
        ### You need to set the point in time recovery:
        SET UNTIL SEQUENCE 6215 THREAD 1;
        ###
        RESTORE DATABASE;
        RECOVER DATABASE;
}
ALTER DATABASE OPEN RESETLOGS;
0
 
Praveen Kumar ChandrashekatrDatabase Analysist Senior Commented:
0
 
sventhanCommented:
if its not RMAN you should try these steps

I assume you have oracle installed on your new location and your source is not in archive log mode.

You new DB name : NEWDB.
1) ALTER DATABASE BACKUP CONTROLFILE TO TRACE as '/backup_loc/create_DB_NEWDB.sql';
2) create pfile from spfile;
3) Copy the initSID.ora file to '/backup_loc';
4) Copy the backuped files, init.ora files, the control file trace (created above) to your pc
   Move the file to the proper location at the destination
   copy $ORACLE_HOME/dbs/init.ora to $ORACLE_HOME/dbs/initNEWDB.ora
5) Edit the Control File made earlier and clear out the junk at the top, so that the first line reads STARTUP NOMOUNT.
6) Edit this statement to read:
   CREATE CONTROLFILE SET DATABASE NEWDB RESETLOGS 
7) Also edit all the file locations mentioned in the trace file so that they point to appropriate clone locations
   Also remove the lines for "RECOVER ..." and "ALTER DATABASE OPEN ..."
8) Define the new $ORACLE_SID variable
   export ORACLE_SID=NEWDB
9) Edit the initNEWDB.ora file. Make sure you edit:
   CONTROL_FILES= (point to where you want the clone's Control Files created) 
   LOG_ARCHIVE_DEST_1= (and variants) (the source archives must not be overwritten by the clone's) 
   USER_DUMP_DEST & BACKGROUND_DUMP_DEST (source trace files must not be overwritten by the clone)
   INSTANCE_NAME
   Start sqlplus, connect SYS AS SYSDBA (internal) and run the create controlfile script.
10) create spfile from pfile;
    startup nomount;
    @Create_DB_NEWDB.sql

11)  RECOVER DATABASE USING BACKUP CONTROLFILE UNTIL CANCEL;
12)  ALTER DATABASE OPEN RESETLOGS;
13)  Add TEMP Tablespace 
14)  ALTER TABLESPACE TEMP ADD TEMPFILE '/yournewloc/NEWDB/TEMP.dbf'
     SIZE 600M REUSE AUTOEXTEND ON NEXT 100M  MAXSIZE 13767M;

Open in new window

0
 
sventhanCommented:
0
 
Nana HemaaAuthor Commented:
praveencpk:
----where do I copy this from pls.

2) Copy the initSID.ora file to the new ${Oracle Home}/dbs location anda) change the name to init<SID>.ora

--where are these files at..
b) Add the db_file_name_convert and log_file_name_convert to translate the file locations to new locations.

c) DO NOT yet change the db_name
3) Set ORACLE_SID to <New_SID>




I think the source is archive log mode
0
 
sventhanCommented:
run this in source;

select log_mode from v$database;

and paste the results here...
0
 
Praveen Kumar ChandrashekatrDatabase Analysist Senior Commented:
first let us know what type of backup are you using?

>>where do I copy this from pls.
copy the backup from server A to server B in the same location i.e if yor backup was in /U01/oradata/FRA/backup/ then create the same file structure in server B.

>>where are these files at..
the initSID.ora file will be in $ORACLE_HOME/dbs/ or login to database with sys user and query for path i.e
sql>show parameter pfile

then edit the pfile by adding the db_file_name_convert and log_file_name_convert parameter in your init file in server B.


0

Featured Post

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

  • 6
  • 3
  • 3
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now