Monday 23 September 2019

SAP FUNDAS REGARDING CLIENT COPY


SAP CLIENT COPY :

Client copy can be done by 3 different ways.

  1. Local Client copy
  2. Remote Client copy
  3. Client Export or Import
Local Client Copy : 
  •  Logon to the newly created client with sap* user and password.
  • Execute Tcode SCCL 
  • Select profile ,source client and start immediately 
Remote Client Copy :

  • Logon to the newly created client with sap* user and password.
  • Execute Tcode SCC9.
  • Select Profile and Source destination RFC and start immediately.
Client Export/Import :

  •  Client export done from source system using Tcode : SCC8, with select profile and target system and start immediately.
  • Client export done from newly created client from target system by executing tcode STMS_IMPORT and select the transport number which was created while doing export and now import the TR.

 

Monday 16 September 2019

SAP BASIS FANDAS_SYSTEM REFRESH

SAP SYSTEM REFRESH



  • Why we do system refresh? 
      We do system refresh because we need data for testing in development layer.Those testing should be done by SAP functional consultants.Basically in system refresh activity what basis consultant do he just copy the production systems data into development layer so all developers can do testing.
  • Before starting system refresh what we need to do below steps 1st:     
  • We need to reset the source and destination client DDIC password of 000 client.
  • We need to reset the Schema password (SAPSR3).If not working need to reset it with BRTOOLS.
  • We need to reset the password of SIDADM.
  • We need to reset the password of ORASID.

Before starting we need to remember the following points :

1) Clone to be created through SNAPMIRROR volumes by storage team using the backup taken by BASIS.

2) Split the clone which will be done by storage team.
3) Unmount the original volume which will be done by unix team.
4) Rename the old data and log volume as OLD (volume name) by Storage team.
5) Rename the  volume  CLONE_ORA_(SID)_DATA to ORA_(SID)_DATA by storage team.
6) Now mount the volumes in ORA_(SID)_DATA physical server.
7) Application team will start the applications and monitor it.

The actual activity is divided into 3 types :

1) Pre refresh steps.
2) Actual activity.
3) Post Refresh steps.


Pre-Refresh steps:

  • Take screen shots of mount points.
  • Take a screen shot of client overview.
  • Execute tcode SCC8.Select SAP_USER profile to export the user data and authorization profile.


  • Check the schema user and schema user password working or if not then reset it with BRTOOLS or sql command
  • Take a backup of redo log files 1 hour before and 1 hour after from production system.
  • Take screen shot of Transport overview from STMS.
** Now during exporting from client / (100/200) with DDIC user we need to take the screen shot of the Transports , there will be 3 transport request i.e KO,KT,and KX.


KO transport is for : transporting cross client data
KT transport is for : Client specific data
KX transport is for : Client specific texts,provided texts available in that client.










  • Now we need to stop the background jobs :
SA38-> BTCTRNS1 and suspend all the standard background jobs
Now – stopsap & listener.

Go to the folder location /oracle/SID/refconf and go the folders mentioned below and delete Old log files in the folder mentioned below.


Implog – rm *.log
Refdmp – rm *.dmp
Reflog – rm *.log & rm nolog.txt 


  •  Backup of redo log files:






Now, start export: (It will run around 10-15mins)
here we use scripts to export RFC tables,we can also export those tables through transport.


Once export is done … bring the database down and take offline backup.
Now, send mail to Storage team to create clone.
Once work is done from UNIX and storage side, take as screenshot of df –PH command.

 DB Refresh (ORACLE) : Pre- steps

1) Take the backup (Online and Offline) of the production system through BRTOOLS or from db13 schedule the backup and copy those backup files and 3-4 archive files from source to destination server and rename it to SID/oracle/(tsid)/oraarch (use scp command).

Command : scp -r /oracle/SID/sapbackup root@destination server ip:/restore

2) Take RFC tables export through script or command."Export terminated successfully with warnings."
3) Take control file backup of Production system path will be :

from sql prompt : select name from v$controlfile;

Output will be :  NAME
--------------------------------------------------------------------------------
/oracle/SID/origlogA/cntrl/cntrlSID.dbf
/oracle/SID/origlogB/cntrl/cntrlSID.dbf
/oracle/SID/sapdata1/cntrl/cntrlSID.dbf

4) Now generate the control file from the source system :

>> alter database backup controlfile to trace;
>> exit

control file will be generated in the path :

/oracle/SID/saptrace/diag/rdbms/sid/ssid/trace/

file name will be with extention with .trc (SID...ora...xxxxx... .trc)

5) Now copy the trace file into oraarc directory and Edit the control files as mentioned below :

STARTUP NOMOUNT # delete before lines from 
     CREATE CONTROLFILE SET DATABASE "TSID" RESET LOGS FORCE LOGGING
     NOARCHIVELOG # edit 
CHARACTER SET WE8DEC; #delete after lines 

* Replace the Source SID to Destination SID.
** REUSE to SET.
*** NORESETLOGS to RESETLOGS.
**** ARCHIVE to NOARCHIVELOG.


6) Now we need to start the database with nomount option : startup nomount
7) Also execute the command "@SID_ora_xxxxx.trc" to create a control file in destination server.
8) Now recover the database command  : recover database until 'time stamp of backup need to recover' using  backup controlfile;  
(we can take the time stamp from redolog files which we took backup)

9) After recovery, stop the database and take offline backup.
10 ) Start the database : startup mount;
                                       alter database open resetlogs;

                                       commit;
                                       shu immediate;
11) Now start the Db in open state.

START REFRESH :

12 ) execute those commands after db start :

drop user ops$sapservice<ssid> cascade;
create user ops$<tsid>adm identified externally;
create user ops$ora<tsid> identified externally;
create user ops$sapservice<tsid> identified externally;
grant connect,resource,sapdba to ops$<tsid>adm;
grant connect,resource,sapdba to ops$sapservice<tsid>;
grant connect,resource,sapdba to ops$ora<tsid>;
SELECT * FROM DBA_USERS WHERE USERNAME = 'OPS$<tsid>ADM';
CREATE TABLE "OPS$<tsid>ADM".SAPUSER (USERID
VARCHAR2(256), PASSWD VARCHAR2(256));
INSERT INTO "OPS$<tsid>ADM".SAPUSER VALUES ('SAPR3','sap');

13) check r3trans -d if its connected with 0000 no issue if it give return code with 0012 we need to execute the below command :

                                      >> alter user SAPSR3 identified by sap;
 14) Login to su – sidadm
                        >Startsap all hostname


Post Steps:
 
Install license. ## Download license file from support.sap.com
Hit Sick and se06 commands and change system to new values
* Standard Installation, which has to be selected if the server installed with SAP Export
dump.
* Database copy or Migration, Which has to be selected if server installed with system
copy or Refresh mode.


**Configure the STMS .
***change the client setting in scc4 .
****Go to se03 system change options change to modifiable.
*****Change logical system name with the tcode BDLS
******Enable/Activate Audit log with Tcode SM19