Friday, January 11, 2019

SAP - deleting entries from SAP Table

Note : This will EMPTY SAP Table (be careful)

- go to SE14 entry TABLE NAME YOU WANT TO EMPTY.. and click on EDIT button.

Now select "Delete data" (1)  and than "activate and adjust database" (2) option .
if it is large table " use background option " (3) .

SAP -- Heap Memory Parameter Changes while system is running


Follow below procedure if you want to change Heap memory while SAP System is up and running.
this is sometime required if you running short of memory.
-- Execute Report

              --- go to "se38"
              --- run report "RSMEMORY"



now Change parameters and click on copy.



Note: Changes will be lost after system restart.


LOAD_PROGRAM_LOST dump in SAP


Solution is to clear buffer on Dialog Instance or restart Dialog which has the issue.



Causes (explanation on error ) 

  • Before you can execute an ABAP program,  you must make sure that the program load is loaded in the program buffer (PXA).
  • This is locked when you execute a program load so that it cannot be displaced from the buffer.
  • Since the program buffer is limited in size, the program locks may not be retained for longer wait times (for example, user interaction). Therefore, all previously set locks are released within the rollout.
  • If the system works intensively on the application server, the program load may be displaced from the buffer after a short time.
  • If you now change the program (because of a transport, for example) before the application continues, the database detects that the program has changed (the total time stamp is newer) when you reload the program (RELOAD).
  • To avoid inconsistencies when executing the program (the program may have changed so much that follow-on errors occur), the system triggers the short dump " LOAD_PROGRAM LOST.
  • You must not change the terminated program itself.
  • Changing a dependent object can also cause this termination.
  • You can use the report RSDEPEND to determine when the program was last generated and due to which change the total time stamp was set. This may be the case, for example, due to change to the DDIC types or program includes that are used.
  • In the result list of RSDEPEND, search for objects that have the same or similar time stamp to the total time stamp. You can quite easily find the trigger in this way. These dependent objects were then changed by a transport of by a direct change in the system.

  • If the short dump occurs regularly, you should initiate measures to ensure that its occurrence is less likely.
  • These are
  • Increase the program buffer so that no more swaps occur.
  • Make sure that you import transports only when there is no load or a low load. Particularly in a production system.

Monday, August 7, 2017

Trusted RFC between APAB Systems


- Create an RFC between two systems without maintain logon data 


- Create a Trust relationship . your user must have authorization on object S_SR on target system


Now go to Other ABAP system create RFC and Trust relationship

Create Trust relationship , 

Kernel Patching 745 to 749



Kernel Patching ... 745 to 749 .

- Download kernel files from SAP SWDC

---- Extract Kernel files

----- SAPCAR -xvf  SAPEXE_xyz.SAR  /sapmnt/SID/newexe (Kernel Part I DB independent)
----- SAPCAR -xvf  SAPEXEDB_xyz_.SAR  /sapmnt/SID/newexe (Kernel Part II DB dependent)
----- SAPCAR -xvf  dw_527_xyz.sar  /sapmnt/SID/newexe  (disp+work package)
----- SAPCAR -xvf  lib_dbsl_xyz.sar /sapmnt/SID/newexe (Database library)

Take backup of existing exe directory

Check path
login with SIDADM user and execute following command to check path

sappfpar pf=ECD_DVEBMGS00_SID.pfl

This will give you current directory path of kernel executable

Stop - SAP

/sapmnt/SID/exe/us/linuxx86_64

replace extracted files to this current kernel directories

now login as root and set premission on kernel direcoty

chown -R sidadm:sapsys /sapmnt/SID/exe/uc/linuxx86_64

and execute saproot script.

/sapmnt/SID/exe/uc/linuxx86_64/saproot.sh SID

and Start - SAP

******************************
To check patching History in System

Go to
SE16 and enter table name PATCHHIST

for details check SAP Note : 2450700

https://launchpad.support.sap.com/#/notes/2450700/E

***************************************************************

Sybase Database : Source database is larger than the target database,

You can also refer to SAP Note : 2345568
https://launchpad.support.sap.com/#/notes/2345568/E


Symptom

1) While restoring you will get error
Data on dump will not fit into current database. Need <xxx> Mbyte database

2) System Copy fails with error "Unable to load database <SID>

Cause
- The source database, where the dump was taken, is larger than the target database , where it is loaded
- The 'create database' statements are different between source (dump) and target (load).

Resolution :

To increase target database size , we need to check source database size for this execute load command with 'listonly=create_sql" this will generate a list of DDL command that contain data file size and log file size.

load database SID from "/backup/SID.dump_file" with listonly=create_sql
go


If the database already exist first you have to drop that database and also need to drop device layout for Data & Log files. 


***************
Command to drop devices 

sp_dropdevice <device name>
go 

i.e sp_dropdevie ECD_data_001
go 

***************
Command to Check size of DB 
sp_helpdb ECD 
go

***************
Below DDL's are generated from commands (in purple) & execute these command by order

load databae ECD from "/backup/ecd_dump.dmp" with listonly=create_sql
go 

or

go >> Script_DDL.sql

check file in /sybase/<SID>/  --- directory

***************



Command to create new devices 


DISK INIT

         name = 'ECD_data_001'
        , physname = '/sybase/ECD/sapdata_1/ECD_data_001.dat'
        , size = '108G'
        , directio = true
go


DISK INIT

         name = 'ECD_log_001'
        , physname = '/sybase/ECD/saplog_1/ECD_log_001.dat'
        , size = '10G'
        , directio = true

***************

Command to create database 

go

CREATE  DATABASE ECD
        ON ECD_data_001 = '10G'
        LOG ON ECD_log_001 = '10G'
WITH lob_compression = 100
        , inrow_lob_length = 2000
        , compression = page
        , index_compression = page
go

***************


Command to alter database 



ALTER  DATABASE ECD

        ON ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
                , ECD_data_001 = '1G'
go

***************

other execute ables 


master..sp_dboption ECD, 'abort tran on log full', true

go
master..sp_dboption ECD, 'allow nulls by default', true
go
master..sp_dboption ECD, 'allow wide dol rows', true
go
master..sp_dboption ECD, 'ddl in tran', true
go
master..sp_dboption ECD, 'deferred table allocation', true
go
master..sp_dboption ECD, 'full logging for all', true
go
master..sp_dboption ECD, 'allow incremental dumps', true
go
master..sp_dboption ECD, 'deallocate first text page', true
go
master..sp_dboption ECD, 'allow db suspect on rollback error', true


**************************************************
Apply transaction logs if required and issue database online command




Monday, July 31, 2017

Backup / Restore Procedure on SAP ASE DB --


Backup / Restore Procedure on SAP ASE DB --

Connection with DB 

login with
su - sybhdb
#Command to login with user on SID
isql -U sapsa -P password_sa_user -S SID -X

#Command to check Currently running DB 
sp_helpdb
go
#Command to check Backup servers
sp_hepserver
go

#To backup transnational data you have to disable trunc.log on chkpt 

***** error *** correction ...
DUMP TRANsaction to a dump device is not allowed while the trunc. log on chkpt.
option is enabled.  Disable the option with sp_dboption, then use DUMP DATABASE,
before trying again.
*************************
#Use command to switch to upper level 
use HDB
go
#Master command to change parameter 
master..sp_dboption HDB, "trunc log on chkpt", false
go
#checkpoint command to save new value
checkpoint
go
# Now you have to take full backup and after that you can take transnational backup as well 

#Command to  Backup Database of DB HDB on file system 

dump database HDB to "/data/backup/hdb_s1.dmp"
stripe on "/data/backup/hdb_s2.dmp" #stripe command will split db into pices
stripe on "/data/backup/hdb_s3.dmp"
with compression = 2 #compression ratio
go

#Command to Backup transactions of DB HDB on file system 

dump transaction HDB to "/data/backup/hdb_trn.trn"

go

#Restore Procedure 

#Command to check active connection with DB 

sp_who
go
#Command to restore DB 

load database HDB from "/data/backup/hdb_s1.dmp"
stripe on "/data/backup/hdb_s2.dmp"
stripe on "/data/backup/hdb_s3.dmp"

go
#Command to restore Transaction

load transaction HDB from ""/data/backup/t*.trn"
with until_time="September 28, 2012 1:02am"
go

#After Successful restore online command to set db online for user 
online database HDB