System Copy - Backup/restore Method: Harsha B S Harsha B S's Blog
System Copy - Backup/restore Method: Harsha B S Harsha B S's Blog
Log On
Hi, Guest
Join Us
Products
About SCN
Downloads
Industries
Partnership
Developer Center
Activity
Lines of Business
University Alliances
Innovation
Browse
Communications
Actions
Tweet
Like
Previous
Next
Prerequisites
Following conditions must be provided to copy a system:
1. Both Source and Target Systems must have Same Operating System and Database System. Also Patch levels must be same.
2. You have sufficient free space for sapdata directories on target system.
3. For Windows systems, you have to create all drives where datafiles resides on source system.
4. Use most current database backup in order to shorten database creation time.
Procedure
Data and Log directories on target system must be cleaned before restoring source database. Here below are the commands to
clean directories. Before this, you have to stop all SAP and Oracle processes in service.msc.
1. You have to resize the following file systems before restore process. Take into account sizes of source system.
2. /oracle//sapdata1 /oracle//sapdata2 /oracle//sapdata3 /oracle//sapdata4 /oracle//sapdata5 /oracle//sapdata6
/oracle//saparch
After cleaning necessary file systems/directories, you have to restore most current database backup to target system. For this,
find the detail backup log (e.g. bdkxxsrh.anf) for that backup on source system. You can determine this from back.log summary
backup log file or using DB12. Copy this detailed backup log file into /oracle//sapbackup directory on target system. Use
BRRESTORE command below to restore the source database on target system
Use the following command to begin restore:
cd sapbackup
brrestore -m full -b (det_log_file= for example bdkxxsrh.anf)
At the first step of restore, system will recognize that the Oracle SID is different on target machine (where the restore
command executed) and in backup. Also, Oracle_Home parameters in backup and in current system will be different and
recognized by brrestore. But the restore command will restore the datafiles to match current systems file system.
All the datafiles and online redolog files (only for Offline DB Backup) must be successfully restored.
At this step, there are 3 probabilities that must be taken into account for the following steps.
You are using an online database backup of source system to create target system.
http://scn.sap.com/people/harsha.bs/blog/2013/04/16/system-copy--backuprestore-method
1/3
10/20/2014
You have to find and put all archive files created during online backup into target systems archive directory to be able to
recover database. You can also apply all the archives created from the online backup start time to latest available.
You are using an offline database backup of source system which is running in ARCHIVELOG mode to create target system.
You may find the archive files created after offline backup on source system to make database current on target system via
applying during recovery.
You are using an offline database backup of source system which is running in NOARCHIVELOG mode to create target system.
You don't have any archive files created on source system so you don't need anything.
After restoring datafiles and redolog files, a script must be prepared on source system to create CONTROLFILE of target
system.
Use SQLPLUS to create a script to create controlfile using current CONTROLFILE content. Login to source system as
QSGadm user and execute the following SQLPLUS commands. To be able to execute following commands, database must
be at least in MOUNT mode.
SQL>alter database backup controlfile to trace;
As a result of this command, a trace file (e.g. qsg_ora_6944) will be created under /oracle//saptace/usertrace directory.
You have to edit this file to be able to use for CONTROLFILE creation on target system.
a.
b.
c.
Remove all lines before "STARTUP MOUNT" line. Delete all commented "#" lines. Also remove all lines after
CHARACTER SET UTF8;" line.
d.
alter database open * ORA-01589: must use RESETLOGS or NORESETLOGS option for database
open
At this step, a recovery must be made in order to be able to use the database.
If your source system is running in NOARCHIVELOG mode, then you have to use the following command to recover database.
SQL> recover database using backup controlfile until cancel;
If you restored an online backup on target system and put all the archive files created since online backup start time, use the
following commands.
SQL> recover database using backup controlfile;
After execution of this command, Oracle will ask for archive files to be consistent. As archive files contains only database changes
commands, you will use source system archive file on new systems database recovery. Copy all archive files created since online
backup on source system to archive directory of target system. Archive file names are different from asked during recovery session.
You can change archive file names for target system manually.
But recovery session must be started with the following command and cancelled again to be able to
start database.
Otherwise following error will arise during database opening.
SQL> alter database open resetlogs;
alter database open resetlogs * ORA-01113: file 1 needs media recovery ORA-01110: data file 1:
'/oracle/QSG/sapdata1/system_1/system.data1'
To open database, use the following command:
SQL> alter database open resetlogs;
After opening database, LISTENER process must be started.
Before opening SAP perform the following activities:
Change dbs_ors_schema to SAPPSG both in CI and DI that is both in 10.99.32.45 and 10.99.32.46
Check the users and lock status by entering following command
Make sure all the users are in open state.
Run oradbusr.sql as per the Note 50088 - Creating OPS$ users on Windows NT/Oracle to create ops$ users
SQL>@F:\oradbusr.sql SAPTSID NT DOMAIN SID
If you still find any errors refer NOTE 400241 (https://websmp230.sapag.de/sap%28bD1lbiZjPTAwMQ==%29/bc/bsp/spn/sapnotes/index2.htm?numm=400241)
Now change the password of SAPPSG by using brconnect so that it will get updated in SAPUSER table, enter the following
command in cmd
brconnect -u system/basis$1234 -f chpass -o SAPPSG -p basis$1234
Note: - If you use below command in SQL for changing password the result will not be updated in the SAPUSER table, but if
you change thru brconnect an encrypted password will be created, so please always use brconnect to change the password.
http://scn.sap.com/people/harsha.bs/blog/2013/04/16/system-copy--backuprestore-method
2/3
10/20/2014
So now when you parse the below commands and expect the same output, also check r3trans d in command prompt and ensure
return code is 0000
SQL>conn /@SID
SQL>connected .
Now start the SAP services
Logon to the SAP R/3 System and go to TCODE SE06. Select "Database Copy or Migration" and execute "Post
Installation Processing".
Change all of the Source System Objects to Target System Objects as asked.
Delete old TMS configuration and make new configuration for TMS via STMS TCODE.
Now Login to 000 client with SAP*, 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.
14493 Views
Tags: system_refresh
My Rating:
(14 ratings)
Share
Tweet
Like
2 Comments
Deeraj Shetty Mar 25, 2014 11:16 AM
Excellent Blog!!!
Like (1)
Site Index
Privacy
Contact Us
Terms of Use
Copyright
http://scn.sap.com/people/harsha.bs/blog/2013/04/16/system-copy--backuprestore-method
Follow SCN
3/3