Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

oracleXE recovery

Posted on 2007-04-05
7
Medium Priority
?
1,037 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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 2000 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

Featured Post

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

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

Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and theā€¦
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.
Suggested Courses

610 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