Solved

oracleXE recovery

Posted on 2007-04-05
7
1,005 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
Comment Utility
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
Comment Utility
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
Comment Utility
hmmm
seems pretty complex...i will give it a shot
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
LVL 7

Expert Comment

by:gattu007
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
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.
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines

728 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now