Re: copying DB1 (production) to DB2 (testing) Data Pump vs Import/Export
Date: Thu, 18 Sep 2008 07:24:14 -0700 (PDT)
Message-ID: <ab0f500d-69fc-4844-a664-06d760333b8e@m36g2000hse.googlegroups.com>
On 18 sep, 08:18, norbert.urzedow..._at_gmail.com wrote:
> set ORACLE_SID=DB2
> shutdown immediate;
> exit
>
> delete all files from folder oradata\DB2\
>
> set ORACLE_SID=DB1
> alter database backup controlfile to trace;
> shutdown immediate;
> exit
>
> copy all files from folder oradata\DB1 to oradata\DB2
> in oradata\DB2 directory delete all control files
> control01.ctl control02.ctl control03.ctl
>
> set ORACLE_SID=DB1
> startup
> exit
>
> in admin\DB1\udump dir look for the newest file with .trc extension
>
> remove everything before 'startup nomount'
> in this line 'CREATE CONTROLFILE REUSE DATABASE "DB1" NORESETLOGS
> NOARCHIVELOG'
> change 'REUSE' to 'SET' and 'NORESETLOGS' to 'RESETLOGS'
> in line 'ALTER DATABASE OPEN' add 'RESETLOGS'
> change 'DB1' to 'DB2'
>
> save file to .sql
>
> set ORACLE_SID=DB2
> @DB2.sql
>
> That is the way i did it for long time (might be helpful). Now i want
> something more advanced.
> How to do exactly same thing with Data Pump? Any hints? Of course path
> to tablespaces are different.
>
> ---
> Norbert Urzędowski
Why use Datapump? That will be awfully inefficient compared to your 'cloning' procedure. It will also generate lots of redo. If you want something more advanced, you can duplicate a database with RMAN. Datafiles do not need to have the same path. Database must be in archivelog though, and it can be done online. Info (you don't mention a version) in the RMAN documentation. In 10g Database Control and Grid Control can duplicate a database by hitting one button.
-- Sybrand Bakker Senior Oracle DBAReceived on Thu Sep 18 2008 - 09:24:14 CDT