cancel
Showing results for 
Search instead for 
Did you mean: 

Copy of DB

Former Member
0 Kudos

Experts,

I need help desperately. I want to copy the PRD to quality server on a different box.OS and DB are same.But I dont want to do any tape back up and restore. Please give me any suggestions.I have only one day for this activity.I am going through the following approach. Please let me know if I am wrong

copy the /oracle folder from PRD to QAS.then create the new control file and change the SID and put the system up. Is this possible.. If so should I copy /oracle folder or all the folders..please let me know the detailed steps. I will reward points..

Edited by: Rohit Chandra on Nov 24, 2008 6:26 PM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

As told by experts above.....manual copying of data files depends upon your network speed..

And please note that there is no need to copy all those /oracle contents....

1) take a copy of control file of source system

2) shutdown the source and target system database

3) copy all datafiles of source system to target system

4) edit and run the controlfile in target system which you have already copied from source

5) Process the post installation including creating of OPS users etc

6) sratrtup the database and SAP

7) Post installation steps at SAPGUI

warm regards

Harish K Reddy

Former Member
0 Kudos

Thanks Hareesh for your simple answer. I have given points for that. Could you please ellaborate more.I have never worked on DB side.But this time I have to work from DB side without the help of DBA guy.So please ellaboarate the process.Can I just do the ftp for control file and ONLY DATFILES..sapdata1sapdata2 etc.from source system to target system...no need to copy other folders like mirrlog,origlog etc..Please give me some detailed step so that I can do on my own..I have to complete everything in one day..

Cheers.

Edited by: Rohit Chandra on Nov 25, 2008 8:56 AM

Answers (3)

Answers (3)

Former Member
0 Kudos

System Copy using Online/Offline Database Backup.

DS1 u2013 Source System

Q01 u2013 Target System

Steps for a Homogeneous(OS and DB same) system copy are briefly as below:

u2022 Preparations on Target System.

u2022 Restore Online/Offline Backup of Source System onto Target System.

u2022 Create CONTROLFILE creation script on Source System.

u2022 Modification of CONTROLFILE script and creation of CONTROLFILEs of Target System.

u2022 Recovery of Oracle Database on Target System.

u2022 Completion of System Copy

Prerequisites :

Both Source and Target Systems must have Same Operating System and Database System. Also Patch levels must be same.

You have sufficient free space for sapdata directories on target system.

For Windows systems, you have to create all drives where datafiles resides on source system.

Use most current database backup in order to shorten database creation time.

Procedure :

Source System : DS1

Target System : Q01

Step -1. Stop SAP and Oracle on target system (Q01) and related services. Delete Data and Log directories on target system (Q01) must be cleaned before restoring source database.

Directories to delete :

cd \oracle\Q01

sapdata\*

origlog

mirrlog

sapreorg\*

saparch\*

saptrace\usertrace\*

saptrace\background\*

sapbackup\*

sapcheck\*

Step - 2. Creation of CONTROLFILE script in source system for target system.

(In DS1 u2013 Source system)

Sqlplus> / as sysdba

Sqlplus> alter database backup controlfile to trace;

Sqlplus> exit

Renamed this trace file under directory u2018\oracle\DS1\saptace\usertraceu2019

with control.sql

Deleted all lines before "STARTUP NOMOUNT" line.

Deleted all commented "#" lines and all lines after CHARACTER SET WE8DEC;

line.

Changed all Source SID's(DS1) to Target SID(Q01) to reflect the correct datafile path.

Change the line

CREATE CONTROLFILE REUSE DATABASE u201CDS1u201Du2019 NORESETLOGS ARCHIVELOG;

With

CREATE CONTROLFILE REUSE SET DATABASE u201CQ01u201D RESETLOGS ARCHIVELOG;

Step - 3. Creation of CONTROLFILE of target system:

Copy control.sql file from DS1 to Q01 in D:\

sqlplus> / as sysdba

sqlplus> @D:\control.sql

The control file will be created in Q01 in all the three destinations

Step - 4. Starting the database.

sqlplus> alter database open resetlogs;

sqlplus> recover database using backup controlfile; (Not required for Offline Backup Restore)

sqlplus> shutdown immediate;

sqlplus> startup;

Start the LISTENER process.

Step - 5. Database changes for new SID.

Set dbs_ora_schema to SAPD01 in the environment variable for Q01adm

In the Windows Registry set u2018HKEY_CURRENT_USER -> ENVIRONMENT TO SAPD01 (This might have been done)

Execute the script u2018oradbusr.sqlu2019 which will be in \usr\sap\Q01\SYS\EXE\RUN directory. This will create OS owner in SAPUSER table. Check by executing :

SQL> select owner from dba_tables where table_name = 'SAPUSER';

D:\>sqlplus /nolog @oradbusr.sql SAPD01 NT Domain_name Q01

(SAPD01 u2013 Source, Q01 u2013 Target)

sqlplus /nolog @oradbusr.sql SAPSP1 NT BSG-TG ST1 (For Thresher)

-> (These steps may not be required)

Execute the script u2018sapdba_role.sqlu2019 which will be in \usr\sap\Q01\SYS\EXE\RUN directory after changing word SAPR3 with SAPQ01

D:\>sqlplus /nolog @sapdba_role.sql Q01 NT (D01 instead of Q01 u2013 To be confirmed)

-> ( If the SAPUSER has no entry just insert the entry with u201Cinsertu201D command below )

-


Sqlplus > DROP TABLE "OPS$DOMAIN OR HOST_NAME\DS1ADM ".SAPUSER;

Sqlplus> CREATE TABLE " OPS$DOMAIN OR HOST_NAME\Q01ADM ".SAPUSER

(USERID VARCHAR2(256), PASSWD VARCHAR2(256));

Sqlplus> insert into "OPS$DOMAIN OR HOST_NAME\Q01ADM".SAPUSER VALUES ('SAPD01-CRYPT','V01/0014ZctvSB67Wv3+vJLLnC8=');

(u2018V01/0014ZctvSB67Wv3+vJLLnC8=' is the password of SAPD01 in DS1 system u2013 Source System ( Can be found out by executing query in source system as below ) )

SQL> select * from "OPS$DOMAIN OR HOST_NAME\DS1ADM".SAPUSER;

-


Step - 6. As your Hardware Key is not changed, you don't have to get additional License Key from SAPNET. You can use previous systems (on target system, if SID is not changed) License in new system created on target system. (Old Q01 can be used or can get from SAPNET. Note the details from SAPNET and use as per the asked below.)

( Screen shot of QS1 refresh from P01 for SAP License install)

C:\Documents and Settings\qs1adm>saplicense -install

Specify your SAP System ID:

SAP SYSTEM ID = QS1

Specify your unique System idenfification:

If you have no systemnumber specified just press enter.

SYSTEM-NR = 000000000310321413

Specify your hardware key:

HARDWARE KEY = J1346029863

Specify your installation number:

INSTALLATION NO = 0020154987

Specify your expiration date:

EXPIRATION_DATE [YYYYMMDD] = 99991231

Specify your license key:

LICENSE_KEY 1...5....0....5....0...4

LICENSE_KEY = SF2HT8VZHO9T8OBHZP3ATYRY

saplicense: License successfully installed

Step - 7. Start the SAP. (Can be started before License application)

Step - 8. Logon to the SAP R/3 System with 000 client with SAP* and goto TCODE SE06. Select "Database Copy or Migration" and execute "Post Installation Processing".

Select Yes at every stage and proceed further .

Change all of the Source System Objects to Target System Objects as asked.

-> If we get database dumps, check the database by accessing few tables from SQLPLUS. There may be database corruption due to improper copy. Restart the copy again and repeat the steps.

Step - 9.

Configuring STMS in QAS System

Now login to QAS system client 000 as user with administrative privilege

1. Run transaction STMS

2. On open screen , system will ask you to save the config, do not save, select icon other system ->DOMAIN_DEV

3. Now save the config.

(Step 4 and 5 may not be required)

4. Login to DEV in client 000 and run STMS and select MENU->SYSTEM_>QAS, and From top icon select ACCEPT.

5. QAS will be made active system and added to domain DOMAIN_DEV

6. Login to QAS in client 000 and run STMS and click on u2018Transport Routeu2019 and

then click on u2018Adjust configuration with controlleru2019

OR

Delete old TMS configuration and make new configuration for TMS via STMS TCODE.

The old transports will be as it is as they existed before refresh.

Step u2013 10 Create RFC/TCP-IP connection as existing earlier.

Step u2013 11. Schedule DB13. Remove source systemu2019s BG jobs and create new as per the requirement. (Create Z_TSPORT_WORKLIST_QS1_TO_P01+Q01 in QS1 system for moving transport requests into P01)

Step u2013 12 RZ10 -> utilities -> import profiles -> of active servers.

Step u2013 13 Remove authorizations and add as per requirement or existed earlier.

Step u2013 14 Create/change logical system using sale/scc4 tcode

Step u2013 15 WE20 and WE21 (For BW system).

Lalit Kumar

Former Member
0 Kudos

Thanks Lalit for your answer. I have rewarded for your effort. my question is I am not going to use tape backup. My requirement is to do DB copy from server to server instead of backup.as restoring will take much time. I have to complete everything in 1 day. I am not a DBA guy.So I am asking if I can do the FTP from ONLY ORACLE directories in UNIX box from PRD to QA after renaming/deleting ORACLE directories in QA .will that work instead of restore.or I have to copy all the folders including /usr/sap etc. Later I can go ahaed with other activity that you mentioned..Thanks again

Former Member
0 Kudos

I have to do the activity on UNIX box not on Windows box...so one question.if I am going to do the copy of folders, do I need to put the command like alterdatabase backup...and how do I restore the same in target system

former_member204746
Active Contributor
0 Kudos

option 1.are both machines connected through a fast network?

If so, you can shutdown DB on source system and copy DB files over the network to your new machine

option2. if both machine are conencted to a SAN and your DB is on this SAN, you can shutdown DB and move the DISKS to the new server. Ask your SAN or OS admin about this.

Former Member
0 Kudos

Hi,

Please refer the Homogenous System Copy guide also look at the ORACLE SPECIFIC/ BACKUP/RESTORE Procedure. Copy the only datafiles from your source system to target system (to do this please refer the generated control file of source system & copy the files to respective directories).

After performing this do the post system copy actions as mentioned in the System Copy guide.

Thanks,

Shambo

Former Member
0 Kudos

You could use the Homogeneous system copy Oracle specific strategy from the System copy Guide, you just need to copy the files at the time the procedure required and that should not take much time. The longer time you will require is the time that DB files takes to be copied. Besides DB files copy, you will need like one and a half hour and everything will be ready to go. I have done this with 200 Gb database and it did not took more than 4 hours.