Skip navigation


Unable to Import Profiles into Multiple Clients on the same system

If you are unable to import a profiles(SAP_ALL) transport into multiple clients on the same system (Say you wanted to import the user master into multiple clients on an ECC system) and it gives you the “Release of export and import systems have to be identical’ error. (as shown below) in STMS when you try to import into a second client

 

rel_252579

You need to manually force the transport into the system using the TP command.  Do the following:

1. Remote into an application server for the appropriate system
2. Launch a command prompt.  Navigate to the D:\usr\sap\trans\bin directory
cd D:\usr\sap\trans\bin
3. Now run the following command (replacing the SID. Transport ID and client number as appropriate)
D:\usr\sap\SID\SYS\exe\uc\NTAMD64\tp.exe import TRANSPORTID SID client###U128 pf=D:\usr\sap\trans\bin\TP_DOMAIN_SID.PFL

It will take a few minutes to complete the import.
You know it is imported when the command window goes away.  Now you can run SCC7 to complete the post-processing as normal.  Repeat on other clients as necessary

Source:https://blogs.sap.com/2013/07/26/unable-to-import-user-master-into-multiple-clients-on-the-same-system/

https://sapbasissolutions.wordpress.com/2014/05/03/how-to-import-sap-transport-request-at-os-level-manually/

Ø   How to import a transport manually with TP program?

Ø   How to import a transport without using STMS in SAP?

Ø   How to import a transport at Os level  in SAP ?

Ø   How to insert a request into the import queue of an SAP R/3 system manually?

Ø  When performing a request import manually, what will happen if client is not mentioned?

Ø  Can we manually import all the requests that are present in the import queue of an SAP system? If so, how ?

Ø  What is the parameter file name which was similar to TP_.PFL file which was used in older SAP versions?

Ø  What will happen in the background if a transport request  is added to the import queue of an SAP system ?

Ø  What will happen if the client in which you want to import does not exist in the target system?

———————————————————————————————–

Sometimes, there will be situations like you have to process transport imports manually. This can be done by TP program from the operating system level.

Transport control program TP is controlled by a parameter file TP_.PFL which is present under bin subdirectory of the transport directory.

Please note in older releases of SAP R/3, the file is termed as TPPARAM.

Before using TP for the first time, it is suggested to test the connection to the desired target system.

To perform this test, following command can be used.

tp  connect   <target system>  pf=<complete path of the parameter file>

If this test results are fine you can proceed further otherwise you need to troubleshoot the same and identify the reason for the same.

In order to insert a request into the import queue of an SAP R/3 system, use the following command:

tp  addtobuffer   <request>   <target system>  pf=<complete path of the parameter file>

If the above command is successful then, data file and cofile of the request will get copied under respective  data subdirectory and cofiles subdirectory of the transport directory.

As the request is inserted to the import queue, it can now be imported using the following command.

tp  import  <request>   <target system>  pf=<complete path of the parameter file>

In case you would like to import all the requests that are present in the import queue of an SAP system in the current sequence then provide the following command at oslevel.

tp  import all  <target system>  pf=<complete path of the parameter file>

You can add the following to specify a specific client for import:

client = <number of the client>

If the client is not mentioned, the data is copied to the client with the same number as the client from which the data was exported.

If the client into which you would like to import a request does not exist in the target system, the import terminates with an error message.

  1. Make sure the transport request is released from the source system. Log onto the target systemas adm.
  2. To add the transport request to the buffer(Single command line).
tp addtobuffer Client=
pf=/usr/sap/trans/bin/TP_DOMAIN_.PFL

Example:

tp addtobuffer DEV12345 QAS Client=000
pf=/usr/sap/trans/bin/TP_DOMAIN_DEV.PFL
  1. To import the transport request(Single command line).
tp pf=/usr/sap/trans/bin/TP_DOMAIN_.PFL
import U128 client=

Example:

tp pf=/usr/sap/trans/bin/TP_DOMAIN_DEV.PFL
import DEV12345 QAS U128 client=000

Related

Script for shutting down and starting all services of in ABAP environment

shutting down;

# Script for shutting down all services of <sid>
# In case of abnormal shutdown, delete .sapstream*,.sapstartsrv* .oracle aaa* etc from /tmp before starting again
su – <sid>adm -c stopsap -t r3
su – <sid>adm -c stopsap -t db
su – <sid>adm -c /usr/sap/<SID>/DVEBMGS<INR>/exe/sapcontrol -prot NI_HTTP -nr <INR> -function Stop
/usr/sap/hostctrl/exe/saphostexec -stop pf=/usr/sap/hostctrl/exe/host_profile
su – daaadm -c stopsap all
su – daaadm -c sapcontrol -nr <INR> -prot NI_HTTP -function StopService
/usr/sap/hostctrl/exe/saposcol -k
su – ora<sid> -c lsnrctl stop LISTENER_<SID>
# Use kill -2 to remove sapcontrol pid

STARTING;

# Script for starting all services of eccdb server
# Start oracle using ora<sid> user
# In case of abnormal shutdown, delete .sapstream*,.sapstartsrv* .oracle aaa* etc from /tmp before starting again
su – ora<sid> -c lsnrctl start LISTENER_<SID>
su – <sid>adm -c /usr/sap/<SID>/DVEBMGS<INR>/exe/sapcontrol -prot NI_HTTP -nr <INR> -function Start
su – <sid>adm -c startsap -t db
su – <sid>adm -c startsap -t r3
/usr/sap/hostctrl/exe/saphostexec -start pf=/usr/sap/hostctrl/exe/host_profile
/usr/sap/hostctrl/exe/saposcol -l
su – daaadm -c sapcontrol -nr 98 -function Start
su – daaadm -c startsap all
# If the instance doesn’t start the first time, run the ./<sid>stop.sh script again, remove the sapstartsrv sessions using kill
-2 option

App servers;

start:
# Script for starting all services of <SID> App servers
su – <sid>adm -c /usr/sap/<SID>/D11/exe/sapcontrol -prot NI_HTTP -nr <INR> -function Start
su – <sid>adm -c startsap -t r3
/usr/sap/hostctrl/exe/saphostexec -start pf=/usr/sap/hostctrl/exe/host_profile
/usr/sap/hostctrl/exe/saposcol -l
su – daaadm -c startsap all

stop;
# Script for shutting down all services of <SID> App servers
su – <sid>adm -c stopsap -t r3
su – <sid>adm -c /usr/sap/<SID>/D11/exe/sapcontrol -prot NI_HTTP -nr <INR> -function Stop
/usr/sap/hostctrl/exe/saphostexec -stop pf=/usr/sap/hostctrl/exe/host_profile
/usr/sap/hostctrl/exe/saposcol -k
su – daaadm -c stopsap all
su – daaadm -c sapcontrol -nr 98 -prot NI_HTTP -function StopService

 

SAP with Oracle Homogeneous System Copy

1.Make sure which character set the source system is used.
SELECT * FROM V$NLS_PARAMETERS

2.Make an offline backup.
database schema and tablespace name cannot be changed.

3.Other prerequisites
Same Oracle release and patch level for the database in source and target system.
The ojdbc14.jar must exist in the /ORACLE/client/10x_64/instantclient(Standard Oracle installation)
JRE version 1.4 must be inatalled and JAVA_HOME should point to the JRE directory.
The source and target systems must run on different hosts for security resons.
The source and target systems must be binary compatible.

4.Generate the Control File Structure
Create an installation directory with permissions 777 on the source system
Copy the OraBRCOPY.SAR from Installation Master DVD to the installation directory.
Start the OraBRCopy tool as ora or sidadm
If you perform an offline manual copy, enter the following commands:
On UNIX:
./ora_br_copy.sh –generateFiles –forceLogSwitches —targetSid —password —listenerPort
On Windows:
ora_br_copy.bat –generateFiles –forceLogSwitches —targetSid —password —listenerPort
The tool creates the files CONTROL.SQL, CONTROL.TRC and init.ora in your installation directory, shuts down and restarts the database and performs the required log switches.

If you perform an offline or online backup using BR*Tools, enter the following commands:
On UNIX:
./ora_br_copy.sh –generateFiles —targetSid —password —listenerPort
On Windows:
ora_br_copy.bat –generateFiles —targetSid —password —listenerPort
The tool creates the files CONTROL.SQL, CONTROL.TRC and init.ora in your installation directory, and performs the required log switches.
If an error occurs, check the log file:
/ora.brcopy.log

compare the sql file to the trace file.

5.Create a database backup if required.
There are different possibilities to prepare the actual transfer of the database files:
If you have an up-to-date offline backup, you can use it (provided that redo logs were cleaned up with forced log switches).
If you want to transport the database file (for example, on tape) or if you have to perform the database shutdown at a certain time, stop the database (normal shutdown) and perform a complete offline backup. You can use the trace file CONTROL.TRC created by OraBrCOPY to
determine the file system trees that have to be saved.
You stop the database (normal shutdown) and copy the database files when the actual transfer to the target system takes place. You do not have to perform any preparations for the actual transfer now. Proceed with the next step.
Note
If you choose this manual offline backup method, you also have to restore the database files on
the target system manually.

6.Target system.

Make sure the disk space is enough for the database.
Perform system copy installation with SAPinst
Make sure the following directory exsit on the target system.
UNIX:
/oracle//mirrlog
/oracle//origlog
/oracle//sapdata
/oracle//sapreorg
/oracle//saparch
/oracle//oraarch
/oracle//saptrace
/oracle//saptrace/background
/oracle//saptrace/usertrace
/oracle//origlogA/cntrl
/oracle//sapdata1/cntrl
/oracle//saparch/cntrl
/oracle//sapcheck
Windows:
:\oracle\\mirrlog
:\oracle\\origlog
:\oracle\\sapdata
:\oracle\\sapreorg
:\oracle\\saparch
:\oracle\\oraarch
:\oracle\\saptrace
:\oracle\\saptrace\background
:\oracle\\saptrace\usertrace
:\oracle\\origlogA\cntrl
:\oracle\\sapdata1\cntrl
:\oracle\\saparch\cntrl
:\oracle\\sapcheck

chown ora:dba

Make sure the following directory is empty
/oracle//saparch and /oracle//oraarch
:\oracle\\saparch and :\oracle\\oraarch

Set the security settings for the built-in accounts and groups SYSTEM, Administrators, SAP__GlobalAdmin (domain installation), and SAP__LocalAdmin (local installation) for all directories as follows:
a) In the Windows Explorer, right-click the Oracle root directory and choose Properties.
b) Under Security, choose Advanced.
c) Uncheck Allow inheritable permissions from the parent….
d) In the next dialog, choose Copy to copy the permission entries that were previously applied from the parent to this object.
e) Choose OK.
f) Set the permissions for the above-mentioned accounts SYSTEM, Administrators, SAP__GlobalAdmin, or SAP__LocalAdmin to Full Control.
g) Delete all other accounts.

restore database manually
a. Copy the following files from the source to the target system host by copying the listed files from
the source directories to the target directories.
Directories on UNIX:
Source and Target Directory Files
/oracle//sapdata All files
/oracle//origlog All files
/oracle//mirrlog All files

source:
target:
CONTROL.SQL

source:
target: /oracle//_/dbs
init.ora

Directories on Windows:
Source and Target Directory Files
:\oracle\\sapdata All files
:\oracle\\origlog All files
:\oracle\\mirrlog All files
source:
target:
CONTROL.SQL

source:
target: \oracle\\_\database
init.ora

Note
The installation directory of the target system is normally located in the directory:
%programfiles%\sapinst_instdir\NW04S\LM\COPY\ORACLE\SYSTEM\

  1. After you have copied the database files, make sure that the files on the source and target system are not located in different directories or drives. If required, make the corresponding changes in the files control.sql and the init.ora.
    c. Verify that the created directories and copied files have the owner ora, belong to the group dba, and have the permissions 740.
    d. Make sure that the control files are not restored. If necessary, remove them. The file names are specified by the parameter control_files of the init.ora file.

Restore with BRtools
a.Copy the following files from the source system host to the target system host by copying the listed
files from the source directories to the target directories manually.
On UNIX:
Source and Target Directory Files
source:
target:
CONTROL.SQL

source:
target:
/oracle//_/dbs
init.ora

On Windows:
Source and Target Directory Files
source:
target:
CONTROL.SQL

source:
target: \oracle\\_\database
init.ora

b.Create an Oracle spfile from init.ora profile as follows:
Syntax
sqlplus /nolog
connect / as sysdba
create spfile from pfile;
exit

c.Call the restore and recovery function of BR*Tools.

 

Homogeneous System Copy Steps Needed.

Reasons for Copying a SAP System
SAP recommends that you make a system copy in order to build a test, demo, training or standby
system (Oracle and Informix: standby systems cannot be created with a system copy). You should
perform upgrades in a test system first. This way you can identify customer pecific problems which
might result from modifications. Thus, we can sort the general needs for a system copy as follow:
To create a new training system for end-user or project team education
To create a DEMO system
To create a Test system for upgrade or other purposes.
To recover a system on another machine with the same platform after a crash.
To copy large clients. If a client very large to export/import, it is better to do a system copy rather
than client transport.
If a system copy takes place between systems with same platform ( operating system and database
system ) , we call this HOMOGENEOUS SYSTEM COPY.
If The system copy takes place between systems with different platforms ( at least one of the
component must be different, OS or RDBMS ), we call this HETEROGENEOUS SYSTEM COPY.
There 3 ways of a Homogeneous System Copy in R/3 Systems.
1. Homogeneous System Copy using Online / Offline Database Backup.
2. Homogeneous System Copy using R3LOAD Procedure.
3. Homogeneous System Copy using R3COPY Procedure.
This guide is prepared for a Homogeneous System Copy using Online/Offline Database Backup.
The procedure described tested on AIX 4.3.3/Oracle 8.1.7, AIX 5.1/Oracle 8.1.7, AIX 5.1/Oracle 9.2.0
and Win2K/Oracle 8.1.7 platforms.
The command reference given in this guide is taken from a homogeneous system copy done on AIX
4.3.3/Oracle 8.1.7 platform. Differences of other platforms such as Windows will be shown in the same
sections.
Homogeneous System Copy using Online/Offline Database
Backup
This guide is prepared for a Homogeneous System Copy using Online/Offline Database Backup.
Steps for a Homogeneous system copy are briefly as below:
Preparations on Target System.
Restore Online/Offline Backup of Source System onto Target System.
Create CONTROLFILE creation script on Source System.
Modification of CONTROLFILE script and creation of CONTROLFILEs of Target System.
Recovery of Oracle Database on Target System.
Completion of System Copy
Prerequisites
Following conditions must be provided to copy a system:
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.
Type Handbook Document
Area SAP Basis
Topic Homogeneous System Copy using Online/Offline Database Backup
Author Huseyin Bilgen
All Rights Reserved.
Copyright 2001-2003.basisconsultant.com Page 3 of 9
Procedure
1. 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.
  1. su – adm
  2. stopsap all
  3. exit
  4. su – ora
  5. lsnrctl stop
  6. exit
  7. cd /oracle//
  8. rm –rf sapdata?/*
  9. rm –rf origlog?/*
  10. rm –rf mirrlog?
  11. rm –rf sapreorg/*
  12. rm –rf saparch/*
  13. rm –rf saptrace/usertrace/*
  14. rm –rf saptrace/background/*
  15. rm –rf sapbackup/*
  16. rm –rf sapcheck/*
On Windows systems, SAP and Oracle services can be stopped via the following commandline
program after logging as adm:
ntscmgr stop SAP_
ntscmgr stop SAPOSCOL
ntscmgr stop OracleService
2. You have to resize the following file systems before restore process. Take into account sizes of
source system.
/oracle//sapdata1
/oracle//sapdata2
/oracle//sapdata3
/oracle//sapdata4
/oracle//sapdata5
/oracle//sapdata6
/oracle//saparch
3. 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.
Type Handbook Document
Area SAP Basis
Topic Homogeneous System Copy using Online/Offline Database Backup
Author Huseyin Bilgen
All Rights Reserved.
Copyright 2001-2003.basisconsultant.com Page 4 of 9
DB12 – Backup Logs
back.log File
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. You can also
restore datafiles and online redolog files (if you are using offline backup) using backup tools such
as BACKFM tool of IBM TSM.
On Windows systems, while restoring source database on target system, you have to keep
same mount points for Oracle Data Directories.
For example if all of your source data directories resides on “d:>” disk
(d:\oracle\\sapdatax), then you have to create data dirs. at target system on “d:>” disk.
After restore process, you can change the directories. For example you can distribute sapdatax
directories on many disks. This will be mentioned in CONTROLFILE creation step later.
3.a. Mount the necessary backup volume on target system.
3.b. Use the following command to begin restore:
  1. su – ora
  2. cd sapbackup
  3. brrestore -m full -b -c (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. Here is a
sample log of a restore.
Type Handbook Document
Area SAP Basis
Topic Homogeneous System Copy using Online/Offline Database Backup
Author Huseyin Bilgen
All Rights Reserved.
Copyright 2001-2003.basisconsultant.com Page 5 of 9
All the datafiles and online redolog files (only for Offline DB Backup) must be successfully
restored.
At this step, there are 3 probability that must be take into account for the following steps.
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.
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.
Those differences will be detailed in recovery step.
4. After restoring datafiles and redolog files, a scripts must be prepared on source system to create
CONTROLFILE of target system. For this you have 2 option.
4.a. You can use R3COPY program which is under “/kernel/UNIX/COMMON” directory of Kernel
CD. This program can be used only on UNIX systems. For Windows systems, “4.b” option
must be used.
Run this program by ora user on source system. After some confirmations, execute
step “(a) Source system: Generating the script CONTROL.SQL”.
This will create a script named CONTROL.SQL under /oracle//sapreorg directory.
Copy this script into target system (any directory). This file is ready for execution and doesn’t
require any modification.
4.b. SVRMGRL or SQLPLUS can create a scrpit to create controlfile using current
CONTROLFILE content. Login to source system as ora user and execute the following
SVRMGRL/SQLPLUS commands. To be able to execute following commands, database
must be at least in MOUNT mode..
Type Handbook Document
Area SAP Basis
Topic Homogeneous System Copy using Online/Offline Database Backup
Author Huseyin Bilgen
All Rights Reserved.
Copyright 2001-2003.basisconsultant.com Page 6 of 9
  1. svrmgrl
SVRMGR> connect internal
SVRMGR> alter database backup controlfile to trace;
SVRMGR> exit
As a result of this command, a trace file (e.g. ora_54764_hvd.trc ) will be created under
/oracle//saptace/usertrace directory. File can be determined by sorting according to
modification/creation dates (UNIX: # ls –ltr). Most current file must be cheched.
You have to edit this file to be able to use for CONTROLFILE creation on target system.
Rename file name as CONTROL.SQL
Open file to edit using VI (UNIX) or NOTEPAD (WIN).
Remove all lines before “STARTUP MOUNT” line. Delete all commented “#” lines. Also
remove all lines after CHARACTER SET WE8DEC;” line.
Change all Source SID’s to Target SID via following commands.
UNIX (VI): :%s///g
WIN (NOTEPAD): CTRL+H
Change the line
CREATE CONTROLFILE REUSE DATABASE ‘SSID’ NORESETLOGS ARCHIVELOG;
as follow
CREATE CONTROLFILE REUSE SET DATABASE ‘TSID’ RESETLOGS ARCHIVELOG;
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.
If structural changes made in database on source system just after the backup restored on
target machine, differences will exists between datafiles in sapdata directories and datafiles
referenced in CONTROL.SQL file. Because CONTROL.SQL file is created for the current
status of source system, but later added files doen’t exists in backup so in target system. To
overcome this problem, just delete the datafiles from CONTROL.SQL file.
If you don’t know which files are created after the backup, let the problems arise during
CONTROLFILE creation command, and delete the files mentioned as error from
CONTROL.SQL and re-run creation command.
After deletion and successful creation of CONTROLFILE’s on target system, you have to take
into account the following subjects:
If you are not going to recover database to the most current status using archive files, then
there is no problem.
But if you are planning to recover database to the most current status using archive files,
then deleted datafiles will be problem later while application of archive files. At this
moment, we offer you to keep datafile names you deleted during CONTROLFILE creation
and add those datafiles with the same sizes on source system after CONTROLFILE
creation.
5. After CONTROL.SQL script preparation, following commands must be run to create
CONTROLFILE of target system:
  1. su – ora
Type Handbook Document
Area SAP Basis
Topic Homogeneous System Copy using Online/Offline Database Backup
Author Huseyin Bilgen
All Rights Reserved.
Copyright 2001-2003.basisconsultant.com Page 7 of 9
  1. svrmgrl
SVRMGR> connect internal
SVRMGR> @//control.sql
You have to guarantee the successful completion of this command as follow:
SVRMGR> @control.sql
Statement processed.
SVRMGR>
6. Database will be in inconsistent status after creation of CONTROLFILE. This can be viewed by
trying to open the database.
SVRMGR> alter database open;
alter database open
*
ORA-01589: must use RESETLOGS or NORESETLOGS option for database open
SVRMGR> alter database open resetlogs;
alter database open resetlogs
*
ORA-01195: online backup of file 1 needs more recovery to be consistent
ORA-01110: data file 1: ‘/oracle//sapdata1/system_1/system.data1’
At this step, a recovery must be made in order to be able to use the database.
7. 3 type of recovery can be made, according to your status mentioned at the end of STEP-3. all the
recovery types must be used by “USING BACKUP CONTROLFILE” as CONTROLFILE is created
manually.
7.a. If your source system is runnig in NOARCHIVELOG mode, then you have to use the
following command to recover database.
SVRMGR> recover database using backup controlfile until cancel;
7.b. 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.
SVRMGR> 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 via the
following script.
cd /oracle//saparch
for i in `ls|grep `;
do
file_name=`echo $i |cut -dD -f2`;
mv $i $;
done
Alternatively you can enter file names manually as required by recovery session as follow:
SVRMGR> recover database using backup controlfile;
ORA-00279: change 44138924 generated at 03/26/2003 00:00:24 needed for thread 1
ORA-00289: suggestion : /oracle/HVS/saparch/HVSarch1_22746.dbf
Type Handbook Document
Area SAP Basis
Topic Homogeneous System Copy using Online/Offline Database Backup
Author Huseyin Bilgen
All Rights Reserved.
Copyright 2001-2003.basisconsultant.com Page 8 of 9
ORA-00280: change 44138924 for thread 1 is in sequence #22746
Specify log: {=suggested | filename | AUTO | CANCEL}
/oracle/HVS/saparch/HVDarch1_22746.dbf
Log applied.
After application of all necessary archives (at least all the archives created during online
backup must be applied. Archives from this point can be applied to make database current),
next request for archive is cancelled via CANCEL command.
ORA-00279: change 44164157 generated at 03/26/2003 01:58:29 needed for thread 1
ORA-00289: suggestion : /oracle/HVS/saparch/HVSarch1_22754.dbf
ORA-00280: change 44164157 for thread 1 is in sequence #22754
Specify log: {=suggested | filename | AUTO | CANCEL}
CANCEL
Media recovery cancelled.
SVRMGR>
But recovery session must be started with the following command and cancelled again to ba
able to start database.
SVRMGR> recover database using backup controlfile until cancel;
ORA-00279: change 44164157 generated at 03/26/2003 01:58:29 needed for thread 1
ORA-00289: suggestion : /oracle/HVS/saparch/HVSarch1_22754.dbf
ORA-00280: change 44164157 for thread 1 is in sequence #22754
Specify log: {=suggested | filename | AUTO | CANCEL}
CANCEL
Media recovery cancelled.
SVRMGR>
Otherwise following error will arise during database opening.
SVRMGR> alter database open resetlogs;
alter database open resetlogs
*
ORA-01113: file 1 needs media recovery
ORA-01110: data file 1: ‘/oracle/HVS/sapdata1/system_1/system.data1’
To open database, use the following command:
SVRMGR> alter database open resetlogs;
Statement processed.
SVRMGR>
7.c. If you restored an offline backup on target system, you can recover database to the time of
backup completed or you can recover database to the most current status using archive files.
The archive application and statup of database is same as an online backed up database
copy in “7.b”.
8. after opening database, LISTENER process must be started.
  1. su – ora
  2. lsnrctl start
On Windows systems, Oracle Listener is started as below:
ntscmgr start OracleOraHome817TNSListener
9. To open SAP system, use the following commands.
Type Handbook Document
Area SAP Basis
Topic Homogeneous System Copy using Online/Offline Database Backup
Author Huseyin Bilgen
All Rights Reserved.
Copyright 2001-2003.basisconsultant.com Page 9 of 9
  1. su – adm
  2. startsap
On Windows systems, Oracle Listener is started as below:
ntscmgr start SAP_
ntscmgr start SAPOSCOL
ntscmgr start OracleService
startsap name= nr= SAPDIAHOST=
10. 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.
11. Logon to the SAP R/3 System and goto TCODE SE06. Select “Database Copy or Migration” and
execute “Post Installation Processing”.
SE06
Change all of the Source System Objects to Target System Objects as asked.
12. Delete old TMS configuration and make new configuration for TMS via STMS TCODE.
13. After all of above steps, you have completed a System Copy using Online/Offline Database
Backup.

STEP BY STEP SYSTEM COPY ( Backup Restore)

  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.
  1. STOP SAP & Oracle SERVICES AND EMPTY FOLLOWING  DIRECTORIES :
Go to Target Server & Stop all services (oracle & SAP both).
Now Delete the All files inside the following Directories.
SAPDATA_HOME\sapdata1\sysaux
SAPDATA_HOME\sapdata1\system
SAPDATA_HOME\sapdata1\temp
SAPDATA_HOME\sapdata1\undo
SAPDATA_HOME\sapdata1\cntrl
SAPDATA_HOME\sapdata2\ sr3_1 ………sr3_n
SAPDATA_HOME\sapdata3\ sr3702_1 ……… sr3702_n
SAPDATA_HOME\sapdata4\sr3usr_1
SAPDATA_HOME\origlogA\cntrl
SAPDATA_HOME\origlogB\cntrl
SAPDATA_HOME\sapdata1\cntrl
  1. PLACE BACKUP FILE IN SAPBACKUP DIRECTORY
Place the xxxxxxxx.and File In Sap backup Folder
SAPDATA_HOME \sapbackup
The File Name Will Be Like This belerzpm.and
  1. Open Cmd Prompt And Run This Command
BRRESTORE –m full –b xxxxxxxx.and –d disk –c
Now The Restoration Process Has Started
  1. Again Delete Oracle Control Files under these directories that comes after restoration  
SAPDATA_HOME \origlogA\cntrl
SAPDATA_HOME \origlogB\cntrl
SAPDATA_HOME \sapdata1\cntrl
  1. Create trace file in source server using this command:
SQL>Alter database backup controlfile to trace;
Copy this trace file to target server and rename to control.sql.
Now modify this control.sql
Delete all before “startup mount” & after “CHARACTER SET UTF8;” in control.sql
Change
  • to
  • REUSE –> SET
  • NORESETLOGS –> RESETLOGS
            Now, Put this Control.sql to C drive on    SYSTEM.        
              Start Oracle Services
             SQL> @C:\CONTROL.SQL;   
  1. Copy all archive logs to SAPDATA_HOME\oraarch & Run these commands
SQL> RECOVER DATABASE USING BACKUP CONTROLFILE UNTIL CANCEL;     
SQL>ALTER DATABASE OPEN RESETLOGS;
  1. Create Users as per note 50088.
  1. Start SAP Services.

 

SAP DB Refresh with Oracle as Database

Production data refresh to Quality System
  1. Take the offline backup of Production Server to disk
  2. Generate the backup of control file to trace using the following command.
SQL> alter database backup control file to trace;
  1. Copy the offline back and control file to Quality system for restoration.
  2. login as ora and execute the following  command to start restore
#  brrestore –m full –b behzzrjk.afd

System Refresh

Posted on April 26, 2014 by SAP Basis Admin

System refresh is nothing but moving the production system data to quality system for testing purpose.

Generally system refresh will be done when the client size is more and we cannot move the production system data to quality system.

Types of system refresh:-

  1. Using offline backup
  2. Using online backup Procedure:-Source system (Production)
  3. Take the screenshots of important T-code Ex: SCC4, SM58, ST06, SM36, SM37 and the clients specified t-cods.
  4. Export client settings – Table T000
  5. Printer settings – Table TSP03 and TSP03CORIn SPAD t-code we can export or import and delete the configuration
  6. RFC Destination – Table RFCDES Note: – For all the above we have to create the DUMY transport request in t-code SE01.
  7. Apart from this we also take the backup of user master record. For this we will export SAP_USR profile in SCC8 t-code.
  8. For all the transport requests we have to take down the transport number

.7.  Take the clean offline backup (Will be done by backup team)

  1. Generate the control file using the command Alter database backup control file to trace File will be stored in path- oracle/SID/saptrace/usetrace
  2. Edit the control file as mentioned below.   Delete above startup nomountb.  Delete below character set UTFS; c.   Replace Reuse to SET – Will change Source SID to Target SID.d.  Replace No Reset log to Reset log – Will change the log sequence of offline redo log files.   Replace Archiving to No Archiving – Will avoid creating log files while starting the system
  3. Save the control file as .sql or .trc.Target system (Quality)
  4. Delete all contents insideSapdata1, sapdata

2 to sapdataN, origlog A, origlogB, MirrorlogA, MirrorlogB, saptrace, sapreorg, sapcheckCommand to delete – rm –rf sapdata*

  1. Ask backup team to restore the source system backup to target systemNote: If we have root access no problem, if it is not there UNIX team will change root permission.    Command is chown –r        

 Change the permission inside root           

 Command – chown –r data file name

  1. Run the script – DB will come to no mount state
  2. Then recover the database using the command Recover database using control file until cancel
  3. Execute command Alter database open reset log – It will reset redo log sequence number
  4. Then execute command – shutdown immediate
  5. Execute startup – will start oracle
  6. Change the OPS$ password – Through BRTOOLS – BRCONNECT – 8, 49.  

Make background process ZeroRdisp/wp_no_btc=010.      

Startup – Will start SAP Post activity:

  1. Import RFC definition, client settings, printer settings, Delete and configure SMQ1 and SMQ2
  2. Change the background parameter
  3. Restart the system If we are using online backup then we have do below mentioned steps.
  4. Perform point-in recovery
  5. To do point-in recovery we have to copy the oraarch directory from source system to target system. Command – Recover database using control file until time and date. After refresh if the system is not starting do the below steps.
  6. Check R/3 Trans is working or not Command- R3trans –d – It will check the connection between SAP and DB
  7. Delete source system OPS$ password
  8. Change OPS$ password through BRCONNECT option 8,

4Note: SQL file character will be changed in init.ora file    Path: oracle/SID/102_64/dbs/init.ora            oracle/SID/102_64/dbs/init.sap

SAP System Copy

There 3 ways of a Homogeneous System Copy in R/3 Systems.
  1. Homogeneous System Copy using Online / Offline Database Backup.
  2. Homogeneous System Copy using R3LOAD Procedure.
  3. Homogeneous System Copy using R3COPY Procedure.
This guide is prepared for a Homogeneous System Copy using Online/Offline Database Backup.
The procedure described tested on AIX 4.3.3/Oracle 8.1.7, AIX 5.1/Oracle 8.1.7, AIX 5.1/Oracle 9.2.0 and Win2K/Oracle 8.1.7 platforms.
The command reference given in this guide is taken from a homogeneous system copy done on AIX 4.3.3/Oracle 8.1.7 platform. Differences of other platforms such as Windows will be shown in the same sections.
Homogeneous System Copy using Online/Offline Database Backup
This guide is prepared for a Homogeneous System Copy using Online/Offline Database Backup. Steps for a Homogeneous system copy are briefly as below:
  1.  Preparations on Target System.
  2.  Restore Online/Offline Backup of Source System onto Target System.
  3.  Create CONTROLFILE creation script on Source System.
  4.  Modification of CONTROLFILE script and creation of CONTROLFILEs of Target System.
  5.  Recovery of Oracle Database on Target System.
  6.  Completion of System Copy
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
1. 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.
# su -adm # stopsap all # exit # su – ora # lsnrctl stop # exit # cd /oracle// # rm –rf sapdata?/* # rm –rf origlog?/* # rm –rf mirrlog? # rm –rf sapreorg/* # rm –rf saparch/* # rm –rf saptrace/usertrace/* # rm –rf saptrace/background/* # rm –rf sapbackup/* # rm –rf sapcheck/*
  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
  3. 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.
DB12 -Backup Logs
back.log File
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. You can also restore datafiles and online redolog files (if you are using offline backup) using backup tools such as BACKFM tool of IBM TSM.
3.a. Mount the necessary backup volume on target system.
3.b. Use the following command to begin restore:
# su -ora # cd sapbackup # brrestore -m full -b -c (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. Here is a sample log of a restore
All the datafiles and online redolog files (only for Offline DB Backup) must be successfully restored.
At this step, there are 3 probability that must be take into account for the following steps.
 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.
 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.
Those differences will be detailed in recovery step.
4. After restoring datafiles and redolog files, a scripts must be prepared on source system to create CONTROLFILE of target system. For this you have 2 option.
4.a. You can use R3COPY program which is under “/kernel/UNIX/COMMON” directory of Kernel CD. This program can be used only on UNIX systems. For Windows systems, “4.b” option must be used. Run this program by ora user on source system. After some confirmations, execute step “(a) Source system: Generating the script CONTROL.SQL”. This will create a script named CONTROL.SQL under /oracle//sapreorg directory. Copy this script into target system (any directory). This file is ready for execution and doesn’t require any modification.
4.b. SVRMGRL or SQLPLUS can create a scrpit to create controlfile using current CONTROLFILE content. Login to source system as ora user and execute the following SVRMGRL/SQLPLUS commands. To be able to execute following commands, database must be at least in MOUNT mode..
# svrmgrl SVRMGR> connect internal SVRMGR> alter database backup controlfile to trace; SVRMGR> exit
As a result of this command, a trace file (e.g. ora_54764_hvd.trc ) will be created under /oracle//saptace/usertrace directory. File can be determined by sorting according to modification/creation dates (UNIX: # ls –ltr). Most current file must be cheched.
You have to edit this file to be able to use for CONTROLFILE creation on target system.
  1. Rename file name as CONTROL.SQL
  2. Open file to edit using VI (UNIX) or NOTEPAD (WIN).
  3. Remove all lines before “STARTUP MOUNT” line. Delete all commented “#” lines. Also remove all lines after CHARACTER SET WE8DEC;” line.
  4. Change all Source SID’s to Target SID via following commands.
UNIX (VI): :%s///g WIN (NOTEPAD): CTRL+H
 Change the line
CREATE CONTROLFILE REUSE DATABASE ‘SSID’ NORESETLOGS ARCHIVELOG;
as follow
CREATE CONTROLFILE REUSE SET DATABASE ‘TSID’ RESETLOGS ARCHIVELOG;
 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
5. After CONTROL.SQL script preparation, following commands must be run to create CONTROLFILE of target system:
# su – ora
# svrmgrl SVRMGR> connect internal SVRMGR> @/ /control.sql
You have to guarantee the successful completion of this command as follow:
SVRMGR> @control.sql Statement processed. SVRMGR>
6. Database will be in inconsistent status after creation of CONTROLFILE. This can be viewed by trying to open the database.
SVRMGR> alter database open; alter database open * ORA-01589: must use RESETLOGS or NORESETLOGS option for database open SVRMGR> alter database open resetlogs; alter database open resetlogs * ORA-01195: online backup of file 1 needs more recovery to be consistent ORA-01110: data file 1: ‘/oracle//sapdata1/system_1/system.data1′
At this step, a recovery must be made in order to be able to use the database.
7. 3 type of recovery can be made, according to your status mentioned at the end of STEP-3. all the recovery types must be used by “USING BACKUP CONTROLFILE” as CONTROLFILE is created manually.
7.a. If your source system is runnig in NOARCHIVELOG mode, then you have to use the following command to recover database.
SVRMGR> recover database using backup controlfile until cancel;
7.b. 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.
SVRMGR> 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 via the following script.
cd /oracle//saparch for i in `ls|grep `; do
file_name=`echo $i |cut -dD -f2`; mv $i ${file_name}; done
Alternatively you can enter file names manually as required by recovery session as follow:
SVRMGR> recover database using backup controlfile; ORA-00279: change 44138924 generated at 03/26/2003 00:00:24 needed for thread 1 ORA-00289: suggestion : /oracle/HVS/saparch/HVSarch1_22746.dbf
ORA-00280: change 44138924 for thread 1 is in sequence #22746 Specify log: {=suggested | filename | AUTO | CANCEL} /oracle/HVS/saparch/HVDarch1_22746.dbf Log applied.
After application of all necessary archives (at least all the archives created during online backup must be applied. Archives from this point can be applied to make database current), next request for archive is cancelled via CANCEL command.
ORA-00279: change 44164157 generated at 03/26/2003 01:58:29 needed for thread 1 ORA-00289: suggestion : /oracle/HVS/saparch/HVSarch1_22754.dbf ORA-00280: change 44164157 for thread 1 is in sequence #22754 Specify log: {=suggested | filename | AUTO | CANCEL} CANCEL Media recovery cancelled. SVRMGR>
But recovery session must be started with the following command and cancelled again to ba able to start database.
SVRMGR> recover database using backup controlfile until cancel; ORA-00279: change 44164157 generated at 03/26/2003 01:58:29 needed for thread 1 ORA-00289: suggestion : /oracle/HVS/saparch/HVSarch1_22754.dbf ORA-00280: change 44164157 for thread 1 is in sequence #22754 Specify log: {=suggested | filename | AUTO | CANCEL} CANCEL Media recovery cancelled. SVRMGR>
Otherwise following error will arise during database opening.
SVRMGR> alter database open resetlogs; alter database open resetlogs * ORA-01113: file 1 needs media recovery ORA-01110: data file 1: ‘/oracle/HVS/sapdata1/system_1/system.data1′
To open database, use the following command:
SVRMGR> alter database open resetlogs; Statement processed. SVRMGR>
7.c. If you restored an offline backup on target system, you can recover database to the time of backup completed or you can recover database to the most current status using archive files. The archive application and statup of database is same as an online backed up database copy in “7.b”.
8. after opening database, LISTENER process must be started.
# su – ora # lsnrctl start
9. To open SAP system, use the following commands.
# su -adm # startsap
  1. 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.
  2. Logon to the SAP R/3 System and goto TCODE SE06. Select “Database Copy or Migration” and execute “Post Installation Processing”.
SE06
Change all of the Source System Objects to Target System Objects as asked.
  1. Delete old TMS configuration and make new configuration for TMS via STMS TCODE.
  2. After all of above steps, you have completed a System Copy using Online/Offline Database Backup

 

Leave Your Text