Saturday, 14 June 2014

Refresh Activity

System copy procedure for R3 systems

Pre-refresh activity

1.      Take a full online backup of the destination database.
2.      Do a remote client copy of the user master records of the destination database to another client.
         This should be done this way
           Login to DEV 777
           T code: SCC4
           Create a new client say 999 & 911
          Now Login to DEV 777 using sap*/pass
            T code: SCC9
            Select the profile : SAP_USER
            Source destination: RFC connection to RAD 777
Schedule as a background job
The logs are displayed in SCC3
Repeat the same for client copy of the user master records of RAD 711 also.

3.      Export the tables of RAD 777 and RAD 711 using the R3trans utility using the following scripts.
These scripts export tables related to rfcs, variants, ale configuration, printers and custom tables to dump files which can be imported back after the system copy.

Example:
R3trans –w export_<client>_<sid>_<area>.log export_<client>_<sid>_<area>.co
(Substituting the appropriate values for <client>, <sid> and <area>)

The following scripts can be used for the purpose.

export_777_RAD_rfc.co
export_777_RAD_var.co
export_777_RAD_vault.co
export_777_RAD_ale.co
export_777_RAD_prt.co
 export_777_RAD_ztables.co
othertabRAD_777.co
archivelinkRAD_777.co
commonstoreRAD_777.co
export_777_RAD_arc.co

Also a similar set of scripts exists for the client 711.

4.      Take screenshots of SMLG, RZ12 and RZ04, SCOT settings for configuring the same after refresh.
5.      Download the list of transport requests from the Import history.
          Check with the TCCM on the date from which transports need to be imported to the system after the system copy.

6.      Take a back up the control file of the source database using the command
 Alter database backup controlfile to trace;
This trace file can be found at /oracle/GOL/saptrace/usertrace
Copy this file to another location and save it, say /oracle/<SID>/control_backup.trc

Refresh activity
Restore the database from the last good backup from production.
Change initRAD.utl file to point to GOL management classes. Copy initGOL.bki and backGOL.log to <Target Machine>.

Restore the database using:
Brrestore –u / -p initGOL.sap –m oracle/GOL/sapdata16/=oracle/RAD/sapdata16/,
/oracle/GOL/sapdata3/=oracle/RAD/sapdata3/,
/oracle/GOL/sapdata1/=oracle/RAD/sapdata1/,
/oracle/GOL/sapdata4/=oracle/RAD/sapdata4/,
/oracle/GOL/sapdata8/=oracle/RAD/sapdata8/,
/oracle/GOL/sapdata10/=oracle/RAD/sapdata10/,
/oracle/GOL/sapdata2/=oracle/RAD/sapdata2/,
/oracle/GOL/sapdata7/=oracle/RAD/sapdata7/,
/oracle/GOL/sapdata17/=oracle/RAD/sapdata17/,
/oracle/GOL/sapdata18/=oracle/RAD/sapdata18/,
/oracle/GOL/sapdata19/=oracle/RAD/sapdata19/,
/oracle/GOL/sapdata20/=oracle/RAD/sapdata20/,
/oracle/GOL/sapdata5/=oracle/RAD/sapdata5/,
/oracle/GOL/sapdata6/=oracle/RAD/sapdata6/,
/oracle/GOL/sapdata9/=oracle/RAD/sapdata9/,
/oracle/GOL/sapdata11/=oracle/RAD/sapdata11/,
/oracle/GOL/sapdata12/=oracle/RAD/sapdata12/,
/oracle/GOL/sapdata13/=oracle/RAD/sapdata13/,
/oracle/GOL/sapdata14/=oracle/RAD/sapdata14/,
/oracle/GOL/sapdata15/=oracle/RAD/sapdata15/,
/oracle/GOL/sapdata21/=oracle/RAD/sapdata21/,
/oracle/GOL/sapdata22/=oracle/RAD/sapdata22/,
/oracle/GOL/sapdata23/=oracle/RAD/sapdata23/,
/oracle/GOL/sapdata24/=oracle/RAD/sapdata24/,
/oracle/GOL/sapdata30/=oracle/RAD/sapdata30/,
/oracle/GOL/sapdata31/=oracle/RAD/sapdata31/,
/oracle/GOL/sapdata32/=oracle/RAD/sapdata32/,
/oracle/GOL/sapdata33/=oracle/RAD/sapdata33/,
/oracle/GOL/sapdata34/=oracle/RAD/sapdata34/,
/oracle/GOL/sapdata35/=oracle/RAD/sapdata35/,
/oracle/GOL/sapdata36/=oracle/RAD/sapdata36/,
/oracle/GOL/sapdata37/=oracle/RAD/sapdata37/,
/oracle/GOL/sapdata38/=oracle/RAD/sapdata38/,
/oracle/GOL/sapdata39/=oracle/RAD/sapdata39/,
/oracle/GOL/sapdata40/=oracle/RAD/sapdata40/,
/oracle/GOL/sapdata41/=oracle/RAD/sapdata41/,
/oracle/GOL/sapdata42/=oracle/RAD/sapdata42/,
/oracle/GOL/sapdata43/=oracle/RAD/sapdata43/,
/oracle/GOL/sapdata44/=oracle/RAD/sapdata44/,
/oracle/GOL/sapdata45/=oracle/RAD/sapdata45/ -b <logname.anf>

Brrestore –a <fromseqno>-<toseqno>
(fromseqno is the archive log sequence to apply from and toseqno is the archive logs which have to be restored to bring the database to a consistent state)  
     
Post-refresh activity
7.      start the database in ‘nomount’ state.
         Startup nomount
8.      Make sure that the owner of all the files at /oracle/<SID> is ora<SID> if their ownership has changed due to the mount/unmount of sapdata* file systems.
9.      Create control files so that it reflects the status of the current physical structure of the database.
Copy the text of control_backup.trc from “create control file” until “;” and paste it into a new .sql file
Edit the file and replace the source SID with the destination SID
Edit the file and replace “Reset database” with “set database” and “nosetlogs” with resetlogs
Example:
“CREATE CONTROLFILE SET DATABASE "GOL" RESETLOGS ARCHIVELOG”
Execute this .sql script in the destination system.
This will create the control files at the locations mentioned in the init<SID>.ora
10.  alter database open resetlogs
11.  Run the necessary sql scripts
(i)                 Catalog.sql &
(ii)               Catproc.sql.
These scripts are located at $oracle_home/<SID>/rdbms/admin
12.  create the user OPS$<SID>ADM
The command is
CREATE USER "OPS$<SID>ADM" TEMPORARY TABLESPACE PSAPTEMP DEFAULT TABLESPACE PSAPUSER1D IDENTIFIED externally;
13.  Grant connect, resource to OPS$<SID>ADM
14.  Grant sapdba to OPS$<SID>ADM
15.  Execute the script sapdba_role.sql corresponding to the right database version (10g in this case).
16.  create tempfiles using the command given in the control_backup.trc (Refer to step 6)
17.  Export and Import the sapuser table of OPS$<SID>adm from source to destination.
The commands are as follows.
Login as sidadm for this task.
Exp / file=user.dmp tables=’OPS$<source_SID>.sapuser’
Imp / file=user.dmp full=y

18.  Check connectivity using the command R3trans –d. Start sap if connectivity is fine.
      startsap r3
19.  Get all the released jobs to scheduled status except SAP standard jobs and house keeping jobs
20.  Apply SAP License for the destination system once you request for a license in service marketplace and get the license key.
Login to the newly refreshed SAP system as SAP*/pass
Tcode: Slicense
From the Edit menu select Install License
Enter the appropriate information.
Enter the license key

21.  Configure the workbench organizer for Database copy in SE06 and Reconfigure the TMS
Login to the newly refreshed system (RAD in this case)
T Code: SE06
i.      Select the Database Copy or migration option
ii.      Press the Post-installation Processing button.
iii.      When prompted Do you want to re-install the CTS?,  press the Yes button
iv.      When prompted for the Source System of Database Copy?, make sure that the <SID> of the source system is selected.(EQ2 in this case), Press the checkmark button to continue.
v.      When prompted Change originals from source to destination? press the NO button
vi.      When prompted Delete TMS Configuration?, press the NO button
vii.      When prompted Delete old TMS configuration?, press the NO button
viii.            When prompted Delete Old Versions of transport routes?, press the NO button


Login to 000, DDIC of the Domain controller
T Code: STMS
i. From the Overview menu select systems.
ii. From the displayed list of systems select the newly refreshed system (SID in this case).
iii. From the SAP System menu select Delete.

Login to 000, DDIC of the newly refreshed system.
T Code: STMS
i. Upon starting STMS, a window with the title TMS: Include System in Transport Domain should be displayed
ii. The information on this screen is automatically filled out from information provided during the SAP installation and should be correct.  If it is correct, then enter a description for the system save. Otherwise, press the other configuration button and manually configure.
iii. From the Overview menu, select Transport Routes
iv. From the Configuration menu, select Adjust with Controller
v. Press the Yes button when prompted if you want copy the transport routes from the controller.

Login to 000, DDIC of the Domain controller
T Code: STMS
i. From the Overview menu select systems.
ii. From the displayed list of systems select the newly refreshed system (SID in this case).
iii. From the SAP System menu select Approve.


22.  Import back the printers, Variants, Ztables, RFC, ALE, printer configurations etc.
Before importing the tables we need to remove the entries corresponding to client 777 and 711 to make sure that the table entries do not get appended.
For Client dependent tables,
Delete the entries for which mandt=777 or 711 of all the tables exported


SQL statement Syntax:
Delete  from sapr3.<table name> where mandt=’777’ OR mandt=’711’;
Commit;
For Client independent tables,
Truncate the table
SQL statement Syntax:
Truncate table sapr3.<table name>;

Import back the tables of <SID> 600 using the R3trans utility using the following command

R3trans –w import_<client>_<sid>_<area>.log import_<client>_<sid>_<area>.co
                        (Substituting the appropriate values for <client>, <sid> and <area>)

The scripts used for the purpose are as follows:

import_777_RAD_rfc.co
import__RAD_var.co
import_777_RAD_vault.co
import_777_RAD_ale.co
import_777_RAD_prt.co
 import_777_RAD_ztables.co
othertabRAD_777.co
archivelinkRAD_777.co
commonstoreRAD_777.co
import_777_RAD_arc.co   

Also a similar set of scripts exists for the client 711.


23.  Import back the necessary transport requests.

24.  Delete the entries from the tables TLOCK and SNAP.
25.   Delete the entries from the following tables. MONI,OSMON,DBSNP,SDBAH,SDBAD,SDBAP,SDBAR,SNAP and  only entries in table PAHI where hostname is equal to server name from source database.
26.  Import back the user master data.
            Login to RAD 777
            T code: SCC9
            Select the profile : SAP_USER
            Source destination: RFC connection to DEV 800
Repeat the same for importing the user master records of RAD 711 too.



27.  Execute PFUD to ensure that all users’ authorizations are taken care of.

T Code: PFUD
From the menu Program select Execute in background

28.  Make sure that none of the RFC destinations correspond to production link.

Tcod    e: SM59



29.   Make sure that the spool servers of all the output devices point to the newly refreshed system’s server (HKERPD01_RAD_70 in this case)
T Code: SPAD
From the Utilities menu select For output devices & Assign server
Enter the appropriate values in the corresponding selection screen.



30.  Import the start, default and instance profiles of RAD.
T Code: RZ10
Save and Activate the same.



31.  Review logon groups and make sure that it points to the correct logon group(RAD-LOGON in this case)
T Code: SMLG


32.  Maintain RFC server groups.
T Code: RZ12



33.  Perform Temse consistency check.
T Code: SP12
i.      From the TemSe database menu, select Consistency check
ii.      When the check is complete, press the Delete All button. 

34.  Create operation modes and maintain the work process distribution as it was before refresh.
T Code: RZ04


35.  Maintain Operating Mode Set as it was before refresh
T Code: SM63


36.  Make sure that the target server of the jobs does not point to the source system’s server.

Sample sql statement:  
update sapr3.tbtco set EXECSERVER=' ' where EXECSERVER like '%<SOURCE SID>%';


36.  Configure the Unix SAP Internet Mail Gateway as it was before the refresh.

Make sure that a RFC Destination with Connection Type – T and program - /sapmnt/SID/exe/mlunxsnd.csh exists.

E-mails sent from an SAP application are merely put into a queue. A periodic background job needs to be scheduled to take the e-mails from this queue and send them.

For Internet:
Schedule a job to run the report RSCONN01 periodically.


For Fax:
Schedule a job to run the report RSCONN01 periodically.

37.  Disable logging options.
Check the parameter rec/client. If this value is OFF table logging should be off. Else if it is set to the value of ALL or a client number table logging is set for all the clients or the particular client its set to. Changing this instance profile parameter to OFF would call for a restart.

38.   Delete Cancelled and Finished jobs by running RSBTCDEL2 in forced mode.










     
















1 comment:

  1. Hi Hari,
    Do you have the table name for creating the following files:
    export_777_RAD_rfc.co

    export_777_RAD_var.co

    export_777_RAD_vault.co

    export_777_RAD_ale.co

    export_777_RAD_prt.co

    export_777_RAD_ztables.co

    othertabRAD_777.co

    archivelinkRAD_777.co

    commonstoreRAD_777.co

    export_777_RAD_arc.co

    regards
    Tony

    ReplyDelete