Source: TBLUSR16
Target: TBLUSR17
SID : TBP (Remains same in target)
OS : AIX 5.3 (same in source and target)
DB : Oracle 9.2.0.6.0 (Becomes same after cloning)
SAP : Enterprise Edition with Unicode (SAP 470)
Restoring the live production system in another system which is
TBLUSR17 as it is with SID remains same TBP from an offline backup.
The step performed here eliminates the installation of SAP in target
system. Rather we copy all the existing installation directories/files
structure from the source (TBLUSR16) to target (TBLUSR17). SID remains
same.
This process is called system cloning.
We performed following steps to build another SAP system with same
structure.
Source system (TBLUSR16)
-----------------------------------
· Create two userids <SID>Adm and ORA<SID> in target as it is in
source with same UID and GID
· Create the directory structure for SAP as it is in source
· Create directory structure for /usr/sap in target
· Create directory structure for /oracle and /oracle/<SID> in target
· Copy /usr/sap from source to target
· Copy oracle binary i.e. oracle_home (oracle/<SID>/920_64/) to
target
· Make sure you have enough space in target as it is in source
· Check the dbsize in source using DB02 at sap level in this case it
is 132GB in TBP
· So you need a minimum space of 150GB (in this case) in target for
/oracle and /usr/sap file systems which includes your other
directories/files.
· If you don't have enough space, consult your system admin to avail
the space for you.
· Login as ora<sid> user at OS level.
· Perform cold offline backup (backup location
/hotbackup/TBP/databackup) using the following command
[/oracle/TBP/920_64/dbs]>brbackup -u / -c -t offline -p
DBcold.initTBP.sap
Backup log file created as bdtqzanc.afd and located in
/oracle/<SID>/sapbackup
· Transfer the whole contents of /hotbackup/TBP/databackup/ directory
to target /recovery/TBP/databackup/
· The contents of /recovery/TBP/databackup looks like as below
[/recovery/TBP/databackup]> ls -l
total 8
drwxr-xr-x 2 oratbp dba 256 Oct 08 09:11 TBP
drwxr-xr-x 2 oratbp dba 4096 Oct 08 09:51 bdtqzanc
Where TBP folder contains all the parameter files needed during restore
process
And bdtqzanc directory contains all the datafiles needed during restore
process
· Contents under folder TBP looks as below
[/recovery/TBP/databackup/TBP]> ls -l
Total 288
-rw-r--r-- 1 root system 66676 Oct 08 09:11 backTBP.log
-rw-r--r-- 1 root system 30505 Oct 08 09:11 bdtqzanc.afd
-rw-r--r-- 1 root system 19499 Oct 08 09:11
initTBP.DBcold.sap
-rw-r--r-- 1 root system 1799 Oct 08 09:11 initTBP.ora
-rw-r--r-- 1 root system 191 Oct 08 09:11 paramTBP.log
-rw-r--r-- 1 root system 3095 Oct 08 09:11 spaceTBP.log
-rw-r--r-- 1 root system 3584 Oct 08 09:11 spfileTBP.ora
-rw-r--r-- 1 root system 6824 Oct 08 09:11 strucTBP.log
· Contents under folder bdtqzanc look as below
[/recovery/TBP/databackup/bdtqzanc]> ls -l
total 63119368
-rw-r--r-- 1 root system 511038 Oct 08 09:13 cntrlTBP.dbf.Z
-rw-r--r-- 1 root system 22150145 Oct 08 09:13
log_g11m1.dbf.Z
-rw-r--r-- 1 root system 26468845 Oct 08 09:13
log_g12m1.dbf.Z
-rw-r--r-- 1 root system 15595177 Oct 08 09:13
log_g13m1.dbf.Z
-rw-r--r-- 1 root system 29417885 Oct 08 09:14
log_g14m1.dbf.Z
-rw-r--r-- 1 root system 166714510 Oct 08 09:14 system.data1.Z
-rw-r--r-- 1 root system 1286620936 Oct 08 09:16 tbl.data1.Z
-rw-r--r-- 1 root system 1230713558 Oct 08 09:17 tbl.data10.Z
-rw-r--r-- 1 root system 1146310947 Oct 08 09:19 tbl.data11.Z
-rw-r--r-- 1 root system 1115980890 Oct 08 09:20 tbl.data12.Z
-rw-r--r-- 1 root system 815521373 Oct 08 09:22 tbl.data13.Z
-rw-r--r-- 1 root system 748882550 Oct 08 09:23 tbl.data14.Z
-rw-r--r-- 1 root system 705524607 Oct 08 09:24 tbl.data15.Z
-rw-r--r-- 1 root system 492938212 Oct 08 09:24 tbl.data16.Z
-rw-r--r-- 1 root system 1187287933 Oct 08 09:26 tbl.data2.Z
-rw-r--r-- 1 root system 1126064533 Oct 08 09:28 tbl.data3.Z
-rw-r--r-- 1 root system 1171997295 Oct 08 09:29 tbl.data4.Z
-rw-r--r-- 1 root system 1177666829 Oct 08 09:31 tbl.data5.Z
-rw-r--r-- 1 root system 1250065469 Oct 08 09:33 tbl.data6.Z
-rw-r--r-- 1 root system 1308230125 Oct 08 09:35 tbl.data7.Z
-rw-r--r-- 1 root system 1308058351 Oct 08 09:36 tbl.data8.Z
-rw-r--r-- 1 root system 1352419501 Oct 08 09:38 tbl.data9.Z
-rw-r--r-- 1 root system 827745326 Oct 08 09:39 tbl620.data1.Z
-rw-r--r-- 1 root system 899996528 Oct 08 09:41
tbl620.data10.Z
-rw-r--r-- 1 root system 580005541 Oct 08 09:42
tbl620.data11.Z
-rw-r--r-- 1 root system 111340126 Oct 08 09:42
tbl620.data12.Z
-rw-r--r-- 1 root system 98598461 Oct 08 09:42
tbl620.data13.Z
-rw-r--r-- 1 root system 97923183 Oct 08 09:42
tbl620.data14.Z
-rw-r--r-- 1 root system 803086345 Oct 08 09:43 tbl620.data2.Z
-rw-r--r-- 1 root system 726618248 Oct 08 09:44 tbl620.data3.Z
-rw-r--r-- 1 root system 784340533 Oct 08 09:45 tbl620.data4.Z
-rw-r--r-- 1 root system 807538737 Oct 08 09:46 tbl620.data5.Z
-rw-r--r-- 1 root system 812803787 Oct 08 09:48 tbl620.data6.Z
-rw-r--r-- 1 root system 788278036 Oct 08 09:49 tbl620.data7.Z
-rw-r--r-- 1 root system 801337049 Oct 08 09:50 tbl620.data8.Z
-rw-r--r-- 1 root system 834419639 Oct 08 09:51 tbl620.data9.Z
-rw-r--r-- 1 root system 70790495 Oct 08 09:51 tblusr.data1.Z
-rw-r--r-- 1 root system 185180080 Oct 08 09:51 temp.data1.Z
-rw-r--r-- 1 root system 5401884285 Oct 08 09:59 undo.data1.Z
All the .Z files are compressed files created during backup.
· login as ora<SID> user in target
· Make the necessary changes to tnsnames.ora and listner.ora in
$ORACLE_HOME/network/admin folder
· Make sure the hostname and port number mentioned in files perfectly
like below
Tnsnames.ora file
==============================================================
/TBP###############
# Filename......: tnsnames.ora
# Created.......: created by SAP AG, R/3 Rel. >= 6.10
# Name..........:
# Date..........:
################
TBP.WORLD =
(DESCRIPTION =
(SDU = 32768)
(ADDRESS_LIST =
(ADDRESS =
(COMMUNITY = SAP.WORLD)
(PROTOCOL = TCP)
(HOST = tblusr17)
(PORT = 1527)
)
)
(CONNECT_DATA =
(SID = TBP)
(GLOBAL_NAME = TBP.WORLD)
)
)
===============================================================
Listner.ora file
===============================================================
################
# Filename......: listener.ora
# Created.......: created by SAP AG, R/3 Rel. >= 6.10
# Name..........:
# Date..........:
################
LISTENER =
(ADDRESS_LIST =
(ADDRESS =
(PROTOCOL = IPC)
(KEY = TBP.WORLD)
)
(ADDRESS=
(PROTOCOL = IPC)
(KEY = TBP)
)
(ADDRESS =
(COMMUNITY = SAP.WORLD)
(PROTOCOL = TCP)
(HOST = tblusr17)
(PORT = 1527)
)
)
STARTUP_WAIT_TIME_LISTENER = 0
CONNECT_TIMEOUT_LISTENER = 10
TRACE_LEVEL_LISTENER = OFF
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SDU = 32768)
(SID_NAME = TBP)
(ORACLE_HOME = /oracle/TBP/920_64)
)
)
==============================================================
· Ora<sid> > sqlplus "/ as sysdba"
· If you get the following error
"""
Exec (): 0509-036 cannot load program oraclewf04d because of the
following errors:
0509-150 Dependent module libjox9.a (shr.o) could not be loaded.
0509-022 Cannot load module libjox9.a (shr.o).
0509-026 System error: A file or directory in the path name does not
exist.
ERROR:
ORA-12547: TNS: lost contact
""""
· Make sure LIBPATH is set for oracle.
· Execute the following command to relink them at OS level
Ora<sid> > relink all
(It will link all the library files required to get into oracle as SQL
level)
· [/oracle/TBP]>sqlplus "/ as sysdba"
Connected to an Idle Instance
SQL>
· If you get the above message then your oracle engine is working
fine now.
· You have to restore the datafiles, control files and parameter
files to build your database.
· Now restore the datafiles from backup as ora<sid> in target
df -k |grep sapdata
df -k|grep oraarch
· The above file system utilization should be "0".
· Copy the following files to their original location from source to
target using FTP or any other copy method.
source:/oracle/TBP/sapbackup/backTBP.log to
target:/oracle/TBP/sapbackup/backTBP.log
source:/oracle/TBP/sapbackup/bdtqzanc.afd to
target:/oracle/TBP/sapbackup/bdtqzanc.afd
source:/oracle/TBP/sapreprg/spaceTBP.log to
target:/oracle/TBP/sapreorg/spaceTBP.log
· Edit the bdtqzanc.afd file to change backup location i.e. from
/hotbackup/TBP/databackup to /recovery/TBP/databackup.
· Edit the backup parameter file i.e. DBcold.initTBP.sap to change
backup location from /hotbackup/TBP/databackup to
/recovery/TBP/databackup.
brrestore -u / -c -b bdshvcxl.afd -p
$ORACLE_HOME/dbs/DBcold.initTBP.sap
Where .afd file is offline backup log file from source and located in
/oracle/TBP/sapbackup
· All the datafiles are restored to their original location during
this period.
· Open the controlfile.sql file and check all the directory structure
control file needs are existing in the target system.
· Open the init<SID>.ora from parameter file from
/oracle/TBP/920_64/dbs and check the locations of control files
· Make sure you have the control files available in those locations.
· If any of the file is missing, try to get it from your backup
manually.
· If you need to apply the archive logs during recovery, and then
make sure you have all the archive logs available
In /oracle/<SID>/oraarch location
OR
During application you can provide the archive file location.
· Now login as ora<Sid> at OS level (e.g. oratbp)
[/oracle/TBP/920_64/dbs]> cd $ORACLE_HOME/dbs
· Issue the following command
[/oracle/TBP/920_64/dbs]> Sqlplus "/ as sysdba"
SQL*Plus: Release 9.2.0.6.0 - Production on Tue Oct 10 12:41:39 2006
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Connected to an idle instance.
SQL> @controlfile.sql
ORACLE instance started.
Total System Global Area 1948225392 bytes
Fixed Size 745328 bytes
Variable Size 1006632960 bytes
Database Buffers 939524096 bytes
Redo Buffers 1323008 bytes
Control file created.
SQL> recover automatic database using backup control file until cancel;
ORA-00279: change 374340046 generated at 10/07/2006 14:14:01 needed for
thread
1
ORA-00289: suggestion: /oracle/TBP/oraarch/TBParch1_11587.dbf
ORA-00280: change 374340046 for thread 1 is in sequence #11587
ORA-00278: log file '/oracle/TBP/oraarch/TBParch1_11587.dbf' no longer
needed
for this recovery
ORA-00308: cannot open archived log
'/oracle/TBP/oraarch/TBParch1_11587.dbf'
ORA-27037: unable to obtain file status
IBM AIX RISC System/6000 Error: 2: No such file or directory
Additional information: 3
Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
auto
ORA-00308: cannot open archived log
'/oracle/TBP/oraarch/TBParch1_11587.dbf'
ORA-27037: unable to obtain file status
IBM AIX RISC System/6000 Error: 2: No such file or directory
Additional information: 3
ORA-00308: cannot open archived log
'/oracle/TBP/oraarch/TBParch1_11587.dbf'
ORA-27037: unable to obtain file status
IBM AIX RISC System/6000 Error: 2: No such file or directory
Additional information: 3
SQL>Alter Database open resetlogs;
Database altered.
· Once this message is appeared, your database is recovered
successfully and opened to use by users.
SQL> Exit
· Make sure all oracle processes for TBP is running as below
[/recovery/TBP/databackup/bdtqzanc]> ps -ef|grep ora_ |grep TBP
oratbp 889074 1 0 12:41:50 - 0:05 ora_pmon_TBP
oratbp 1273926 1 0 12:41:50 - 0:02 ora_dbw0_TBP
oratbp 1282058 1 0 12:41:50 - 0:05 ora_ckpt_TBP
oratbp 1302542 1 0 12:41:50 - 0:00 ora_arc1_TBP
oratbp 1429532 1 0 12:41:50 - 0:00 ora_reco_TBP
oratbp 1450128 1 0 12:41:50 - 0:00 ora_arc0_TBP
oratbp 1499174 1 0 12:41:50 - 0:04 ora_lgwr_TBP
oratbp 1589286 1 0 12:41:50 - 0:03 ora_smon_TBP
· From above it is clear that, all the oracle background processes
are running fine.
· Start the listner now as ora<sid> user in another window.
[/oracle/TBP/920_64/dbs]>lsnrctl start
· Wait for success message
· Once listner is up , try to start sap using <sid>adm user from
different window
· Now login as <sid>adm
[/home/tbpadm] R3trans -d
· You should get Reurn code of [0000]. Go for startsap
· If you get return code of [0012] then read the trans.log file for
detail error message.
· Now try to start sap on the box
[/home/tbpadm]>startsap r3 (because database is already running)
· Look for message "SAP Instance Started"
[/home/tbpadm]>ps -ef|grep dw
[/home/tbpadm]>ps -ef|grpe ora_ |grep TBP
· Now login to SAP using your SAPlogon menu and perform a general
health check commands
Post Copy Steps
================
· Login to SAP from saplogon menu
Perform following checks in newly copied system
Tcodes:
SICK: check whether any error after copy
SM21: Any kind of system reported error
SM37: Check for background jobs Released or active . Cancel or
deschdule them now except the jobs starts with SAP*, DDIMP, ARCH*
ST22: Check for any dumps
DB02: Check the tablespace status
SE06: check for system change setting if anything changed
SCC4: check for clients
RZ10: Check profile parameter
RZ04: check for operation mode setting
SPAD: check for printer setting and see if it is working fine
SA01: Number Range setting in newly copied system
SMLG: Logon group in target system
· Ask users to login to the new system and test their data for UAT.
· Change some system profiles later if it is needed for performance
reason.
~~~~~ Enjoy now with new cloned system ~~~~~~~~~