Академический Документы
Профессиональный Документы
Культура Документы
34259-How-to-and-when-to-recreate-control-files
1. Pre - Requisites :
No of Drives should be same in both Source Server & Target Server. (Not Mandatory)
Drive Names should be same in both Source Server & Target Server. (Not Mandatory)
Installation of Database & SAP should be same in both Source Server & Target Server.
SAPDATA_HOME\origlogA\cntrl
SAPDATA_HOME\origlogB\cntrl
SAPDATA_HOME\sapdata1\cntrl
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
If a system copy takes place between systems with same platform (operating system and database system), then it’s called
HOMOGENEOUS SYSTEM COPY.
Note:- In our case I am going to follow backup and restore method since no downtime required, henceforth this guide is prepared
for a Homogeneous System Copy using Online/Offline Database Backup
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
cd sapbackup
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.
i. You are using an online database backup of source system to create target system.
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.
ii. 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.
iii. 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.
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.
c. Remove all lines before "STARTUP MOUNT" line. Delete all commented "#" lines. Also remove all lines after CHARACTER
SET UTF8;" line.
As follow
If you want to change datafile or redolog file destinations, first move the files on target destination at OS level, then edit
CONTROL.SQL file for new destinations.
After CONTROL.SQL script preparation, following commands must be run to create CONTROLFILE of target system:
Database will be in inconsistent status after creation of CONTROLFILE. This can be viewed by trying to open the database.
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.
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.
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.
alter database open resetlogs * ORA-01113: file 1 needs media recovery ORA-01110: data file
1: '/oracle/QSG/sapdata1/system_1/system.data1'
· Change dbs_ors_schema to SAPPSG both in CI and DI that is both in 10.99.32.45 and 10.99.32.46
· Run oradbusr.sql as per the Note 50088 - Creating OPS$ users on Windows NT/Oracle to create ops$ users
· Now change the password of SAPPSG by using brconnect so that it will get updated in SAPUSER table, enter the following
command in cmd
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.
· 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 .
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.