Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

SAP Database Copy in 8 Steps

Scenario
You want to copy a database ( SRC ) which resides on System-A onto another system ( System-
B ) with different database ID ( TGT ).









Prerequisites
1. Source and Target Operating Systems are same.
2. Target System have enough space for source database.
3. Source and Target Databases are same.

Assumption
You are using Oracle 8.1.7 or higher database.

Procedure
Following steps are executed to copy a database onto another machine with different database
ID.

1. Generate a script which will help you to create CONTROL FILE on target machine via
SQLPLUS.
Logon as user ora.
Call SQLPLUS and login as SYSDBA
# sqlplus /nolog

SQLPLUS> connect /as sysdba
Execute the following commands:
SQLPLUS> alter database backup controlfile to trace;

This will generate a trace file ( *.trc ) under /oracle//saptrace/usertrace .

2. Shutdown the database with SHUTDOWN IMMEDIATE

3. Copy Source Datafiles into relative file systems at Target System.

/oracle/SRC/sapdata1/* > /oracle/TGT/sapdata1/*
/oracle/SRC/sapdata2/* > /oracle/TGT/sapdata2/*
/oracle/SRC/sapdata3/* > /oracle/TGT/sapdata3/*
/oracle/SRC/sapdata4/* > /oracle/TGT/sapdata4/*
/oracle/SRC/sapdata5/* > /oracle/TGT/sapdata5/*
/oracle/SRC/sapdata6/* > /oracle/TGT/sapdata6/*

4. Edit Trace file generated in step 1 so that you can create CONTROL FILE's for Target
Database ID TGT.

Delete all commented lines ( lines starting with '#' character ).
Delete other repeated lines so that only lines between

STARTUP MOUNT.... and WE8DEC; remains.
Change all 'SRC' texts with 'TGT'. If you are using VI use the command
:%s/SRC/TGT/g
Change the CREATE CONTROLFILE... line so that it looks like
CREATE CONTROLFILE REUSE SET DATABASE "TGT" RESETLOGS ARCHIVELOG...

If you are runnig R/3 System on Windows platform, then edit the file paths if you copied
files on different disks and folders.
5. Execute the script via SQLPLUS.
SQLPLUS> @/path_to_file/control.sql

6. Open the database via
SQLPLUS> alter database open resetlogs;

7. Get a license for your R/3 System and login to client 000.

8. Run SE06 to setup CTS and configure TMS via STMS Tcode.

You might also like