System Refresh Steps Latest

38
System Refresh Procedure

description

refresh

Transcript of System Refresh Steps Latest

Page 1: System Refresh Steps Latest

System Refresh Procedure

Page 2: System Refresh Steps Latest

System Refresh

PRE-REFRESH ACTIVITIES

1. Export Tables TBTCO and TBTCP before SAP shutdown for Refresh.Check the available space to dump the export file.Login as ora<sid> exp userid=sapr3/<sid>53r3 tables=TBTCO file=/oracle/<SID>/saparch/TBTCO.dmp log=/oracle/<SID>/saparch/TBTCO.logexp userid=sapr3/<sid>53r3 tables=TBTCP file=/oracle/<SID>/saparch/TBTCP.dmp log=/oracle/<SID>/saparch/TBTCP.logexp userid=sapr3/<sid>53r3 tables=TSRVGRP File=/oracle/<SID>/saparch/TSRVGRP.dmp log=/oracle/<SID>/saparch/TSRVGRP.log

IMPORT HISTORY (TRANSPORT)

Export Printer configuration

Login to Default client with proper authorization Execute Transaction SPAD.

Click on output device. To export output device GOTO

Utilities for Output device Export Devices.

Page 3: System Refresh Steps Latest

To export device type goto

Utilities for device type Export

Export user Data

Execute transaction SCC8. Select SAP_USER profile to export user data and Authorization Profile.

Select the logon system itself as target system.

Page 4: System Refresh Steps Latest

Select Schedule as background job. Select the Background server. Press F4 get the default background server.Click check box of immediately and no Printing Diolog

Page 5: System Refresh Steps Latest

Generate requests during Client export from target system

RFC Destination Transport Request

Transport RFC Tables: Execute transaction SE10.

Page 6: System Refresh Steps Latest

Deselect Customizing Request Tab. Goto Request/Task Create

Click on create and select option transport as copies

Page 7: System Refresh Steps Latest

Note: In the above select only workbench request

Entrer Short Description and click save button.

Enter target systemNew request will be generated.

Page 8: System Refresh Steps Latest

Double click on Request. This will bring you below screen to add object into request. Click on change button.

Add below list of objects.

R3TR TABU RFCATTRIB (Administration table for RFC destinations)                       R3TR TABU RFCCHECK (Table for asynchronous RFC administration)R3TR TABU RFCCMC (CMC data for mail)R3TR TABU RFCDES (Destination table for Remote Function Call)                    R3TR TABU RFCDOC (Description of Possible RFC Connections (->RFCDES))R3TR TABU RFCSYSACL (List of permitted trusted systems for the current)R3TR TABU RFCTRUST (List of existing trusting systems)R3TR TABU RZLLICLASS (Logon Group List)                       R3TR TABU RZLLITAB (Assignments of Logon/Server Groups to Instances)

Page 9: System Refresh Steps Latest

Click on Function tab button

Put * and press save button (CTRL S). Include * in each object. Go back to previous screen and press save button.

Page 10: System Refresh Steps Latest

After save go back and check for individual entries contain * entry.

After verification click on Request # and release the request (F9) or press button..

Page 11: System Refresh Steps Latest

Logical System Name

Execute transaction SALE. Execute Define Logical System

Click OK

Page 12: System Refresh Steps Latest

Take screen shot and paste it.

Page 13: System Refresh Steps Latest
Page 14: System Refresh Steps Latest

SAP license data on the target server.

Logon to target server as <SID>adm & do as below.

This will generate file which contain sap license data & preserve it in pre-refresh directory

Take screen shots of client settings also. This is very important. Go to SCC4 and take a screen shot of the first page and a screen shot of the default client.

Create trace file

Logon to source system as ora<SID> (Unix) or use <SID>adm (Windows) & create trace file.

Enter commands as below

Sqlplus “/as sysdba”

SQL> alter database backup controlfile to trace;

Page 15: System Refresh Steps Latest

For Restoring Data from Tapes (Tivoli) 

Login to target server as <SID>adm

Changes to D:\oracle\<Target server SID>\920_64 (UNIX) OR 920 (Windows)\database\init<SID>.utl

  Make a copy of this file with name init<Target SID>.utl.orig_Date_stamp

  Then make the following changes to init<SID>.utl

 SERVER         tsmsrv2-sap               # Server name

  # ADSMNODE UKHRTST-SAP       # Tivoli Storage Manager Nodename  ADSMNODE UKHRPRD-SAP  CONFIG_FILE  D:\oracle\XHT\920\database\init<target>.bki

Copy the following files from production server to current server. 

From D:\oracle\<Source SID>\920\database\init<Source>.bki

To   D:\oracle\<Target SID>\920\database\init<Source>.bki

Note: For the above step copy the init<source>.bki from source to target. Make a copy of this same file and rename it as init<target>.bki.

From D:\usr\sap\<Source SID>\sys\exe\run\dsm_opt\tsmsrv2-sap.optTO From D:\usr\sap\<Target SID>\sys\exe\run\dsm_opt\tsmsrv2-sap.opt

Note: The tsmsrv2-sap.opt file has the IP address of the TSM server from where the backup is being restored. The path mentioned above is present only on windows. On Unix there is no tsmsrv2-sap.opt file. The files that contain the IP are dsm.opt and dsm.sys. These files are present in the path /usr/bin. Also, root access is required for making changes to these files.

  Copy backup log file {e.g. bdryfouj.aff } from Source system to Target system

To restore data enter command as below

brrestore -d util_file -b "bdryfouj.aff" -m full

The above command sometimes will not kick off. It might show an error related to Tivoli servers. For eg. “Tivoli Storage Manager Server unavailable”. This means that the backup device type (Tivoli storage servers) is not initialized. Run the following command to initialize the device.

backint –p <.utl file with extension> –f inquire

backint –p <.utl file with extension> –f password

Give the full path of the .utl file in the command above. While executing, it will ask for a password. The password is initial. Once this executes successfully run brrestore -d util_file -b "bdryfouj.aff" -m full to restore data from the tapes.

Page 16: System Refresh Steps Latest

Once the above is successful archives have to be restored from the tape again. There are two ways to do this.For this copy arch<sourceSID>.log from source to target and rename as arch<targetSID>.log. These are present in /oracle/<SID>/saparch.

Also copy the required .cds files from source to target

From the target system, give the command below.

brarchive –a sequence number-sequence number.

An easier way of restoring the archives is from the source system itself. This does not require the arch<SID>.log file and .cds files to be copied from source to target. Give the below command from the Source system.

brrestore –a sequence number-sequence number.

Copy the restored archive files from the Source to target and rename them.

After successful restore copy backup file init<Target SID>.utl.orig_date to init<Target SID>.utl

Copy archive log files from source system to target system to perform point in time recovery and rename.

Note: Suppose there are too many archive required for the recovery, say about a 100 files, it is difficult to rename the files one by one. It can be done too if the below need not be followed.

An easier way of going about this is to change the archive destination.

Go to SQL prompt and give below command.

archive log list;

The above will give details about the archive path etc..

Then Run below command from SQL prompt.

alter system set log_archive_dest =’/oracle/<SID>/saparch/XXXarch’;

XXX denotes the SID of the archive file copied from the source.

Once recovery is over, A shutdown and startup of the database will automatically bring the archive destination to its original path.

DATABASE REFRESH STEPS

Page 17: System Refresh Steps Latest

Copy trace file from Source system to Target system & Proceed as below

Log on as ora<Target SID> to the DB host for <Target SID> and execute:

cp /tmp/<TRACEFILE> <Target SID>_control.trceg: cp /tmp/pr2_ora_26692.trc rtt_control.trc

Edit the <TRACEFILE> and make the following changes:

vi <sid2_control.trc >Locate “STARTUP NOMOUNT”

:/START and press n until the location is found

Place the cursor on the line with “STARTUP NOMOUNT” (very Important)

:1,.d From 1st line till current line, delete everything.:/; Locates the Semicolon in the trace file.

Place the cursor on the line below the semicolon.:.,$d From the current line till end, delete everything.

Change “REUSE” to “SET”Change “NORESETLOGS” to “RESETLOGS”Change “ARCHIVELOG” to “NOARCHIVELOG”

Change the <SID1> to <SID2> in the entire file as::1,$s/<SID1>/<SID2>/g From 1st line till end search for SID1(Source) and replace with SID2(Target)

Save and exit.:wq!`

Rename the database by executing following command

Sqlplus “/ as sysdba”startup nomount@< sid2_control.trc >;exit

Rename the offline redo logs in the /oracle/<Target SID>/saparch or /oracle/<Target SID>/saparch2. Rename the <Source SID> offline redo logs to <Target SID>.

Use the following command:

Page 18: System Refresh Steps Latest

ls -1 <SID1>* | cut -b4- | awk '{print "mv <SID1>" $1 " <SID2>" $1}' > file1.sh

Check the owner of SID2arch1_*.dbf files If owner is SID1, change to SID2chown ora<sid2> SID2arch*.dbf

chmod 700 file1.sh

./file1.sh

To recover using these offline redo logs, execute the following from sqlplus “/ as sysdba”

For the POINT-IN-TIME recovery:

recover database until time ‘yyyy-mm-dd:hh:mm:ss’ using backup controlfile (Make sure you use single quote in the above command and are in the directory where the Log-files are renamed. Ensure the exact data & time of recovery is obtained)

After recovery is complete to open the database

ShutdownStartup mountAlter database open resetlogs;Exit

IMPORTANT : Please note the above command (Alter database open resetlogs) may take a long time

WARNING: Please do NOT attempt to stop it in anyway (eg Control C) Please give it as much time as it wants

Do a complete shutdown and startup just to confirm that db is able to start/stop automatically

Start listener

POST DATABASE REFRESH STEPS

Add temp data files manually after database has been opened

Page 19: System Refresh Steps Latest

ALTER TABLESPACE PSAPTEMP ADD TEMPFILE '/<data file name>' reuse;

Configure DB Users for Target SID

Log on as ora<Target SID> to the DB host of <Target SID> and execute:

sqlplus “/ as sysdba”

================= Script applicable to Windows ======================

Create user “OPS$XRXEU\SAPSERVICECET” identified externally default tablespace PSAPUSER1D temporary tablespace PSAPTEMP;

Grant connect, resource, sapdba to “OPS$XRXEU\SAPSERVICECET”;

Create user “OPS$XRXEU\CETADM” identified externally default tablespace PSAPUSER1D temporary tablespace PSAPTEMP;

Grant connect, resource, sapdba to “OPS$XRXEU\CETADM”;

Create table “OPS$XRXEU\CETADM”.SAPUSER as select * from “OPS$XRXEU\CEPADM”.SAPUSER;

Verify that the entries ahs been created by the below query:

select * from "OPS$XRXEU\XHTADM".SAPUSER;

USERID--------------------------------------------------------------------------------

PASSWD--------------------------------------------------------------------------------

SAPR3-CRYPTV01/0010ZctvSB67Wv3Oyaw=

drop user "OPS$XRXEU\SAPSERVICEXHP" cascade

================= Script applicable to UNIX ======================

create user ops$ora<SID2> identified externally default tablespace PSAPUSER1D temporary tablespace PSAPTEMP;grant dba to ops$ora<SID2>;

Page 20: System Refresh Steps Latest

create user ops$<SID2>adm identified externally default tablespace PSAPUSER1D temporary tablespace PSAPTEMP;grant dba to ops$<SID2>adm;

create table ops$<SID2>adm.sapuser as select * from ops$<SID1>adm.sapuser;drop user ops$<SID1>adm cascade;

select * from ops$<SID2>adm.sapuser;alter user sapr3 identified by <PASSWORD>;update ops$<SID2>adm.sapuser set passwd=`<PASSWORD>`;commit;exit;

Applicable in both Windows and Unix environment

Login as ora<sid> (In case of NT login as <SID>ADM)SapdbaChose option m <User and Security>Chose option d <Initialise sap connect>

Respond with “y” and continue. Exit from sapdba

Import sapdba_role.sql role (Copy role from /sapmnt/<SID>/exe to working directory)

Login as ora<Target SID> & Enter following commands

On Windows sqlplus /nolog @sapdba_role.sql <SCHEMA ID> NTOn UNIX sqlplus /nolog @sapdba_role.sql <SCHEMA ID> UNIX

Note: For the above commands type NT or Unix (depending upon your OS) at the end of the command.

Truncate the below table

truncate table sapr3.apqi;truncate table sapr3.apqd;truncate table sapr3.ddlog;

Page 21: System Refresh Steps Latest

truncate table sapr3.sdbad;truncate table sapr3.sdbah;truncate table sapr3.sdbar;truncate table sapr3.dbstathora;truncate table sapr3.dbstaihora;truncate table sapr3.dbstatiora;truncate table sapr3.dbstattora;truncate table sapr3.dbsnp;truncate table sapr3.osmon;truncate table sapr3.pahi;truncate table sapr3.moni;truncate table sapr3.tpfet;truncate table sapr3.tpfht;truncate table sapr3.tlock;truncate table sapr3.tsp01;truncate table sapr3.tsp01p;truncate table sapr3.tsp02;truncate table sapr3.tsp02a;truncate table sapr3.tsp02f;truncate table sapr3.tsp02fx;truncate table sapr3.tsp02l;truncate table sapr3.tspjstat;truncate table sapr3.tspqstat;truncate table sapr3.tst01;truncate table sapr3.tst03;truncate table sapr3.vbmod;truncate table sapr3.vbdata;truncate table sapr3.vbhdr;truncate table sapr3.vberror;truncate table sapr3.tbatg;truncate table sapr3.trbat;truncate table sapr3.snap;truncate table sapr3.bdcps;truncate table sapr3.bdcp;truncate table sapr3.bdcpv; truncate table sapr3.tbtcp;truncate table sapr3.tbtco;truncate table sapr3.tsrvgrp;delete from sapr3.tbtco where status <> 'P';

Change below profile parameter to 0 in Instance profile on target system.o rdisp/wp_no_spo = 0o rdisp/wp_no_btc = 0

Lock all the printers

SQL> select padisabled, count(*) from sapr3.tsp03d group by padisabled;

SQL> update sapr3.tsp03d set padisabled='X';

Lock all the users

Page 22: System Refresh Steps Latest

select mandt, uflag, count(*) from sapr3.usr02 group by mandt, uflag;

update sapr3.usr02 set uflag=128 where uflag=0 and mandt=100;

update sapr3.usr02 set uflag=128 where uflag=0 and mandt=000;

update sapr3.usr02 set uflag=0 where bname in (‘sap’ , ‘DDIC’);

STEP 8: Start SAP for <SID2>

Download the license data using the OSS user.

Log on as <sid2>adm to the DB host of <SID2> and execute:saplicense –installEnter the information when prompted.

Import tables TBTCO and TBTCP

Log on as ora<sid>

Drop tables TBTCO and TBTCP before importing into the system

sqlplus “sapr3/<passwd>”drop table tbtco; (this will delete its associated indexes also)drop table tbtcp; drop table tsrvgrp;exit;

imp userid=sapr3/<sid>53r3 file=/oracle/<SID>/saparch/TBTCO.dmp full=y log=TBTCO.logimp userid=sapr3/<sid>53r3 file=/oracle/<SID>/saparch/TBTCP.dmp full=y log=TBCP.logimp userid=sapr3/<sid>53r3 file=/oracle/<SID>/saparch/TSRVGRP.dmp full=y

log=TSRVGRP.log

Note: check the log to confirm the import is successful without errors & warnings.

Start SAPLog on as <sid2>adm to the DB host of <SID2> and execute:startsap r3

Page 23: System Refresh Steps Latest

Log on as <sid2>adm to each application host of <SID2> and execute:Startsap scripts for each valid instance.

Run Transaction code OAC0 & change all Customized entries as per points below (This is for the systems connected to DMS, e.g. HR & NRP)

Important points to be remembered after a system copy:

1. After finishing the system copy immediately change the content server hostnames for ALL repositories in the transaction OAC0 to thehostname of the content server that belongs to the target system.

2. To avoid unauthorized document accesses you should immediately generate a new private key security environment for your target systemby using the transactions PSEMAINT and/or STRUST. Read OSS note 361123 for details.

3. Always keep AdminSecurity activated on all content servers and make sure that the passwords of your administrative accounts arelocally unique for all servers.

4. Always prepare a complete and up to date backup of your content servers

Run T-code SE06 & switch to target SID. Check the background jobs if exists please delete it. Change the profile parameter to existing value.

o rdisp/wp_no_spo = <To original Value>o rdisp/wp_no_btc = <To original Value>

Stopsap & startsap Import profile (RZ10) Go to RZ04. Click on Instances/operation modes. Then goto

SETTINGSBASED ON CURRENT STATUS-NEW INSTANCES-GENERATE.

The above is for generating the original instance after the system copy. Change the client settings (e.g. logical system, Client dependent/independent

settings etc). STMS Configuration Check background job if old jobs are exists please delete Check whether RDDIMPDP job is scheduled or not if not then login to client 000

as DDIC & schedule. Enter T-code SE38 RDDNEWPP High priorityNote: No imports will happen in the system if the above step is not carried out from client 000. The scheduling of RDDNEWPP has to be done from client 000 using user DDIC before importing the user master records.

Schedule standard background jobs

Page 24: System Refresh Steps Latest

Import user master records (Import request)After client import perform post client import processing (SCC7) using DDIC.While SCC7 is running it may happen that system gets locked. From another session goto SCC4 & remove tag “locked due to client copy”

Import RFC Connection data (Import Request)

Import Device types

Import Device type

Page 25: System Refresh Steps Latest

Import Output Devices

Run BDLS to convert logical system (As shown in below figure)

Page 26: System Refresh Steps Latest

Source Logical system Target Logical System

ALE configuration steps to be undertaken after a refresh

1) Distribute the models (only required if EQ1 refresh has occurred) ( Transaction Code BD64)

Page 27: System Refresh Steps Latest

Distribute the ALE models to the EQ1 clients (530 for XHT, 510 for XHS).

2) Generate the partner profiles and ports

Page 28: System Refresh Steps Latest

Generate the partners and ports for the test model. This needs to be done on each box that has been refreshed as the program only generates what is relevant in the model to the box the program runs on.

Page 29: System Refresh Steps Latest

3) Add the RFC destination for the BAPI calls ( Transaction Code SALE)

Add the RFC destination that is appropriate. Note that at refresh time BASIS may not have created the RFC’s for EQ1 as they may not know to do so. If they haven’t been created then this can be done via SM59.

Page 30: System Refresh Steps Latest

To add the RFC destination use the create ‘Standard BAPI destination’ button.

Page 31: System Refresh Steps Latest

4) Change the custom conversion rule for the logical system from XHPCLNT100 to (XHT/XHS)CLNT100.

A conversion rule exists in XHP to hardcode the logical system to XHPCLNT100 and therefore will be refreshed back to XHT/XHS. Change this using the following steps:

Page 32: System Refresh Steps Latest

e.g: XHS System

Page 33: System Refresh Steps Latest

s0004451345

s0004450222