Solved

oracleXE recovery

Posted on 2007-04-05
7
1,024 Views
Last Modified: 2013-12-18
I have an oracleXE database running on one server and would like to copy that DB to another server running oracleXE as a test environment.  I did a backup of the database on the prod server, copied the files in the flash_recovery_area on the prod server to the test server, but cannot get it to restore.  It says
RMAN-04014: startup failed: ORA-02778: Name given for the log directory is invalid

Recovery Manager complete.
====================   ERROR =============================
         Restore of the database failed.
         RMAN Error - See log for error .
         Log file is at D:\ORACLEXE\APP\ORACLE\PRODUCT\10.2.0\SERVER\DATABASE\OX
E_RESTORE.LOG.

Any help getting my prod DB copied to a test environment would be appreciated
0
Comment
Question by:jduawa
  • 5
  • 2
7 Comments
 
LVL 7

Expert Comment

by:gattu007
ID: 18859713
The best way is to use "Duplicate" option from RMAN.

1.  Backup the primary database.

2.  Determine how much disk space will be required.

3.  Ensuring you have enough space on your target server.

4.  Making the backup available for the duplicate process.

5.  Creating the init.ora & administration directories for the duplicate database.

6.  Ensuring SQL*NET connections to primary database and RMAN catalog are working.

7.  Prepare RMAN duplicate script.

8.  Execute the RMAN script. as shown in below metalink note

Subject:       Creating a Duplicate Database on a New Host.
        Doc ID:       Note:388431.1

References
Note 259694.1 - Oracle10G RMAN Database Duplication
Subject:       RMAN 'Duplicate Database' Feature in Oracle9i / Oracle 10G
        Doc ID:       Note:228257.1
0
 
LVL 7

Expert Comment

by:gattu007
ID: 18859722
1: Create an Oracle Password File for the Auxiliary Instance
-------------------------------------------------------------
For full details on how to create a password file please refer to Oracle9i Database Administrator's Guide.

  For example:  orapwd file=DUP.pwd password=manager entries=5


2: Ensure Oracle Net Connectivity to the Auxiliary Instance
------------------------------------------------------------
Modify the listener and tnsnames file to to able to connect to aux db
Test the connections using sqlplus - note that you must connect to the auxiliary instance with SYSDBA privileges, so a password file must exist.


3: Create an Initialization Parameter File for the Auxiliary Instance
----------------------------------------------------------------------
Copy the init.ora file for target database and make the necessary changes for teh duplicate database e.g Setup the required paremeters e.g DB_NAME, CONTROL_FILES and directories for bdump, udump,cdump etc...

  Parameter file 'D:\ORACLE\ORA901\DATABASE\INITV901DUP.ORA'


4: Start the Auxiliary Instance
--------------------------------
Create a new NT service for the duplicate database V901DUP using oradim.

  C:\>oradim -new -sid duplicate -intpwd sys -maxusers 5 -startmode auto -pfile  'C:\oracle\ora92\database\INITduplicate.ora'

  C:\> set ORACLE_SID=V901DUP
  C:\> sqlplus "sys/manager as sysdba"
  SQL> startup nomount


5: Mount or Open the Target Database
-------------------------------------

  C:\> set ORACLE_SID=V901
  C:\> sqlplus "/ as sysdba"
  SQL> startup


6: Make Sure You Have the Necessary Backups and Archived Redo Logs
-------------------------------------------------------------------
To list what backups you have - log into RMAN and query the RMAN catalog.

  C:\> rman catalog rman/rman@RMAN901 target sys/change_on_install@V901
  RMAN> list backup;


7: Log into RMAN Allocate Auxiliary Channels if Automatic Channels Are Not Configured
--------------------------------------------------------------------------------------
rman catalog rman/rman@RMAN901 target sys/change_on_install@V901 auxiliary sys/manager@V901DUP

The output from connecting to RMAN with a catalog, target and auxiliary instance will show some output similar to:-
 
  Recovery Manager: Release 9.0.1.1.1 - Production

  (c) Copyright 2001 Oracle Corporation.  All rights reserved.

  connected to target database: V901 (DBID=1452169997)
  connected to recovery catalog database
  connected to auxiliary database: V901DUP (not mounted)


Task 8: Run the RMAN duplicate command
---------------------------------------
The following run command renames the datafiles to a new location and create three redo log files for the duplicate database.  Note
the example shown below is a full duplicate of the target database.  If you want to create a duplicate database a week prior to current time you can use the SET UNTIL TIME 'SYSDATE-7' syntax.

  run {
       #Allocate the channel for the duplicate work
       Allocate auxiliary channel ch1 type disk;
       #set the new file names and locations for all datafiles
       SET NEWNAME FOR DATAFILE 1 TO 'D:\ORACLE\ORADATA\V901DUP\SYSTEM01.DBF';
       SET NEWNAME FOR DATAFILE 2 TO 'D:\ORACLE\ORADATA\V901DUP\UNDOTBS01.DBF';
       SET NEWNAME FOR DATAFILE 3 TO 'D:\ORACLE\ORADATA\V901DUP\CWMLITE01.DBF';
       SET NEWNAME FOR DATAFILE 4 TO 'D:\ORACLE\ORADATA\V901DUP\DRSYS01.DBF';
       SET NEWNAME FOR DATAFILE 5 TO 'D:\ORACLE\ORADATA\V901DUP\EXAMPLE01.DBF';
       SET NEWNAME FOR DATAFILE 6 TO 'D:\ORACLE\ORADATA\V901DUP\INDX01.DBF';
       SET NEWNAME FOR DATAFILE 7 TO 'D:\ORACLE\ORADATA\V901DUP\TOOLS01.DBF';
       SET NEWNAME FOR DATAFILE 8 TO 'D:\ORACLE\ORADATA\V901DUP\USERS01.DBF';
       SET NEWNAME FOR DATAFILE 9 TO 'D:\ORACLE\ORADATA\V901DUP\OEM_REPOSITORY.DBF';
       #Duplicate the database to V901DUP
       DUPLICATE TARGET DATABASE TO V901DUP
       #Create three redo logs for the duplicated database
       LOGFILE
         GROUP 1 ('D:\ORACLE\ORADATA\V901DUP\REDO01.LOG',
                  'D:\ORACLE\ORADATA\V901DUP\REDO01-2.LOG') SIZE 200K,
         GROUP 2 ('D:\ORACLE\ORADATA\V901DUP\REDO02.LOG',
                  'D:\ORACLE\ORADATA\V901DUP\REDO02-2.LOG') SIZE 200K,
         GROUP 3 ('D:\ORACLE\ORADATA\V901DUP\REDO03.LOG',
                  'D:\ORACLE\ORADATA\V901DUP\REDO03-2.LOG') SIZE 200K;
      }
     
0
 
LVL 1

Author Comment

by:jduawa
ID: 18859814
hmmm
seems pretty complex...i will give it a shot
0
Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

 
LVL 7

Expert Comment

by:gattu007
ID: 18860526
actually it is not complex... if you do it once you will know how easy it is with RMAN
0
 
LVL 1

Author Comment

by:jduawa
ID: 18860549
can i not just copy the files from a hot backup to the other server and apply redo logs?
0
 
LVL 7

Accepted Solution

by:
gattu007 earned 500 total points
ID: 18860591
yes you can do that

if it is windows follow metalink notes

Subject:       How to make a copy of a database on the same Windows NT machine
        Doc ID:       Note:73301.1

unix

Note 18070.1:  HOW TO MAKE A COPY OF A DATABASE ON THE SAME UNIX MACHINE
0
 
LVL 7

Expert Comment

by:gattu007
ID: 18860618
0

Featured Post

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Oracle function to insert records? 15 66
Fill Null values 5 37
NTP time source for DC 3 54
Moving a windows 7 install to new hardware 9 114
This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question