Tuesday, November 16, 2010

SAP Homogeneous Copy on UNIX Systems

For specific periods system copy is a must on SAP System to provide synchronization of the systems. Now we are going to look on how to do homogeneous copy of SAP on UNIX Systems.


(You have to enter your system ID to the uzd , uzp and system id fields in article. uzd is my development uzp is my production system.)

-First of all, you have the backup file of the production system. This backup file should be copied to development system. The backup file (.FDD) is located under : /oracle/"systemID"/sapbackup/  in production system.  Under sapbackup folder and in init<SID>.sap file it should be copied where backup is belong to. Also the same backup file should be copied under backup file under init<SID>.sap (/backup).

-Shut down the development system. Delete the control file on development system. This files are located in:

/oracle/systemID/origlogA/cntrl/cntrlsystemID.dbf
/oracle/systemID/origlogB/cntrl/cntrlsystemID.dbf
/oracle/systemID/sapdata/cntrl/cntrlsystemID.dbf

-Restore process will be started with the command : brrestore -b bdxbzdck.ffd -m full. This command should be ran by orauzd user (uzd is my system ID).  In this level system will give 3 warnings about Backup system is UZP & now system in progress is UZD . Type C and pass this warnings.
-Create control.sql file by the command : SQL>alter database backup controlfile to trace resetlogs;
After that , go under /oracle/SOURCEsystemID/saptrace/usertrace change the latest ora,trace... file as control.sql. Copy this file under /oracle/TARGETsystemID/sapreorg .

-Open this control.sql file with VI editor. Delete all the rows except the rows starting with CREATE & end with ; . Save the file. 
Delete REUSE in first row in CREATE CONTROLFILE REUSE and change it as SET. Moreover , change all UZP as UZD. This operation can be done with below command: 

:1, $S /UZP/UZD/g 
after all these operations save control.sql file.

-Enter development system with command , su -orauzd . first stop Listener and then re-start it.

>lsnrctr stop
>lsnrctt start


Enter SQL 
 >sqlplus / as sysdba

SQL>startup nomount;   -- by this command database is started in nomount mode.
exit SQL with command exit , now we need to enter SQL again  from the folder where control.sql is located in.

>sqlplus / as sysdba

then below commands is going to be ran :
to see database users : 
SQL>select * from dba_users
to delete OPS$ user :
OPS$<SID>ADM
SQL>drop user OPS$<SID>ADM cascade;
SQL>@control.sql  (SAP NOTE : 400241)
SQL>alter database open resetlogs;
SQL>create user OPS$UZDADM identified by password  (enter password)
SQL>create table sapuser (userid varchar2(256), passwd varchar2(256));
for ORACLE 9 to the sapuser "OPS$AZTADM".SAPUSER
SQL>select * from sapuser;
SQL>exit
SQL>insert into "OPS$AZTAD".SAPUSER VALUES('SAPSR3','SAPAZP','system');
       sqlplus / assysdba

- Enter the database by below command or by the Oracle Enterprise Manager. 
Add the datafile in the system to the PSAPTEMP tablespace.
SQL>alter tablespace PSAPTEMP add tempfile
'/oracle/systemID/sapdata2/temp_1/temp.data1' REUSE;
or
SQL>alter tablespace PSAPTEMP add tempfile
'/oracle/systemID/sapdata2/temp_1/temp.data1'
size 2000M REUSE autoextend an next 20M maxsize 5000M;

after this operations enter the system with user sap* and install the license.
Moreover edit the parameters in initUZD.ora file.

THE OPERATIONS ON SAP SYSTEM AFTER HOMOGENEOUS COPY

Enter tcode SE14 ; for below tables do operations ; Activate , Adjust and then Delete data.
DBSTATHORA, DBSTAIHORA ,DBSTATIORA , DBSTATTORA

Delete user OPS$UZPADM or lock.

SQL>alter database rename global_name to UZD;

from tcode SE06 do the post progressing operations for STMS after homogeneous copy.

Enter SICK tcode do controls for installation.It should be No error reported.

From tcode SE14 you should activate the tables as shown below : 
ALCONSEG, ALSYSTEMS, DBSNP, MONI , OSMON,PAHI, SDBAD,SDBAH, SDBAP,SDBAR

From SE38 run program RSBTCDEL. for all users and jobs select finished , canceled and delete with force mode and execute it.

From tcode SP12 do the consistencey check and delete old files.

Control SPAP, SM59. From SM58 clean the transactional RFCs.

From Tcode SE14 activate the DDLOG table (Delete Data)

Enter tcode SECSTORE and delete all RFCs with red.

Control the users from SU01.

Enter SE14 activate the tables ; TPFET & TPFHT (with delete data option).

From tcode RZ10 select and install profile parameters with import active server and make the configurations.

From RZ04 define instance and profile.

In RZ20 delete problems in CCMS alert files.

From SE14 activate TLOCK table.

Do SM28 Consistency check.

System log control from SM21.

Database consistency check from DB02.

Control the statistical logs in ST03.

SAP Notes related to OPS$ : Creating OPS$ on UNIX : 361641



After System Copy operation old system informations and system should be deleted from ST03N

SAP Note : 1179929

Enter SE16N , in &sap_edit mode run tables SWNCMONI & SWNCMONIINDEX . Enter and run old system informations (sap-product_UZP_00) in Host/Instance field , delete all shown datas and save.



Other Related SAP Notes : 534765 , 134592

No comments:

Post a Comment